@macro-inc/sdk 0.5.0 → 0.6.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.
Files changed (138) hide show
  1. package/README.md +156 -23
  2. package/dist/{chunk-3SW6QVDV.js → chunk-4MI52GWV.js} +60 -1
  3. package/dist/{chunk-GT5EUYOR.js → chunk-HO75UE4Z.js} +133 -0
  4. package/dist/{chunk-P4DTO6VD.js → chunk-MCSQNZ4E.js} +6 -0
  5. package/dist/{chunk-HIW6KU2I.js → chunk-SJ6S2GAT.js} +712 -14
  6. package/dist/{chunk-J2VK3NOR.js → chunk-SK5CMXRV.js} +44 -14
  7. package/dist/{chunk-UVJLWLSJ.js → chunk-TMTYN2UK.js} +190 -2
  8. package/dist/{chunk-PPR7IWZ7.js → chunk-ZYBAKW25.js} +2 -1
  9. package/dist/generated/agent-fold/index.d.ts +194 -8
  10. package/dist/generated/agent-harness/index.d.ts +1 -1
  11. package/dist/generated/agent-harness/index.js +1 -1
  12. package/dist/generated/agent-harness/sdk.gen.d.ts +33 -2
  13. package/dist/generated/agent-harness/types.gen.d.ts +341 -8
  14. package/dist/generated/agent-reviews/index.d.ts +11 -9
  15. package/dist/generated/auth/index.d.ts +1 -1
  16. package/dist/generated/auth/index.js +1 -1
  17. package/dist/generated/auth/sdk.gen.d.ts +69 -1
  18. package/dist/generated/auth/types.gen.d.ts +734 -3
  19. package/dist/generated/calendar/types.gen.d.ts +10 -3
  20. package/dist/generated/cognition/index.d.ts +1 -1
  21. package/dist/generated/cognition/index.js +1 -1
  22. package/dist/generated/cognition/sdk.gen.d.ts +23 -6
  23. package/dist/generated/cognition/types.gen.d.ts +202 -114
  24. package/dist/generated/contacts/index.d.ts +1 -1
  25. package/dist/generated/contacts/index.js +1 -1
  26. package/dist/generated/contacts/sdk.gen.d.ts +5 -1
  27. package/dist/generated/contacts/types.gen.d.ts +56 -0
  28. package/dist/generated/email/types.gen.d.ts +8 -2
  29. package/dist/generated/notification/index.d.ts +1 -1
  30. package/dist/generated/notification/index.js +1 -1
  31. package/dist/generated/notification/sdk.gen.d.ts +2 -1
  32. package/dist/generated/notification/types.gen.d.ts +138 -0
  33. package/dist/generated/scheduled-action/index.d.ts +1 -1
  34. package/dist/generated/scheduled-action/index.js +1 -1
  35. package/dist/generated/scheduled-action/sdk.gen.d.ts +92 -2
  36. package/dist/generated/scheduled-action/types.gen.d.ts +1455 -21
  37. package/dist/generated/search/index.d.ts +1 -1
  38. package/dist/generated/search/types.gen.d.ts +50 -11
  39. package/dist/generated/storage/index.d.ts +1 -1
  40. package/dist/generated/storage/index.js +1 -1
  41. package/dist/generated/storage/sdk.gen.d.ts +309 -15
  42. package/dist/generated/storage/types.gen.d.ts +12437 -8899
  43. package/dist/src/entities/agent-sessions/activity.d.ts +3 -2
  44. package/dist/src/entities/agent-sessions/agent-session.d.ts +17 -5
  45. package/dist/src/entities/agent-sessions/namespace.d.ts +5 -4
  46. package/dist/src/entities/agent-sessions/review.d.ts +1 -1
  47. package/dist/src/entities/ai/namespace.d.ts +2 -2
  48. package/dist/src/entities/api-keys/namespace.d.ts +5 -2
  49. package/dist/src/entities/bots/bot.d.ts +6 -3
  50. package/dist/src/entities/calendar/booking-namespace.d.ts +1 -1
  51. package/dist/src/entities/calendar/calendar.d.ts +3 -2
  52. package/dist/src/entities/calendar/event.d.ts +9 -0
  53. package/dist/src/entities/calendar/namespace.d.ts +3 -2
  54. package/dist/src/entities/calls/call-record.d.ts +19 -5
  55. package/dist/src/entities/canvases/canvas.d.ts +5 -0
  56. package/dist/src/entities/channels/channel.d.ts +27 -7
  57. package/dist/src/entities/channels/message.d.ts +65 -2
  58. package/dist/src/entities/channels/message.test.d.ts +1 -0
  59. package/dist/src/entities/channels/namespace.d.ts +9 -4
  60. package/dist/src/entities/channels/post.d.ts +13 -7
  61. package/dist/src/entities/channels/share.d.ts +9 -0
  62. package/dist/src/entities/channels/share.test.d.ts +1 -0
  63. package/dist/src/entities/channels/thread.d.ts +5 -1
  64. package/dist/src/entities/chats/chat.d.ts +1 -1
  65. package/dist/src/entities/chats/namespace.d.ts +1 -1
  66. package/dist/src/entities/connected-apps/connected-app.d.ts +2 -1
  67. package/dist/src/entities/connected-apps/namespace.d.ts +2 -0
  68. package/dist/src/entities/crm/company.d.ts +1 -1
  69. package/dist/src/entities/crm/contact.d.ts +44 -3
  70. package/dist/src/entities/crm/namespace.d.ts +30 -13
  71. package/dist/src/entities/crm/pipeline-entry.d.ts +10 -3
  72. package/dist/src/entities/crm/pipeline.d.ts +39 -20
  73. package/dist/src/entities/crm/pipelines.d.ts +33 -5
  74. package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
  75. package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
  76. package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
  77. package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
  78. package/dist/src/entities/databases/database.d.ts +34 -6
  79. package/dist/src/entities/databases/namespace.d.ts +26 -6
  80. package/dist/src/entities/databases/saved-query.d.ts +7 -1
  81. package/dist/src/entities/databases/table.d.ts +9 -0
  82. package/dist/src/entities/databases/view.d.ts +10 -0
  83. package/dist/src/entities/documents/create.test.d.ts +1 -0
  84. package/dist/src/entities/documents/document.d.ts +41 -6
  85. package/dist/src/entities/documents/namespace.d.ts +17 -3
  86. package/dist/src/entities/email/draft.d.ts +2 -2
  87. package/dist/src/entities/email/message.d.ts +18 -7
  88. package/dist/src/entities/email/namespace.d.ts +11 -7
  89. package/dist/src/entities/email/thread.d.ts +26 -3
  90. package/dist/src/entities/entity.d.ts +10 -1
  91. package/dist/src/entities/external-chat/chat.d.ts +19 -2
  92. package/dist/src/entities/foreign/namespace.d.ts +1 -1
  93. package/dist/src/entities/forms/form.d.ts +20 -1
  94. package/dist/src/entities/harnesses/namespace.d.ts +1 -1
  95. package/dist/src/entities/harnesses/pairing.d.ts +2 -1
  96. package/dist/src/entities/imports/entry.d.ts +65 -0
  97. package/dist/src/entities/imports/namespace.d.ts +103 -0
  98. package/dist/src/entities/imports/namespace.test.d.ts +1 -0
  99. package/dist/src/entities/initiatives/initiative.d.ts +14 -4
  100. package/dist/src/entities/initiatives/namespace.d.ts +4 -2
  101. package/dist/src/entities/me/namespace.d.ts +1 -1
  102. package/dist/src/entities/meetings/meeting.d.ts +2 -1
  103. package/dist/src/entities/notifications/namespace.d.ts +2 -1
  104. package/dist/src/entities/notifications/notification.d.ts +2 -1
  105. package/dist/src/entities/passwords/item.d.ts +118 -0
  106. package/dist/src/entities/passwords/namespace.d.ts +45 -0
  107. package/dist/src/entities/projects/namespace.d.ts +1 -1
  108. package/dist/src/entities/projects/project.d.ts +11 -1
  109. package/dist/src/entities/referrals/namespace.d.ts +1 -1
  110. package/dist/src/entities/routines/namespace.d.ts +81 -18
  111. package/dist/src/entities/routines/routine.d.ts +65 -4
  112. package/dist/src/entities/routines/suggestion.d.ts +38 -0
  113. package/dist/src/entities/saved-views/namespace.d.ts +2 -1
  114. package/dist/src/entities/search/exclusions.d.ts +6 -0
  115. package/dist/src/entities/search/namespace.d.ts +4 -2
  116. package/dist/src/entities/search/options.d.ts +3 -2
  117. package/dist/src/entities/suggestions/namespace.d.ts +118 -0
  118. package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
  119. package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
  120. package/dist/src/entities/tasks/namespace.d.ts +6 -5
  121. package/dist/src/entities/tasks/task.d.ts +14 -2
  122. package/dist/src/entities/teams/team.d.ts +16 -3
  123. package/dist/src/entities/ui/app-link.d.ts +24 -0
  124. package/dist/src/entities/ui/namespace.d.ts +75 -0
  125. package/dist/src/entities/users/namespace.d.ts +7 -3
  126. package/dist/src/entities/web/namespace.d.ts +2 -2
  127. package/dist/src/entities/workspace/namespace.d.ts +5 -3
  128. package/dist/src/entities/workspace/query.test.d.ts +1 -0
  129. package/dist/src/events/hydrate/document.d.ts +5 -0
  130. package/dist/src/macro.d.ts +26 -1
  131. package/dist/src/macro.js +4086 -1234
  132. package/dist/src/utils/activity.d.ts +2 -0
  133. package/dist/src/utils/index.d.ts +1 -1
  134. package/dist/src/utils/lazy.d.ts +13 -0
  135. package/dist/src/utils/options.d.ts +7 -0
  136. package/dist/src/utils/pagination.d.ts +16 -0
  137. package/dist/src/utils/verbs.d.ts +3 -0
  138. package/package.json +1 -1
@@ -1,6 +1,17 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: `${string}://${string}` | (string & {});
3
3
  };
4
+ /**
5
+ * Acting on a suggestion, as the caller's copy of it shows it.
6
+ */
7
+ export type AcceptSuggestionRequest = {
8
+ /**
9
+ * The suggestion's `updatedAt` as the caller read it. A background suggestion runs
10
+ * only if it is unchanged since and no run of it is still settling;
11
+ * otherwise the answer is 409.
12
+ */
13
+ updatedAt: string;
14
+ };
4
15
  /**
5
16
  * Client configuration, the create body. Ownership and execution state are
6
17
  * server-owned.
@@ -151,6 +162,42 @@ export type AiAdmissionErrorBody = {
151
162
  */
152
163
  error: string;
153
164
  };
165
+ /**
166
+ * Named tint keys from the shared tag color palette.
167
+ */
168
+ export type AppearanceColor = 'gray' | 'red' | 'tomato' | 'orange' | 'amber' | 'yellow' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'pink';
169
+ /**
170
+ * The source of an entity's custom icon.
171
+ */
172
+ export type AppearanceIcon = {
173
+ kind: 'macro';
174
+ /**
175
+ * Catalog name without the SVG extension.
176
+ */
177
+ name: string;
178
+ } | {
179
+ kind: 'emoji';
180
+ /**
181
+ * Unicode emoji text, not markup or a URL.
182
+ */
183
+ value: string;
184
+ };
185
+ /**
186
+ * A reply draft a session wrote for an open reply suggestion, as the user,
187
+ * through `macro.email.createDraft`. It replaces the suggestion's draft, if any;
188
+ * nothing is ever sent.
189
+ */
190
+ export type AttachDraft = {
191
+ /**
192
+ * The email draft: an unsent draft in one of the user's own inboxes, in
193
+ * the thread the suggestion is about.
194
+ */
195
+ emailDraftId: string;
196
+ /**
197
+ * Why, for the change log.
198
+ */
199
+ reason: string;
200
+ };
154
201
  /**
155
202
  * One of Macro's routines, ready to start a new routine from.
156
203
  */
@@ -213,6 +260,10 @@ export type CatalogEntry = {
213
260
  */
214
261
  trigger: ActionTrigger;
215
262
  };
263
+ /**
264
+ * A filter on the feed. Not kinds: a suggestion may have several.
265
+ */
266
+ export type Category = 'important' | 'revisit' | 'save_money' | 'make_money';
216
267
  /**
217
268
  * A routine to check, as the create body takes it.
218
269
  */
@@ -224,6 +275,33 @@ export type CheckRoutineRequest = {
224
275
  created?: Array<CreatedItem>;
225
276
  routine: ActionConfiguration;
226
277
  };
278
+ /**
279
+ * A routine the session handed back, as a person watching reads it: never
280
+ * its code.
281
+ */
282
+ export type CheckSummary = {
283
+ /**
284
+ * How many checks the session made so far, this one included.
285
+ */
286
+ checks: number;
287
+ name: string;
288
+ /**
289
+ * Whether it passed.
290
+ */
291
+ ok: boolean;
292
+ /**
293
+ * How many problems it has, its code's included.
294
+ */
295
+ problems: number;
296
+ /**
297
+ * Its steps, in order.
298
+ */
299
+ steps: Array<StepTitle>;
300
+ /**
301
+ * When it would run.
302
+ */
303
+ trigger: ActionTrigger;
304
+ };
227
305
  /**
228
306
  * A code step that doesn't type-check.
229
307
  */
@@ -334,6 +412,13 @@ export type CreatedItem = {
334
412
  */
335
413
  entityType: 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'harness' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
336
414
  };
415
+ /**
416
+ * A routine a run created, as that run's history names it.
417
+ */
418
+ export type CreatedRoutine = {
419
+ id: string;
420
+ name: string;
421
+ };
337
422
  /**
338
423
  * What AI drafted, or why it couldn't.
339
424
  */
@@ -346,6 +431,17 @@ export type Draft = (DraftedRoutine & {
346
431
  message: string;
347
432
  outcome: 'failed';
348
433
  };
434
+ /**
435
+ * What a job was asked to draft, as its owner reads it back: the kind of
436
+ * request and the words they typed, nothing it was sent with them.
437
+ */
438
+ export type DraftAsked = {
439
+ /**
440
+ * The words they typed: the description, or the change asked for.
441
+ */
442
+ description: string;
443
+ kind: DraftKind;
444
+ };
349
445
  /**
350
446
  * What the drafter may write. It looks up the items the person's words
351
447
  * name itself, with their access.
@@ -389,6 +485,51 @@ export type DraftCreated = {
389
485
  */
390
486
  used: boolean;
391
487
  };
488
+ /**
489
+ * A background draft, as its owner reads it.
490
+ */
491
+ export type DraftJob = DraftJobState & {
492
+ createdAt: string;
493
+ /**
494
+ * Its id: its hidden session's.
495
+ */
496
+ id: string;
497
+ progress: DraftJobProgress;
498
+ request: DraftAsked;
499
+ };
500
+ /**
501
+ * How far a draft has got: its latest stage, and what it reported on the
502
+ * way.
503
+ */
504
+ export type DraftJobProgress = {
505
+ check?: null | CheckSummary;
506
+ /**
507
+ * How many items the words name were found; absent before they were
508
+ * looked up.
509
+ */
510
+ found?: number | null;
511
+ names?: null | FoundNames;
512
+ stage: DraftStage;
513
+ };
514
+ /**
515
+ * Where a background draft is.
516
+ */
517
+ export type DraftJobState = {
518
+ state: 'drafting';
519
+ } | {
520
+ draft: Draft;
521
+ finishedAt: string;
522
+ state: 'ready';
523
+ } | {
524
+ created: Array<DraftCreated>;
525
+ finishedAt: string;
526
+ message: string;
527
+ state: 'failed';
528
+ };
529
+ /**
530
+ * What kind of draft was asked for.
531
+ */
532
+ export type DraftKind = 'routine' | 'add_step' | 'change_step';
392
533
  /**
393
534
  * What to draft.
394
535
  */
@@ -413,6 +554,22 @@ export type DraftRoutineRequest = {
413
554
  context: DraftContext;
414
555
  draft: DraftRequest;
415
556
  };
557
+ /**
558
+ * The stage a draft is at.
559
+ */
560
+ export type DraftStage = 'started' | 'found' | 'writing' | 'checked' | 'fixing';
561
+ /**
562
+ * How a background draft is going, for its owner's open apps.
563
+ */
564
+ export type DraftUpdate = {
565
+ draftId: string;
566
+ progress: DraftJobProgress;
567
+ state: DraftUpdateState;
568
+ };
569
+ /**
570
+ * Where a background draft is now; `removed` once cancelled or discarded.
571
+ */
572
+ export type DraftUpdateState = 'drafting' | 'ready' | 'failed' | 'removed';
416
573
  /**
417
574
  * A drafted routine.
418
575
  */
@@ -463,6 +620,21 @@ export type DraftedStep = {
463
620
  export type EmptyResponse = {
464
621
  [key: string]: unknown;
465
622
  };
623
+ /**
624
+ * What an entity suggestion suggests doing about its items.
625
+ */
626
+ export type EntityAction = 'reply' | 'review' | 'follow_up';
627
+ /**
628
+ * An entity's optional icon and tint overrides; absent values retain type defaults.
629
+ */
630
+ export type EntityAppearance = {
631
+ color?: null | AppearanceColor;
632
+ icon?: null | AppearanceIcon;
633
+ };
634
+ /**
635
+ * The type of an entity in Macro
636
+ */
637
+ export type EntityType = 'user' | 'chat' | 'channel' | 'channel_message' | 'document' | 'project' | 'email_thread' | 'calendar_event' | 'team' | 'call' | 'foreign_entity' | 'static_file' | 'crm_company' | 'crm_contact' | 'crm_pipeline' | 'reminder' | 'harness' | 'skill' | 'agent_session' | 'scheduled_action' | 'initiative' | 'database' | 'database_row' | 'form' | 'external_chat';
466
638
  /**
467
639
  * An event name AND an entity ID must match within the same filter. A
468
640
  * condition further requires the event's content to answer it with yes.
@@ -496,6 +668,15 @@ export type EventFilters = Array<EventFilter>;
496
668
  * selectors. Adding a broker variant does not automatically enable routines.
497
669
  */
498
670
  export type EventName = 'document.created' | 'document.updated' | 'document.deleted' | 'task.created' | 'task.status_changed' | 'task.priority_changed' | 'task.property_changed' | 'email.message_received' | 'channel.created' | 'channel.message_posted' | 'channel.mentioned' | 'channel.message_patched' | 'channel.message_attachment_created' | 'call.started' | 'call.ended' | 'github';
671
+ /**
672
+ * A finished run, with the routines it created.
673
+ */
674
+ export type ExecutionRecordResponse = ActionExecutionRecord & {
675
+ /**
676
+ * The sub-routines this run created that still follow the routine.
677
+ */
678
+ created?: Array<CreatedRoutine>;
679
+ };
499
680
  /**
500
681
  * Transcript resource created by a run. Never infer this from current task configuration.
501
682
  */
@@ -529,10 +710,100 @@ export type ExecutionResult = {
529
710
  }>;
530
711
  version: number;
531
712
  };
713
+ /**
714
+ * How many of a person's shown suggestions have each status.
715
+ */
716
+ export type FeedCounts = {
717
+ /**
718
+ * Done in the last 24 hours.
719
+ */
720
+ done: number;
721
+ /**
722
+ * Their last run failed.
723
+ */
724
+ failed: number;
725
+ /**
726
+ * Open, nothing under way.
727
+ */
728
+ open: number;
729
+ /**
730
+ * Their run is under way.
731
+ */
732
+ running: number;
733
+ };
734
+ /**
735
+ * An item found by the name the words use.
736
+ */
737
+ export type FoundName = {
738
+ kind: ItemKind;
739
+ /**
740
+ * Its name as stored.
741
+ */
742
+ name: string;
743
+ };
744
+ /**
745
+ * The items a draft's words name, as the drafter looked them up by name.
746
+ * Names only, as the person wrote them or the items are called: never
747
+ * ids.
748
+ */
749
+ export type FoundNames = {
750
+ /**
751
+ * Each the only item of its kinds with the name the words use.
752
+ */
753
+ found: Array<FoundName>;
754
+ /**
755
+ * Names no item has, or several do: the draft leaves them out for the
756
+ * person to pick.
757
+ */
758
+ left: Array<LeftName>;
759
+ };
760
+ /**
761
+ * The person's generations now, for the web app to show and poll.
762
+ */
763
+ export type GenerationOverview = {
764
+ /**
765
+ * When the latest one that ended ended.
766
+ */
767
+ lastFinishedAt?: string | null;
768
+ lastOutcome?: null | SuggestionGenerationStatus;
769
+ /**
770
+ * When the person may next ask for fresh suggestions, while they may
771
+ * not; absent when they may (or must wait only for the running one).
772
+ */
773
+ regenerateAvailableAt?: string | null;
774
+ /**
775
+ * When the running one started.
776
+ */
777
+ startedAt?: string | null;
778
+ /**
779
+ * Whether one is running.
780
+ */
781
+ state: GenerationState;
782
+ trigger?: null | GenerationTrigger;
783
+ };
784
+ /**
785
+ * What starting a generation did.
786
+ */
787
+ export type GenerationStarted = {
788
+ /**
789
+ * Whether a run started; false when one ran before or is running.
790
+ */
791
+ started: boolean;
792
+ };
793
+ /**
794
+ * Whether one of the person's generations is running.
795
+ */
796
+ export type GenerationState = 'idle' | 'running';
532
797
  /**
533
798
  * Where a person's suggestions are in being generated.
534
799
  */
535
800
  export type GenerationStatus = 'none' | 'generating' | 'ready' | 'failed';
801
+ /**
802
+ * What starts a generation: a person finishing onboarding, their night, or
803
+ * the person asking for fresh suggestions. Shared by everything a
804
+ * generation's sessions write.
805
+ */
806
+ export type GenerationTrigger = 'onboarding' | 'nightly' | 'manual';
536
807
  /**
537
808
  * Which GitHub deliveries match.
538
809
  */
@@ -561,16 +832,87 @@ export type InProgressExecution = {
561
832
  chat_id?: string | null;
562
833
  resource?: null | ExecutionResource;
563
834
  };
835
+ /**
836
+ * A kind of item a request can name.
837
+ */
838
+ export type ItemKind = 'channel' | 'person' | 'project' | 'initiative' | 'document' | 'task' | 'database' | 'agent' | 'label' | 'tag' | 'channel_label';
839
+ /**
840
+ * A suggestion's kind, without its data.
841
+ */
842
+ export type KindName = 'prompt' | 'entity' | 'routine';
564
843
  /**
565
844
  * How code reads a knob: a lowercase letter, then up to 31 letters or
566
845
  * digits, e.g. `dueWithinDays`.
567
846
  */
568
847
  export type KnobName = string;
848
+ /**
849
+ * A name the words use that the drafter couldn't settle on one item for.
850
+ */
851
+ export type LeftName = {
852
+ kind?: null | ItemKind;
853
+ /**
854
+ * How many items have it: none, or several.
855
+ */
856
+ matches: number;
857
+ /**
858
+ * The name as the words use it.
859
+ */
860
+ name: string;
861
+ };
569
862
  /**
570
863
  * What a text knob's value names: one of its owner's items, which a client
571
864
  * matches by name or lets them pick.
572
865
  */
573
866
  export type NamedItemKind = 'tag' | 'channel' | 'label';
867
+ /**
868
+ * A new suggestion, or a new version of one with the same `dedupKey`, as a
869
+ * generation session hands it back through `macro.suggestions.suggest`.
870
+ */
871
+ export type NewSuggestion = {
872
+ /**
873
+ * The items it is about.
874
+ */
875
+ about?: Array<Target>;
876
+ action?: null | EntityAction;
877
+ /**
878
+ * The feed's filters it shows under.
879
+ */
880
+ categories?: Array<Category>;
881
+ /**
882
+ * Names the suggestion across nights; the same key updates the same suggestion.
883
+ */
884
+ dedupKey: string;
885
+ /**
886
+ * 0 to 100.
887
+ */
888
+ importance: number;
889
+ /**
890
+ * `prompt` or `entity`; routine suggestions come from `macro.routines.suggest`.
891
+ */
892
+ kind: KindName;
893
+ /**
894
+ * A prompt suggestion's prompt.
895
+ */
896
+ prompt?: string | null;
897
+ /**
898
+ * Why, for the change log; required to bring back a suggestion the person
899
+ * dismissed.
900
+ */
901
+ reason?: string | null;
902
+ runMode?: null | RunMode;
903
+ /**
904
+ * A background prompt suggestion that posts or sends: what, and where.
905
+ */
906
+ sends?: string | null;
907
+ /**
908
+ * Why, in a line or two.
909
+ */
910
+ summary: string;
911
+ /**
912
+ * What to do, in a few words.
913
+ */
914
+ title: string;
915
+ };
574
916
  /**
575
917
  * `path` walks objects by key; `*` steps into every element of an array and
576
918
  * a number into one. Give exactly one test. `notIn` also passes when the
@@ -618,6 +960,106 @@ export type PropertySelector = {
618
960
  */
619
961
  values?: Array<string>;
620
962
  };
963
+ /**
964
+ * Fresh suggestions weren't started: the person asked within the hour.
965
+ */
966
+ export type RegenerationCooldown = {
967
+ /**
968
+ * When they may ask again.
969
+ */
970
+ availableAt: string;
971
+ };
972
+ /**
973
+ * Why fresh suggestions weren't started.
974
+ */
975
+ export type RegenerationRefusal = 'running';
976
+ /**
977
+ * Fresh suggestions weren't started: a generation is running.
978
+ */
979
+ export type RegenerationRunning = {
980
+ /**
981
+ * Why.
982
+ */
983
+ reason: RegenerationRefusal;
984
+ };
985
+ /**
986
+ * Retiring an open suggestion that no longer fits.
987
+ */
988
+ export type RetireSuggestion = {
989
+ /**
990
+ * Why, for the change log.
991
+ */
992
+ reason: string;
993
+ };
994
+ /**
995
+ * Retiring an open suggestion that no longer matters.
996
+ */
997
+ export type RetireSuggestionRequest = {
998
+ /**
999
+ * Why, for the change log.
1000
+ */
1001
+ reason: string;
1002
+ };
1003
+ /**
1004
+ * Where one of the person's routine suggestions is.
1005
+ */
1006
+ export type ReviewedState = 'open' | 'dismissed' | 'retired' | 'saved';
1007
+ /**
1008
+ * One suggestion AI made for the person, as a routines session reviews it.
1009
+ */
1010
+ export type ReviewedSuggestion = SuggestedPick & {
1011
+ /**
1012
+ * When it was dismissed or retired.
1013
+ */
1014
+ closedAt?: string | null;
1015
+ /**
1016
+ * When it was suggested.
1017
+ */
1018
+ createdAt: string;
1019
+ id: string;
1020
+ keepProbability: number;
1021
+ reason: string;
1022
+ state: ReviewedState;
1023
+ surfaces: Array<Surface>;
1024
+ };
1025
+ /**
1026
+ * Changes to an open suggestion; fields left out stay.
1027
+ */
1028
+ export type RewriteSuggestion = {
1029
+ /**
1030
+ * New items it is about.
1031
+ */
1032
+ about?: Array<Target> | null;
1033
+ /**
1034
+ * New categories.
1035
+ */
1036
+ categories?: Array<Category> | null;
1037
+ /**
1038
+ * A new importance.
1039
+ */
1040
+ importance?: number | null;
1041
+ /**
1042
+ * Only on prompt suggestions.
1043
+ */
1044
+ prompt?: string | null;
1045
+ /**
1046
+ * Why, for the change log.
1047
+ */
1048
+ reason: string;
1049
+ /**
1050
+ * Only on background prompt suggestions: what the run posts or sends, and
1051
+ * where.
1052
+ */
1053
+ sends?: string | null;
1054
+ /**
1055
+ * A new summary.
1056
+ */
1057
+ summary?: string | null;
1058
+ /**
1059
+ * A new title.
1060
+ */
1061
+ title?: string | null;
1062
+ };
621
1063
  /**
622
1064
  * What saving a routine would find wrong, without saving it: the answer to
623
1065
  * `POST /scheduled-actions/check`.
@@ -762,6 +1204,19 @@ export type RoutineProgram = {
762
1204
  */
763
1205
  steps: Array<RoutineStep>;
764
1206
  };
1207
+ /**
1208
+ * A part of a routine's sentence.
1209
+ */
1210
+ export type RoutineSentencePart = {
1211
+ /**
1212
+ * It is a value AI picked, which the person can change.
1213
+ */
1214
+ picked: boolean;
1215
+ /**
1216
+ * What it says.
1217
+ */
1218
+ text: string;
1219
+ };
765
1220
  /**
766
1221
  * The routine a step is added to or changed in.
767
1222
  */
@@ -820,6 +1275,25 @@ export type RoutineSuggestion = SuggestedPick & {
820
1275
  */
821
1276
  surfaces: Array<Surface>;
822
1277
  };
1278
+ /**
1279
+ * How a drafted routine suggestion shows in the person's Suggestions feed:
1280
+ * every routine a session drafts is also one suggestion there, kept and
1281
+ * closed with it.
1282
+ */
1283
+ export type RoutineSuggestionCard = {
1284
+ /**
1285
+ * The feed's filters it shows under.
1286
+ */
1287
+ categories?: Array<Category>;
1288
+ /**
1289
+ * 0 to 100: how much the person would regret missing it this week.
1290
+ */
1291
+ importance: number;
1292
+ /**
1293
+ * What it does for the person, in a few words.
1294
+ */
1295
+ title: string;
1296
+ };
823
1297
  /**
824
1298
  * A person's suggestions, and whether more are on the way.
825
1299
  */
@@ -845,6 +1319,7 @@ export type RoutineTemplate = {
845
1319
  * Routines activated from this template, including stopped ones.
846
1320
  */
847
1321
  active_count: number;
1322
+ appearance: EntityAppearance;
848
1323
  /**
849
1324
  * Who shared it: the source routine's owner.
850
1325
  */
@@ -862,12 +1337,26 @@ export type RoutineTemplate = {
862
1337
  variables: Array<TemplateVariable>;
863
1338
  };
864
1339
  /**
865
- * An individual trigger in a routine's trigger list.
1340
+ * How a routine suggestion's drafted routine reads on its card.
866
1341
  */
867
- export type RoutineTrigger = {
868
- schedule: Schedule;
869
- timezone: string;
870
- type: 'cron';
1342
+ export type RoutineText = {
1343
+ /**
1344
+ * What it does: a step's sentence with the values AI picked marked, or
1345
+ * its description (else its name) as one unmarked part.
1346
+ */
1347
+ sentence: Array<RoutineSentencePart>;
1348
+ /**
1349
+ * When it runs, e.g. "Fridays at 9:00 AM" or "New email received".
1350
+ */
1351
+ when: string;
1352
+ };
1353
+ /**
1354
+ * An individual trigger in a routine's trigger list.
1355
+ */
1356
+ export type RoutineTrigger = {
1357
+ schedule: Schedule;
1358
+ timezone: string;
1359
+ type: 'cron';
871
1360
  } | {
872
1361
  filters: EventFilters;
873
1362
  type: 'events';
@@ -902,6 +1391,10 @@ export type RunInfo = {
902
1391
  */
903
1392
  timezone?: string | null;
904
1393
  };
1394
+ /**
1395
+ * How a prompt suggestion runs.
1396
+ */
1397
+ export type RunMode = 'composer' | 'background';
905
1398
  /**
906
1399
  * What started a run, for its page.
907
1400
  */
@@ -932,6 +1425,10 @@ export type RunStart = {
932
1425
  by: string;
933
1426
  kind: 'manual';
934
1427
  };
1428
+ /**
1429
+ * A run's state without its data: how it is stored and served.
1430
+ */
1431
+ export type RunStateName = 'starting' | 'running' | 'waiting' | 'stopping' | 'cancelling' | 'finished' | 'failed' | 'cancelled';
935
1432
  /**
936
1433
  * Whether a routine's runs are listed in Home and the Agents list. Routines
937
1434
  * that run often would bury the owner's own work, so runs start unlisted;
@@ -941,6 +1438,10 @@ export type RunStart = {
941
1438
  export type RunVisibility = 'listed' | 'unlisted';
942
1439
  export type Schedule = string;
943
1440
  export type ScheduledAction = {
1441
+ /**
1442
+ * Optional presentation overrides; absent values use routine defaults.
1443
+ */
1444
+ appearance?: EntityAppearance;
944
1445
  claimed?: string | null;
945
1446
  /**
946
1447
  * Independent of execution bookkeeping in `updated_at`.
@@ -978,6 +1479,7 @@ export type ScheduledAction = {
978
1479
  * Whether the action's runs are listed in Home and the Agents list.
979
1480
  */
980
1481
  run_visibility: RunVisibility;
1482
+ sub_routine?: null | SubRoutine;
981
1483
  /**
982
1484
  * The routine suggestion it was saved from, if any: a plain pointer
983
1485
  * that stays after the suggestion is replaced.
@@ -1048,6 +1550,20 @@ export type ShareRoutineTemplate = {
1048
1550
  description: string;
1049
1551
  variables: Array<TemplateVariable>;
1050
1552
  };
1553
+ /**
1554
+ * A background draft to start: what the blocking route takes, and the id
1555
+ * the client made for this start.
1556
+ */
1557
+ export type StartDraftJobRequest = {
1558
+ /**
1559
+ * Made by the client, once per start. Sent again with it (as when the
1560
+ * connection drops before the answer), the start answers with the job
1561
+ * it began, starting nothing, until that job is discarded.
1562
+ */
1563
+ clientId: string;
1564
+ context: DraftContext;
1565
+ draft: DraftRequest;
1566
+ };
1051
1567
  /**
1052
1568
  * Names a step's output: a lowercase letter, then up to 31 lowercase
1053
1569
  * letters, digits or underscores.
@@ -1067,6 +1583,40 @@ export type StepProblem = {
1067
1583
  index: number;
1068
1584
  problems: Array<string>;
1069
1585
  };
1586
+ /**
1587
+ * A step of a routine handed back.
1588
+ */
1589
+ export type StepTitle = {
1590
+ kind: StepKind;
1591
+ /**
1592
+ * Its title; empty when it has none.
1593
+ */
1594
+ title: string;
1595
+ };
1596
+ /**
1597
+ * How a routine created by a routine's run belongs to that routine.
1598
+ */
1599
+ export type SubRoutine = {
1600
+ /**
1601
+ * The run that created it: the id of that run's history record, which
1602
+ * exists once the run ends.
1603
+ */
1604
+ created_by_run_id: string;
1605
+ /**
1606
+ * The name its creating code gave it, when it gave one.
1607
+ */
1608
+ key?: string | null;
1609
+ /**
1610
+ * The top-level routine it follows: pausing that routine pauses it, and
1611
+ * deleting that routine deletes it. A routine a sub-routine's run
1612
+ * creates follows the same top-level routine.
1613
+ */
1614
+ parent_id: string;
1615
+ /**
1616
+ * It is off because its parent was switched off, and resumes with it.
1617
+ */
1618
+ paused_by_parent?: boolean;
1619
+ };
1070
1620
  /**
1071
1621
  * What became of a suggestion handed back.
1072
1622
  */
@@ -1089,6 +1639,7 @@ export type SuggestOutcome = {
1089
1639
  * What a suggestion session hands back through `macro.routines.suggest`.
1090
1640
  */
1091
1641
  export type SuggestRequest = {
1642
+ card?: null | RoutineSuggestionCard;
1092
1643
  keepProbability: number;
1093
1644
  key: string;
1094
1645
  kind: 'catalog';
@@ -1098,6 +1649,10 @@ export type SuggestRequest = {
1098
1649
  reason: string;
1099
1650
  surfaces: Array<Surface>;
1100
1651
  } | {
1652
+ /**
1653
+ * How it shows in the person's Suggestions feed.
1654
+ */
1655
+ card: RoutineSuggestionCard;
1101
1656
  /**
1102
1657
  * What the session created for it, as `macro.routines.check` takes.
1103
1658
  */
@@ -1128,14 +1683,269 @@ export type SuggestedPick = {
1128
1683
  kind: 'routine';
1129
1684
  routine: ActionConfiguration;
1130
1685
  };
1686
+ /**
1687
+ * One proactive suggestion for one person.
1688
+ */
1689
+ export type Suggestion = SuggestionKind & {
1690
+ /**
1691
+ * The items it is about.
1692
+ */
1693
+ about: Array<Target>;
1694
+ /**
1695
+ * The feed's filters it shows under.
1696
+ */
1697
+ categories: Array<Category>;
1698
+ /**
1699
+ * When it was first proposed.
1700
+ */
1701
+ createdAt: string;
1702
+ /**
1703
+ * Names the suggestion across nights: proposing the same key again changes
1704
+ * this suggestion instead of adding one.
1705
+ */
1706
+ dedupKey: string;
1707
+ /**
1708
+ * The suggestion's id.
1709
+ */
1710
+ id: string;
1711
+ /**
1712
+ * 0 to 100, for ordering.
1713
+ */
1714
+ importance: number;
1715
+ /**
1716
+ * Proposed since the person last opened their feed. Only the feed sets
1717
+ * it; false everywhere else.
1718
+ */
1719
+ isNew: boolean;
1720
+ /**
1721
+ * What acting on it produced.
1722
+ */
1723
+ produced: Array<Target>;
1724
+ result?: null | Target;
1725
+ run?: null | SuggestionRun;
1726
+ /**
1727
+ * Where it is for the person.
1728
+ */
1729
+ state: SuggestionState;
1730
+ /**
1731
+ * When its state last changed, such as when it was dismissed.
1732
+ */
1733
+ stateChangedAt: string;
1734
+ /**
1735
+ * Why it was resolved; only on resolved suggestions.
1736
+ */
1737
+ stateReason?: string | null;
1738
+ /**
1739
+ * What the card shows: whether it is open, being run, failed or done.
1740
+ */
1741
+ status: SuggestionStatus;
1742
+ /**
1743
+ * Why, in a line or two.
1744
+ */
1745
+ summary: string;
1746
+ /**
1747
+ * What to do, in a few words.
1748
+ */
1749
+ title: string;
1750
+ /**
1751
+ * When it last changed.
1752
+ */
1753
+ updatedAt: string;
1754
+ };
1755
+ /**
1756
+ * The suggestion changed since the caller read it, or can't run until its
1757
+ * last run settles.
1758
+ */
1759
+ export type SuggestionChanged = {
1760
+ /**
1761
+ * What happened.
1762
+ */
1763
+ message: string;
1764
+ /**
1765
+ * The suggestion as it is now, to show before acting on it again.
1766
+ */
1767
+ suggestion: Suggestion;
1768
+ };
1769
+ /**
1770
+ * A reply suggestion's draft.
1771
+ */
1772
+ export type SuggestionDraft = Target & {
1773
+ /**
1774
+ * The start of its plain text, as it was when attached.
1775
+ */
1776
+ preview?: string | null;
1777
+ };
1778
+ /**
1779
+ * A person's feed: their open suggestions, best first, and the ones they
1780
+ * finished in the last day, newest first. Both lists are in the order to
1781
+ * show them.
1782
+ */
1783
+ export type SuggestionFeed = {
1784
+ /**
1785
+ * How many suggestions the whole feed holds of each status, whatever the
1786
+ * `limit`.
1787
+ */
1788
+ counts: FeedCounts;
1789
+ /**
1790
+ * Suggestions done in the last 24 hours, with what they produced; left
1791
+ * out when the feed was read with a `limit`.
1792
+ */
1793
+ done?: Array<Suggestion> | null;
1794
+ /**
1795
+ * The open suggestions, at most `limit` of them.
1796
+ */
1797
+ suggestions: Array<Suggestion>;
1798
+ };
1131
1799
  /**
1132
1800
  * Who suggests a routine.
1133
1801
  */
1134
1802
  export type SuggestionFrom = 'for_you' | 'macro';
1803
+ /**
1804
+ * Where a generation is.
1805
+ */
1806
+ export type SuggestionGenerationStatus = 'generating' | 'ready' | 'partial' | 'failed' | 'cancelled' | 'interrupted';
1807
+ /**
1808
+ * What kind of suggestion it is, with that kind's data. A kind never changes.
1809
+ */
1810
+ export type SuggestionKind = {
1811
+ kind: 'prompt';
1812
+ /**
1813
+ * What the agent is asked to do.
1814
+ */
1815
+ prompt: string;
1816
+ /**
1817
+ * How it runs.
1818
+ */
1819
+ runMode: RunMode;
1820
+ /**
1821
+ * For a background run that posts or sends something: what, and
1822
+ * where, in plain words. The card shows it before Run, and running
1823
+ * it approves exactly that. None when the run posts and sends
1824
+ * nothing.
1825
+ */
1826
+ sends?: string | null;
1827
+ } | {
1828
+ /**
1829
+ * What to do about the items.
1830
+ */
1831
+ action: EntityAction;
1832
+ draft?: null | SuggestionDraft;
1833
+ /**
1834
+ * A reply suggestion's: that message's sender, by name.
1835
+ */
1836
+ from?: string | null;
1837
+ kind: 'entity';
1838
+ /**
1839
+ * A reply suggestion's: when the message the person hasn't answered
1840
+ * came, as read from its item when the suggestion was last written.
1841
+ */
1842
+ waitingSince?: string | null;
1843
+ } | {
1844
+ kind: 'routine';
1845
+ routine?: null | RoutineText;
1846
+ /**
1847
+ * The suggestion it shows.
1848
+ */
1849
+ routineSuggestionId: string;
1850
+ };
1851
+ /**
1852
+ * Every suggestion AI made for the person, for a routines session.
1853
+ */
1854
+ export type SuggestionReview = {
1855
+ /**
1856
+ * Suggestions this session may still hand back.
1857
+ */
1858
+ keptLeft: number;
1859
+ suggestions: Array<ReviewedSuggestion>;
1860
+ };
1861
+ /**
1862
+ * A run of a background prompt suggestion: a hidden agent session of the
1863
+ * person's, with the full toolset, that never stops to ask.
1864
+ */
1865
+ export type SuggestionRun = {
1866
+ /**
1867
+ * The agent session: open it to see the result.
1868
+ */
1869
+ sessionId: string;
1870
+ /**
1871
+ * When it started.
1872
+ */
1873
+ startedAt: string;
1874
+ /**
1875
+ * Where it is, as stored: reading it never asks the session.
1876
+ */
1877
+ state: RunStateName;
1878
+ /**
1879
+ * When it entered `state`.
1880
+ */
1881
+ stateChangedAt: string;
1882
+ };
1883
+ /**
1884
+ * Where a suggestion is for the person.
1885
+ */
1886
+ export type SuggestionState = 'proposed' | 'accepted' | 'done' | 'dismissed' | 'resolved' | 'retired';
1887
+ /**
1888
+ * What a suggestion's card shows, from its state and its latest run.
1889
+ */
1890
+ export type SuggestionStatus = 'open' | 'running' | 'failed' | 'done' | 'closed';
1891
+ /**
1892
+ * What became of a session's write.
1893
+ */
1894
+ export type SuggestionWriteOutcome = {
1895
+ /**
1896
+ * Whether it was applied.
1897
+ */
1898
+ ok: boolean;
1899
+ /**
1900
+ * Why it wasn't, to fix and try again.
1901
+ */
1902
+ problems: Array<string>;
1903
+ suggestion?: null | Suggestion;
1904
+ };
1905
+ /**
1906
+ * What a generation session reads before managing the person's suggestions:
1907
+ * every suggestion they have, open or not, and how many more it may add.
1908
+ */
1909
+ export type SuggestionsReview = {
1910
+ /**
1911
+ * Suggestions this generation may still add or bring back.
1912
+ */
1913
+ newLeft: number;
1914
+ /**
1915
+ * Open suggestions the person has, and the most they may have.
1916
+ */
1917
+ open: number;
1918
+ /**
1919
+ * The most open suggestions a person may have.
1920
+ */
1921
+ openLimit: number;
1922
+ /**
1923
+ * Open suggestions first, best first, then closed ones newest first. A
1924
+ * dismissed suggestion's `stateChangedAt` is when the person dismissed it.
1925
+ */
1926
+ suggestions: Array<Suggestion>;
1927
+ };
1135
1928
  /**
1136
1929
  * The part of the app a routine is about, where it is offered.
1137
1930
  */
1138
1931
  export type Surface = 'email' | 'calendar' | 'tasks' | 'files' | 'crm' | 'chat' | 'calls' | 'reviews' | 'agents';
1932
+ /**
1933
+ * An item, or a part of one such as a message in a thread.
1934
+ */
1935
+ export type Target = {
1936
+ /**
1937
+ * The item's id.
1938
+ */
1939
+ entityId: string;
1940
+ /**
1941
+ * The item's type.
1942
+ */
1943
+ entityType: EntityType;
1944
+ /**
1945
+ * A part of it, such as one message in a channel.
1946
+ */
1947
+ partId?: string | null;
1948
+ };
1139
1949
  /**
1140
1950
  * A user-specific part of a shared routine.
1141
1951
  */
@@ -1187,6 +1997,17 @@ export type ListScheduledActionsData = {
1187
1997
  * Backend clients must opt in to event actions; defaults to false (cron-only).
1188
1998
  */
1189
1999
  include_events?: boolean | null;
2000
+ /**
2001
+ * Also list active sub-routines, the routines other routines' runs
2002
+ * created, without finished one-time ones; defaults to false (top-level
2003
+ * routines only).
2004
+ */
2005
+ include_children?: boolean | null;
2006
+ /**
2007
+ * List only this routine's sub-routines: the active ones and its newest
2008
+ * 200 finished one-time ones.
2009
+ */
2010
+ parent?: string | null;
1190
2011
  };
1191
2012
  url: '/scheduled-actions';
1192
2013
  };
@@ -1208,6 +2029,12 @@ export type CreateScheduledActionData = {
1208
2029
  * The routine suggestion it is saved from, recorded on the routine.
1209
2030
  */
1210
2031
  suggestion_id?: string;
2032
+ /**
2033
+ * A name for a routine a routine's run creates: the same key under the
2034
+ * same parent updates that sub-routine instead of adding another.
2035
+ * Rejected outside a routine's run.
2036
+ */
2037
+ key?: string;
1211
2038
  };
1212
2039
  url: '/scheduled-actions';
1213
2040
  };
@@ -1215,10 +2042,18 @@ export type CreateScheduledActionErrors = {
1215
2042
  400: string;
1216
2043
  401: string;
1217
2044
  403: string;
2045
+ /**
2046
+ * The routine already has the most active sub-routines it can
2047
+ */
2048
+ 409: string;
1218
2049
  500: string;
1219
2050
  };
1220
2051
  export type CreateScheduledActionError = CreateScheduledActionErrors[keyof CreateScheduledActionErrors];
1221
2052
  export type CreateScheduledActionResponses = {
2053
+ /**
2054
+ * The sub-routine its key already named, updated
2055
+ */
2056
+ 200: ScheduledActionResponse;
1222
2057
  201: ScheduledActionResponse;
1223
2058
  };
1224
2059
  export type CreateScheduledActionResponse = CreateScheduledActionResponses[keyof CreateScheduledActionResponses];
@@ -1266,6 +2101,109 @@ export type CheckScheduledActionResponses = {
1266
2101
  200: RoutineCheck;
1267
2102
  };
1268
2103
  export type CheckScheduledActionResponse = CheckScheduledActionResponses[keyof CheckScheduledActionResponses];
2104
+ export type ListRoutineDraftJobsData = {
2105
+ body?: never;
2106
+ path?: never;
2107
+ query?: never;
2108
+ url: '/scheduled-actions/draft-jobs';
2109
+ };
2110
+ export type ListRoutineDraftJobsErrors = {
2111
+ 401: string;
2112
+ 500: string;
2113
+ };
2114
+ export type ListRoutineDraftJobsError = ListRoutineDraftJobsErrors[keyof ListRoutineDraftJobsErrors];
2115
+ export type ListRoutineDraftJobsResponses = {
2116
+ /**
2117
+ * The caller's drafts that are drafting, or finished and not yet discarded, newest first
2118
+ */
2119
+ 200: Array<DraftJob>;
2120
+ };
2121
+ export type ListRoutineDraftJobsResponse = ListRoutineDraftJobsResponses[keyof ListRoutineDraftJobsResponses];
2122
+ export type StartRoutineDraftJobData = {
2123
+ body: StartDraftJobRequest;
2124
+ path?: never;
2125
+ query?: never;
2126
+ url: '/scheduled-actions/draft-jobs';
2127
+ };
2128
+ export type StartRoutineDraftJobErrors = {
2129
+ 400: string;
2130
+ 401: string;
2131
+ /**
2132
+ * AI usage limit reached
2133
+ */
2134
+ 402: AiAdmissionErrorBody;
2135
+ /**
2136
+ * Too many drafts are drafting already
2137
+ */
2138
+ 409: string;
2139
+ 500: string;
2140
+ /**
2141
+ * AI usage validation unavailable
2142
+ */
2143
+ 503: AiAdmissionErrorBody;
2144
+ };
2145
+ export type StartRoutineDraftJobError = StartRoutineDraftJobErrors[keyof StartRoutineDraftJobErrors];
2146
+ export type StartRoutineDraftJobResponses = {
2147
+ /**
2148
+ * Drafting in the background; read it, or follow `routine_draft_update` messages, until it is ready or failed. A request that can't be drafted at all comes back failed. Sent again with the same `clientId`, the job that start began, as it is now
2149
+ */
2150
+ 202: DraftJob;
2151
+ };
2152
+ export type StartRoutineDraftJobResponse = StartRoutineDraftJobResponses[keyof StartRoutineDraftJobResponses];
2153
+ export type DiscardRoutineDraftJobData = {
2154
+ body?: never;
2155
+ path: {
2156
+ /**
2157
+ * ID of the draft
2158
+ */
2159
+ id: string;
2160
+ };
2161
+ query?: never;
2162
+ url: '/scheduled-actions/draft-jobs/{id}';
2163
+ };
2164
+ export type DiscardRoutineDraftJobErrors = {
2165
+ 401: string;
2166
+ /**
2167
+ * No such draft of the caller's
2168
+ */
2169
+ 404: string;
2170
+ 500: string;
2171
+ };
2172
+ export type DiscardRoutineDraftJobError = DiscardRoutineDraftJobErrors[keyof DiscardRoutineDraftJobErrors];
2173
+ export type DiscardRoutineDraftJobResponses = {
2174
+ /**
2175
+ * Cancelled while drafting, or discarded once finished
2176
+ */
2177
+ 204: void;
2178
+ };
2179
+ export type DiscardRoutineDraftJobResponse = DiscardRoutineDraftJobResponses[keyof DiscardRoutineDraftJobResponses];
2180
+ export type GetRoutineDraftJobData = {
2181
+ body?: never;
2182
+ path: {
2183
+ /**
2184
+ * ID of the draft
2185
+ */
2186
+ id: string;
2187
+ };
2188
+ query?: never;
2189
+ url: '/scheduled-actions/draft-jobs/{id}';
2190
+ };
2191
+ export type GetRoutineDraftJobErrors = {
2192
+ 401: string;
2193
+ /**
2194
+ * No such draft of the caller's
2195
+ */
2196
+ 404: string;
2197
+ 500: string;
2198
+ };
2199
+ export type GetRoutineDraftJobError = GetRoutineDraftJobErrors[keyof GetRoutineDraftJobErrors];
2200
+ export type GetRoutineDraftJobResponses = {
2201
+ /**
2202
+ * The draft, with its routine or step when ready, or why it failed
2203
+ */
2204
+ 200: DraftJob;
2205
+ };
2206
+ export type GetRoutineDraftJobResponse = GetRoutineDraftJobResponses[keyof GetRoutineDraftJobResponses];
1269
2207
  export type DraftRoutineData = {
1270
2208
  body: DraftRoutineRequest;
1271
2209
  path?: never;
@@ -1343,33 +2281,32 @@ export type SuggestRoutineResponses = {
1343
2281
  200: SuggestOutcome;
1344
2282
  };
1345
2283
  export type SuggestRoutineResponse = SuggestRoutineResponses[keyof SuggestRoutineResponses];
1346
- export type GenerateRoutineSuggestionsData = {
2284
+ export type ReviewRoutineSuggestionsData = {
1347
2285
  body?: never;
1348
2286
  path?: never;
1349
- query: {
1350
- /**
1351
- * IANA time zone, e.g. `America/New_York`.
1352
- */
1353
- timezone: string;
1354
- };
1355
- url: '/scheduled-actions/suggestions/generate';
2287
+ query?: never;
2288
+ url: '/scheduled-actions/suggestions/review';
1356
2289
  };
1357
- export type GenerateRoutineSuggestionsErrors = {
2290
+ export type ReviewRoutineSuggestionsErrors = {
1358
2291
  401: string;
1359
2292
  /**
1360
- * Routine suggestions are off for the caller
2293
+ * Only a routines generation session may review
2294
+ */
2295
+ 403: string;
2296
+ /**
2297
+ * Routine suggestions are off for the user
1361
2298
  */
1362
2299
  404: string;
1363
2300
  500: string;
1364
2301
  };
1365
- export type GenerateRoutineSuggestionsError = GenerateRoutineSuggestionsErrors[keyof GenerateRoutineSuggestionsErrors];
1366
- export type GenerateRoutineSuggestionsResponses = {
2302
+ export type ReviewRoutineSuggestionsError = ReviewRoutineSuggestionsErrors[keyof ReviewRoutineSuggestionsErrors];
2303
+ export type ReviewRoutineSuggestionsResponses = {
1367
2304
  /**
1368
- * The caller's suggestions; the first call, once their inbox is connected, starts AI suggesting in the background, and later calls change nothing
2305
+ * Every suggestion AI made for the user, open or not
1369
2306
  */
1370
- 200: RoutineSuggestions;
2307
+ 200: SuggestionReview;
1371
2308
  };
1372
- export type GenerateRoutineSuggestionsResponse = GenerateRoutineSuggestionsResponses[keyof GenerateRoutineSuggestionsResponses];
2309
+ export type ReviewRoutineSuggestionsResponse = ReviewRoutineSuggestionsResponses[keyof ReviewRoutineSuggestionsResponses];
1373
2310
  export type DismissRoutineSuggestionData = {
1374
2311
  body?: never;
1375
2312
  path: {
@@ -1397,6 +2334,34 @@ export type DismissRoutineSuggestionResponses = {
1397
2334
  204: void;
1398
2335
  };
1399
2336
  export type DismissRoutineSuggestionResponse = DismissRoutineSuggestionResponses[keyof DismissRoutineSuggestionResponses];
2337
+ export type RetireRoutineSuggestionData = {
2338
+ body: RetireSuggestion;
2339
+ path: {
2340
+ /**
2341
+ * ID of the suggestion
2342
+ */
2343
+ id: string;
2344
+ };
2345
+ query?: never;
2346
+ url: '/scheduled-actions/suggestions/{id}/retire';
2347
+ };
2348
+ export type RetireRoutineSuggestionErrors = {
2349
+ 400: string;
2350
+ 401: string;
2351
+ /**
2352
+ * Only a routines generation session may retire
2353
+ */
2354
+ 403: string;
2355
+ 500: string;
2356
+ };
2357
+ export type RetireRoutineSuggestionError = RetireRoutineSuggestionErrors[keyof RetireRoutineSuggestionErrors];
2358
+ export type RetireRoutineSuggestionResponses = {
2359
+ /**
2360
+ * Whether the suggestion was retired, and why not when it wasn't
2361
+ */
2362
+ 200: SuggestOutcome;
2363
+ };
2364
+ export type RetireRoutineSuggestionResponse = RetireRoutineSuggestionResponses[keyof RetireRoutineSuggestionResponses];
1400
2365
  export type DeleteScheduledActionData = {
1401
2366
  body?: never;
1402
2367
  path: {
@@ -1465,6 +2430,26 @@ export type UpdateScheduledActionResponses = {
1465
2430
  200: ScheduledActionResponse;
1466
2431
  };
1467
2432
  export type UpdateScheduledActionResponse = UpdateScheduledActionResponses[keyof UpdateScheduledActionResponses];
2433
+ export type SetScheduledActionAppearanceData = {
2434
+ body: EntityAppearance;
2435
+ path: {
2436
+ /**
2437
+ * ID of the scheduled action
2438
+ */
2439
+ id: string;
2440
+ };
2441
+ query?: never;
2442
+ url: '/scheduled-actions/{id}/appearance';
2443
+ };
2444
+ export type SetScheduledActionAppearanceErrors = {
2445
+ 400: unknown;
2446
+ 401: unknown;
2447
+ 404: unknown;
2448
+ };
2449
+ export type SetScheduledActionAppearanceResponses = {
2450
+ 200: EntityAppearance;
2451
+ };
2452
+ export type SetScheduledActionAppearanceResponse = SetScheduledActionAppearanceResponses[keyof SetScheduledActionAppearanceResponses];
1468
2453
  export type ListScheduledActionCodeUpgradesData = {
1469
2454
  body?: never;
1470
2455
  path: {
@@ -1489,6 +2474,31 @@ export type ListScheduledActionCodeUpgradesResponses = {
1489
2474
  200: Array<CodeUpgrade>;
1490
2475
  };
1491
2476
  export type ListScheduledActionCodeUpgradesResponse = ListScheduledActionCodeUpgradesResponses[keyof ListScheduledActionCodeUpgradesResponses];
2477
+ export type DetachScheduledActionData = {
2478
+ body?: never;
2479
+ path: {
2480
+ /**
2481
+ * ID of the sub-routine
2482
+ */
2483
+ id: string;
2484
+ };
2485
+ query?: never;
2486
+ url: '/scheduled-actions/{id}/detach';
2487
+ };
2488
+ export type DetachScheduledActionErrors = {
2489
+ /**
2490
+ * Not a sub-routine
2491
+ */
2492
+ 400: string;
2493
+ 401: string;
2494
+ 404: string;
2495
+ 500: string;
2496
+ };
2497
+ export type DetachScheduledActionError = DetachScheduledActionErrors[keyof DetachScheduledActionErrors];
2498
+ export type DetachScheduledActionResponses = {
2499
+ 200: ScheduledActionResponse;
2500
+ };
2501
+ export type DetachScheduledActionResponse = DetachScheduledActionResponses[keyof DetachScheduledActionResponses];
1492
2502
  export type SetScheduledActionEnabledData = {
1493
2503
  body: SetScheduledActionEnabled;
1494
2504
  path: {
@@ -1567,7 +2577,7 @@ export type ListScheduledActionHistoryErrors = {
1567
2577
  };
1568
2578
  export type ListScheduledActionHistoryError = ListScheduledActionHistoryErrors[keyof ListScheduledActionHistoryErrors];
1569
2579
  export type ListScheduledActionHistoryResponses = {
1570
- 200: Array<ActionExecutionRecord>;
2580
+ 200: Array<ExecutionRecordResponse>;
1571
2581
  };
1572
2582
  export type ListScheduledActionHistoryResponse = ListScheduledActionHistoryResponses[keyof ListScheduledActionHistoryResponses];
1573
2583
  export type UnshareScheduledActionTemplateData = {
@@ -1663,3 +2673,427 @@ export type ActivateScheduledActionTemplateResponses = {
1663
2673
  201: ScheduledActionResponse;
1664
2674
  };
1665
2675
  export type ActivateScheduledActionTemplateResponse = ActivateScheduledActionTemplateResponses[keyof ActivateScheduledActionTemplateResponses];
2676
+ export type ListSuggestionsData = {
2677
+ body?: never;
2678
+ path?: never;
2679
+ query?: {
2680
+ /**
2681
+ * IANA time zone, e.g. `America/New_York`: nightly generations run in
2682
+ * the reader's night.
2683
+ */
2684
+ timezone?: string;
2685
+ /**
2686
+ * Most open suggestions to return, best first; all when unset. With a
2687
+ * limit the feed leaves out `done`; `counts` always counts every one.
2688
+ */
2689
+ limit?: number;
2690
+ };
2691
+ url: '/suggestions';
2692
+ };
2693
+ export type ListSuggestionsErrors = {
2694
+ 401: string;
2695
+ /**
2696
+ * A generation session may not read the feed
2697
+ */
2698
+ 403: string;
2699
+ /**
2700
+ * Suggestions are off for the caller
2701
+ */
2702
+ 404: string;
2703
+ 500: string;
2704
+ };
2705
+ export type ListSuggestionsError = ListSuggestionsErrors[keyof ListSuggestionsErrors];
2706
+ export type ListSuggestionsResponses = {
2707
+ /**
2708
+ * The caller's open suggestions, best first, and their done ones, latest first: only those they can open every item of
2709
+ */
2710
+ 200: SuggestionFeed;
2711
+ };
2712
+ export type ListSuggestionsResponse = ListSuggestionsResponses[keyof ListSuggestionsResponses];
2713
+ export type AddSuggestionData = {
2714
+ body: NewSuggestion;
2715
+ path?: never;
2716
+ query?: never;
2717
+ url: '/suggestions';
2718
+ };
2719
+ export type AddSuggestionErrors = {
2720
+ 400: string;
2721
+ 401: string;
2722
+ /**
2723
+ * Only a suggestions generation session may suggest
2724
+ */
2725
+ 403: string;
2726
+ /**
2727
+ * Suggestions are off for the user
2728
+ */
2729
+ 404: string;
2730
+ 500: string;
2731
+ };
2732
+ export type AddSuggestionError = AddSuggestionErrors[keyof AddSuggestionErrors];
2733
+ export type AddSuggestionResponses = {
2734
+ /**
2735
+ * Whether the suggestion was added or updated, and what to fix when it wasn't
2736
+ */
2737
+ 200: SuggestionWriteOutcome;
2738
+ };
2739
+ export type AddSuggestionResponse = AddSuggestionResponses[keyof AddSuggestionResponses];
2740
+ export type StartSuggestionGenerationData = {
2741
+ body?: never;
2742
+ path?: never;
2743
+ query: {
2744
+ /**
2745
+ * IANA time zone, e.g. `America/New_York`.
2746
+ */
2747
+ timezone: string;
2748
+ };
2749
+ url: '/suggestions/generate';
2750
+ };
2751
+ export type StartSuggestionGenerationErrors = {
2752
+ 401: string;
2753
+ /**
2754
+ * Neither suggestions nor routine suggestions are on for the caller
2755
+ */
2756
+ 404: string;
2757
+ 500: string;
2758
+ };
2759
+ export type StartSuggestionGenerationError = StartSuggestionGenerationErrors[keyof StartSuggestionGenerationErrors];
2760
+ export type StartSuggestionGenerationResponses = {
2761
+ /**
2762
+ * The caller's onboarding generation started in the background: their suggestions and routine suggestions, as each is on for them. Later calls start nothing
2763
+ */
2764
+ 200: GenerationStarted;
2765
+ };
2766
+ export type StartSuggestionGenerationResponse = StartSuggestionGenerationResponses[keyof StartSuggestionGenerationResponses];
2767
+ export type GetSuggestionGenerationData = {
2768
+ body?: never;
2769
+ path?: never;
2770
+ query?: never;
2771
+ url: '/suggestions/generation';
2772
+ };
2773
+ export type GetSuggestionGenerationErrors = {
2774
+ 401: string;
2775
+ /**
2776
+ * Suggestions are off for the caller
2777
+ */
2778
+ 404: string;
2779
+ 500: string;
2780
+ };
2781
+ export type GetSuggestionGenerationError = GetSuggestionGenerationErrors[keyof GetSuggestionGenerationErrors];
2782
+ export type GetSuggestionGenerationResponses = {
2783
+ /**
2784
+ * The caller's generations now: whether one is running (poll while it is), how the last one ended, and when they may next ask for fresh suggestions
2785
+ */
2786
+ 200: GenerationOverview;
2787
+ };
2788
+ export type GetSuggestionGenerationResponse = GetSuggestionGenerationResponses[keyof GetSuggestionGenerationResponses];
2789
+ export type RegenerateSuggestionsData = {
2790
+ body?: never;
2791
+ path?: never;
2792
+ query: {
2793
+ /**
2794
+ * IANA time zone, e.g. `America/New_York`.
2795
+ */
2796
+ timezone: string;
2797
+ };
2798
+ url: '/suggestions/regenerate';
2799
+ };
2800
+ export type RegenerateSuggestionsErrors = {
2801
+ 401: string;
2802
+ /**
2803
+ * Suggestions are off for the caller
2804
+ */
2805
+ 404: string;
2806
+ /**
2807
+ * One of the caller's generations is running
2808
+ */
2809
+ 409: RegenerationRunning;
2810
+ /**
2811
+ * The caller asked within the hour; `Retry-After` says in how many seconds they may ask again
2812
+ */
2813
+ 429: RegenerationCooldown;
2814
+ 500: string;
2815
+ };
2816
+ export type RegenerateSuggestionsError = RegenerateSuggestionsErrors[keyof RegenerateSuggestionsErrors];
2817
+ export type RegenerateSuggestionsResponses = {
2818
+ /**
2819
+ * Fresh suggestions started in the background: the caller's whole workspace researched again and their feed brought up to date, with routine suggestions when the week's are due. Poll `GET /suggestions/generation` until it is idle
2820
+ */
2821
+ 202: GenerationStarted;
2822
+ };
2823
+ export type RegenerateSuggestionsResponse = RegenerateSuggestionsResponses[keyof RegenerateSuggestionsResponses];
2824
+ export type ReviewSuggestionsData = {
2825
+ body?: never;
2826
+ path?: never;
2827
+ query?: never;
2828
+ url: '/suggestions/review';
2829
+ };
2830
+ export type ReviewSuggestionsErrors = {
2831
+ 401: string;
2832
+ /**
2833
+ * Only a suggestions generation session may review
2834
+ */
2835
+ 403: string;
2836
+ /**
2837
+ * Suggestions are off for the user
2838
+ */
2839
+ 404: string;
2840
+ 500: string;
2841
+ };
2842
+ export type ReviewSuggestionsError = ReviewSuggestionsErrors[keyof ReviewSuggestionsErrors];
2843
+ export type ReviewSuggestionsResponses = {
2844
+ /**
2845
+ * Every suggestion of the user's, open first, and how many more this generation may add
2846
+ */
2847
+ 200: SuggestionsReview;
2848
+ };
2849
+ export type ReviewSuggestionsResponse = ReviewSuggestionsResponses[keyof ReviewSuggestionsResponses];
2850
+ export type RecordSuggestionsSeenData = {
2851
+ body?: never;
2852
+ path?: never;
2853
+ query: {
2854
+ /**
2855
+ * IANA time zone, e.g. `America/New_York`.
2856
+ */
2857
+ timezone: string;
2858
+ };
2859
+ url: '/suggestions/seen';
2860
+ };
2861
+ export type RecordSuggestionsSeenErrors = {
2862
+ 401: string;
2863
+ 500: string;
2864
+ };
2865
+ export type RecordSuggestionsSeenError = RecordSuggestionsSeenErrors[keyof RecordSuggestionsSeenErrors];
2866
+ export type RecordSuggestionsSeenResponses = {
2867
+ /**
2868
+ * Recorded: with suggestions on and a paid plan, the caller counts as active for nightly generations in their time zone; otherwise nothing changes
2869
+ */
2870
+ 204: void;
2871
+ };
2872
+ export type RecordSuggestionsSeenResponse = RecordSuggestionsSeenResponses[keyof RecordSuggestionsSeenResponses];
2873
+ export type RecordSuggestionsViewedData = {
2874
+ body?: never;
2875
+ path?: never;
2876
+ query?: never;
2877
+ url: '/suggestions/viewed';
2878
+ };
2879
+ export type RecordSuggestionsViewedErrors = {
2880
+ 401: string;
2881
+ /**
2882
+ * A generation session may not record a visit
2883
+ */
2884
+ 403: string;
2885
+ /**
2886
+ * Suggestions are off for the caller
2887
+ */
2888
+ 404: string;
2889
+ 500: string;
2890
+ };
2891
+ export type RecordSuggestionsViewedError = RecordSuggestionsViewedErrors[keyof RecordSuggestionsViewedErrors];
2892
+ export type RecordSuggestionsViewedResponses = {
2893
+ /**
2894
+ * Recorded: suggestions proposed until now are no longer new in the feed
2895
+ */
2896
+ 204: void;
2897
+ };
2898
+ export type RecordSuggestionsViewedResponse = RecordSuggestionsViewedResponses[keyof RecordSuggestionsViewedResponses];
2899
+ export type RewriteSuggestionData = {
2900
+ body: RewriteSuggestion;
2901
+ path: {
2902
+ /**
2903
+ * ID of the suggestion
2904
+ */
2905
+ id: string;
2906
+ };
2907
+ query?: never;
2908
+ url: '/suggestions/{id}';
2909
+ };
2910
+ export type RewriteSuggestionErrors = {
2911
+ 400: string;
2912
+ 401: string;
2913
+ /**
2914
+ * Only a suggestions generation session may rewrite
2915
+ */
2916
+ 403: string;
2917
+ /**
2918
+ * No such suggestion for the user, or suggestions are off
2919
+ */
2920
+ 404: string;
2921
+ 500: string;
2922
+ };
2923
+ export type RewriteSuggestionError = RewriteSuggestionErrors[keyof RewriteSuggestionErrors];
2924
+ export type RewriteSuggestionResponses = {
2925
+ /**
2926
+ * Whether the suggestion was rewritten, and what to fix when it wasn't
2927
+ */
2928
+ 200: SuggestionWriteOutcome;
2929
+ };
2930
+ export type RewriteSuggestionResponse = RewriteSuggestionResponses[keyof RewriteSuggestionResponses];
2931
+ export type AcceptSuggestionData = {
2932
+ body: AcceptSuggestionRequest;
2933
+ path: {
2934
+ /**
2935
+ * ID of the suggestion
2936
+ */
2937
+ id: string;
2938
+ };
2939
+ query?: never;
2940
+ url: '/suggestions/{id}/accept';
2941
+ };
2942
+ export type AcceptSuggestionErrors = {
2943
+ /**
2944
+ * A routine suggestion: the person saves its routine in the app instead
2945
+ */
2946
+ 400: string;
2947
+ 401: string;
2948
+ /**
2949
+ * A generation session may not accept
2950
+ */
2951
+ 403: string;
2952
+ /**
2953
+ * No open or done suggestion with this id for the caller, or suggestions are off
2954
+ */
2955
+ 404: string;
2956
+ /**
2957
+ * The suggestion changed since the caller read it, or a run of it is still settling: the body has it as it is now
2958
+ */
2959
+ 409: SuggestionChanged;
2960
+ 500: string;
2961
+ };
2962
+ export type AcceptSuggestionError = AcceptSuggestionErrors[keyof AcceptSuggestionErrors];
2963
+ export type AcceptSuggestionResponses = {
2964
+ /**
2965
+ * Accepted: a background prompt suggestion starts its run when the person accepts it in the app (anyone acting for them only takes it on), a reply suggestion is taken on and stays open until the person replies on its item, any other suggestion is done; accepting a done suggestion again changes nothing
2966
+ */
2967
+ 204: void;
2968
+ };
2969
+ export type AcceptSuggestionResponse = AcceptSuggestionResponses[keyof AcceptSuggestionResponses];
2970
+ export type DismissSuggestionData = {
2971
+ body?: never;
2972
+ path: {
2973
+ /**
2974
+ * ID of the suggestion
2975
+ */
2976
+ id: string;
2977
+ };
2978
+ query?: never;
2979
+ url: '/suggestions/{id}/dismiss';
2980
+ };
2981
+ export type DismissSuggestionErrors = {
2982
+ 401: string;
2983
+ /**
2984
+ * A generation session may not dismiss
2985
+ */
2986
+ 403: string;
2987
+ /**
2988
+ * No open suggestion with this id for the caller, or suggestions are off
2989
+ */
2990
+ 404: string;
2991
+ 500: string;
2992
+ };
2993
+ export type DismissSuggestionError = DismissSuggestionErrors[keyof DismissSuggestionErrors];
2994
+ export type DismissSuggestionResponses = {
2995
+ /**
2996
+ * Dismissed; generation sessions see when
2997
+ */
2998
+ 204: void;
2999
+ };
3000
+ export type DismissSuggestionResponse = DismissSuggestionResponses[keyof DismissSuggestionResponses];
3001
+ export type AttachSuggestionDraftData = {
3002
+ body: AttachDraft;
3003
+ path: {
3004
+ /**
3005
+ * ID of the suggestion
3006
+ */
3007
+ id: string;
3008
+ };
3009
+ query?: never;
3010
+ url: '/suggestions/{id}/draft';
3011
+ };
3012
+ export type AttachSuggestionDraftErrors = {
3013
+ 400: string;
3014
+ 401: string;
3015
+ /**
3016
+ * Only a suggestions generation session may attach a draft
3017
+ */
3018
+ 403: string;
3019
+ /**
3020
+ * No such suggestion for the user, or suggestions are off
3021
+ */
3022
+ 404: string;
3023
+ 500: string;
3024
+ };
3025
+ export type AttachSuggestionDraftError = AttachSuggestionDraftErrors[keyof AttachSuggestionDraftErrors];
3026
+ export type AttachSuggestionDraftResponses = {
3027
+ /**
3028
+ * Whether the draft is now the suggestion's, replacing its old one, and what to fix when it isn't
3029
+ */
3030
+ 200: SuggestionWriteOutcome;
3031
+ };
3032
+ export type AttachSuggestionDraftResponse = AttachSuggestionDraftResponses[keyof AttachSuggestionDraftResponses];
3033
+ export type RestoreSuggestionData = {
3034
+ body?: never;
3035
+ path: {
3036
+ /**
3037
+ * ID of the suggestion
3038
+ */
3039
+ id: string;
3040
+ };
3041
+ query?: never;
3042
+ url: '/suggestions/{id}/restore';
3043
+ };
3044
+ export type RestoreSuggestionErrors = {
3045
+ 401: string;
3046
+ /**
3047
+ * A generation session may not restore
3048
+ */
3049
+ 403: string;
3050
+ /**
3051
+ * No suggestion with this id for the caller, or suggestions are off
3052
+ */
3053
+ 404: string;
3054
+ /**
3055
+ * Not dismissed in the last five minutes, or a routine suggestion
3056
+ */
3057
+ 409: string;
3058
+ 500: string;
3059
+ };
3060
+ export type RestoreSuggestionError = RestoreSuggestionErrors[keyof RestoreSuggestionErrors];
3061
+ export type RestoreSuggestionResponses = {
3062
+ /**
3063
+ * Open again, as proposed; a run the dismissal stopped stays stopped
3064
+ */
3065
+ 204: void;
3066
+ };
3067
+ export type RestoreSuggestionResponse = RestoreSuggestionResponses[keyof RestoreSuggestionResponses];
3068
+ export type RetireSuggestionData = {
3069
+ body: RetireSuggestionRequest;
3070
+ path: {
3071
+ /**
3072
+ * ID of the suggestion
3073
+ */
3074
+ id: string;
3075
+ };
3076
+ query?: never;
3077
+ url: '/suggestions/{id}/retire';
3078
+ };
3079
+ export type RetireSuggestionErrors = {
3080
+ 400: string;
3081
+ 401: string;
3082
+ /**
3083
+ * Only a suggestions generation session may retire
3084
+ */
3085
+ 403: string;
3086
+ /**
3087
+ * No such suggestion for the user, or suggestions are off
3088
+ */
3089
+ 404: string;
3090
+ 500: string;
3091
+ };
3092
+ export type RetireSuggestionError = RetireSuggestionErrors[keyof RetireSuggestionErrors];
3093
+ export type RetireSuggestionResponses = {
3094
+ /**
3095
+ * Whether the suggestion was retired, and why not when it wasn't
3096
+ */
3097
+ 200: SuggestionWriteOutcome;
3098
+ };
3099
+ export type RetireSuggestionResponse = RetireSuggestionResponses[keyof RetireSuggestionResponses];