@macro-inc/sdk 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +177 -3
  2. package/dist/{chunk-OGE7WXJE.js → chunk-AZJUIUIV.js} +177 -23
  3. package/dist/{chunk-PRUFPW3B.js → chunk-G43PLP2U.js} +144 -0
  4. package/dist/{chunk-7LVVPVNT.js → chunk-K4G5VO4P.js} +76 -1
  5. package/dist/{chunk-PAAFJYGO.js → chunk-PPR7IWZ7.js} +77 -51
  6. package/dist/{chunk-QVBNNMQS.js → chunk-PTX2RV2N.js} +169 -20
  7. package/dist/{chunk-SUINKDXF.js → chunk-PZPTJI6F.js} +42 -0
  8. package/dist/{chunk-7YJ6Y7HJ.js → chunk-XFA7NCJ5.js} +207 -0
  9. package/dist/{chunk-ZQXOHNDB.js → chunk-ZLBDES7U.js} +789 -12
  10. package/dist/generated/agent-fold/index.d.ts +4332 -0
  11. package/dist/generated/agent-fold/index.js +0 -0
  12. package/dist/generated/agent-harness/index.d.ts +1 -1
  13. package/dist/generated/agent-harness/index.js +1 -1
  14. package/dist/generated/agent-harness/sdk.gen.d.ts +83 -9
  15. package/dist/generated/agent-harness/types.gen.d.ts +1504 -160
  16. package/dist/generated/agent-reviews/index.d.ts +893 -0
  17. package/dist/generated/agent-reviews/index.js +0 -0
  18. package/dist/generated/auth/index.d.ts +1 -1
  19. package/dist/generated/auth/index.js +1 -1
  20. package/dist/generated/auth/sdk.gen.d.ts +108 -2
  21. package/dist/generated/auth/types.gen.d.ts +799 -6
  22. package/dist/generated/calendar/index.d.ts +1 -1
  23. package/dist/generated/calendar/index.js +1 -1
  24. package/dist/generated/calendar/sdk.gen.d.ts +63 -1
  25. package/dist/generated/calendar/types.gen.d.ts +1234 -5
  26. package/dist/generated/cognition/index.d.ts +1 -1
  27. package/dist/generated/cognition/index.js +1 -1
  28. package/dist/generated/cognition/sdk.gen.d.ts +85 -20
  29. package/dist/generated/cognition/types.gen.d.ts +1040 -121
  30. package/dist/generated/connection/index.d.ts +1 -1
  31. package/dist/generated/connection/index.js +15 -0
  32. package/dist/generated/connection/sdk.gen.d.ts +6 -1
  33. package/dist/generated/connection/types.gen.d.ts +18 -1
  34. package/dist/generated/email/index.d.ts +1 -1
  35. package/dist/generated/email/index.js +1 -1
  36. package/dist/generated/email/sdk.gen.d.ts +44 -2
  37. package/dist/generated/email/types.gen.d.ts +475 -10
  38. package/dist/generated/notification/index.d.ts +1 -1
  39. package/dist/generated/notification/index.js +1 -1
  40. package/dist/generated/notification/sdk.gen.d.ts +29 -21
  41. package/dist/generated/notification/types.gen.d.ts +267 -73
  42. package/dist/generated/properties/index.d.ts +1 -1
  43. package/dist/generated/properties/types.gen.d.ts +21 -1
  44. package/dist/generated/scheduled-action/index.d.ts +1 -1
  45. package/dist/generated/scheduled-action/index.js +1 -1
  46. package/dist/generated/scheduled-action/sdk.gen.d.ts +8 -1
  47. package/dist/generated/scheduled-action/types.gen.d.ts +669 -19
  48. package/dist/generated/search/index.d.ts +1 -1
  49. package/dist/generated/search/types.gen.d.ts +87 -7
  50. package/dist/generated/static-files/types.gen.d.ts +6 -0
  51. package/dist/generated/storage/index.d.ts +1 -1
  52. package/dist/generated/storage/index.js +1 -1
  53. package/dist/generated/storage/sdk.gen.d.ts +376 -13
  54. package/dist/generated/storage/types.gen.d.ts +12038 -5562
  55. package/dist/src/entities/account-managers/grant.d.ts +39 -0
  56. package/dist/src/entities/account-managers/namespace.d.ts +17 -0
  57. package/dist/src/entities/agent-sessions/activity.d.ts +39 -0
  58. package/dist/src/entities/agent-sessions/agent-session.d.ts +148 -6
  59. package/dist/src/entities/agent-sessions/code-execution.d.ts +5 -0
  60. package/dist/src/entities/agent-sessions/namespace.d.ts +54 -4
  61. package/dist/src/entities/agent-sessions/origin.d.ts +94 -0
  62. package/dist/src/entities/agent-sessions/review.d.ts +18 -62
  63. package/dist/src/entities/agent-sessions/view.d.ts +11 -0
  64. package/dist/src/entities/agents/namespace.d.ts +11 -2
  65. package/dist/src/entities/ai/namespace.d.ts +5 -1
  66. package/dist/src/entities/api-keys/namespace.d.ts +5 -1
  67. package/dist/src/entities/bots/bot.d.ts +108 -0
  68. package/dist/src/entities/bots/namespace.d.ts +17 -4
  69. package/dist/src/entities/bots/token.d.ts +34 -0
  70. package/dist/src/entities/calendar/booking-link.d.ts +49 -0
  71. package/dist/src/entities/calendar/booking-namespace.d.ts +130 -0
  72. package/dist/src/entities/calendar/booking-namespace.test.d.ts +1 -0
  73. package/dist/src/entities/calendar/booking.d.ts +77 -0
  74. package/dist/src/entities/calendar/calendar.d.ts +11 -4
  75. package/dist/src/entities/calendar/create-confirmed.test.d.ts +1 -0
  76. package/dist/src/entities/calendar/event.d.ts +104 -3
  77. package/dist/src/entities/calendar/namespace.d.ts +151 -7
  78. package/dist/src/entities/calendar/namespace.test.d.ts +1 -0
  79. package/dist/src/entities/calls/call-record.d.ts +34 -4
  80. package/dist/src/entities/calls/connection.d.ts +53 -0
  81. package/dist/src/entities/calls/errors.d.ts +15 -0
  82. package/dist/src/entities/calls/namespace.d.ts +21 -1
  83. package/dist/src/entities/calls/participant.d.ts +22 -0
  84. package/dist/src/entities/channels/access-request.d.ts +34 -0
  85. package/dist/src/entities/channels/channel.d.ts +47 -1
  86. package/dist/src/entities/channels/namespace.d.ts +21 -5
  87. package/dist/src/entities/channels/namespace.test.d.ts +1 -0
  88. package/dist/src/entities/channels/post.d.ts +14 -3
  89. package/dist/src/entities/channels/thread.d.ts +10 -1
  90. package/dist/src/entities/chats/chat.d.ts +7 -1
  91. package/dist/src/entities/chats/namespace.d.ts +14 -1
  92. package/dist/src/entities/connected-apps/connected-app.d.ts +107 -0
  93. package/dist/src/entities/connected-apps/connector.d.ts +56 -0
  94. package/dist/src/entities/connected-apps/namespace.d.ts +74 -0
  95. package/dist/src/entities/crm/company.d.ts +7 -3
  96. package/dist/src/entities/crm/contact.d.ts +4 -4
  97. package/dist/src/entities/crm/namespace.d.ts +34 -1
  98. package/dist/src/entities/crm/pipeline.d.ts +43 -2
  99. package/dist/src/entities/databases/database.d.ts +17 -0
  100. package/dist/src/entities/databases/namespace.d.ts +56 -0
  101. package/dist/src/entities/documents/ai-edit.d.ts +52 -0
  102. package/dist/src/entities/documents/document.d.ts +244 -5
  103. package/dist/src/entities/documents/namespace.d.ts +89 -4
  104. package/dist/src/entities/documents/office-files.d.ts +47 -0
  105. package/dist/src/entities/email/draft.d.ts +36 -7
  106. package/dist/src/entities/email/message.d.ts +99 -3
  107. package/dist/src/entities/email/namespace.d.ts +47 -4
  108. package/dist/src/entities/email/namespace.test.d.ts +1 -0
  109. package/dist/src/entities/email/thread.d.ts +55 -3
  110. package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
  111. package/dist/src/entities/external-chat/chat.d.ts +105 -0
  112. package/dist/src/entities/external-chat/message.d.ts +54 -0
  113. package/dist/src/entities/external-chat/namespace.d.ts +18 -0
  114. package/dist/src/entities/external-chat/participant.d.ts +28 -0
  115. package/dist/src/entities/external-chat/send.d.ts +32 -0
  116. package/dist/src/entities/external-chat/upload.d.ts +25 -0
  117. package/dist/src/entities/favorites/namespace.d.ts +5 -1
  118. package/dist/src/entities/foreign/namespace.d.ts +3 -0
  119. package/dist/src/entities/forms/form.d.ts +17 -2
  120. package/dist/src/entities/forms/namespace.d.ts +5 -1
  121. package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
  122. package/dist/src/entities/harnesses/harness.d.ts +9 -0
  123. package/dist/src/entities/harnesses/namespace.d.ts +5 -1
  124. package/dist/src/entities/images/image.d.ts +77 -0
  125. package/dist/src/entities/images/namespace.d.ts +48 -0
  126. package/dist/src/entities/images/namespace.test.d.ts +1 -0
  127. package/dist/src/entities/initiatives/initiative.d.ts +12 -1
  128. package/dist/src/entities/initiatives/namespace.d.ts +15 -2
  129. package/dist/src/entities/me/namespace.d.ts +43 -0
  130. package/dist/src/entities/meetings/meeting.d.ts +5 -0
  131. package/dist/src/entities/meetings/namespace.d.ts +5 -1
  132. package/dist/src/entities/messages/thread.d.ts +1 -1
  133. package/dist/src/entities/notifications/namespace.d.ts +3 -0
  134. package/dist/src/entities/pins/namespace.d.ts +5 -1
  135. package/dist/src/entities/projects/namespace.d.ts +4 -1
  136. package/dist/src/entities/projects/project.d.ts +9 -1
  137. package/dist/src/entities/properties/namespace.d.ts +2 -0
  138. package/dist/src/entities/referrals/namespace.d.ts +33 -0
  139. package/dist/src/entities/routines/namespace.d.ts +42 -2
  140. package/dist/src/entities/routines/routine.d.ts +84 -5
  141. package/dist/src/entities/search/namespace.d.ts +65 -0
  142. package/dist/src/entities/{search.d.ts → search/options.d.ts} +8 -2
  143. package/dist/src/entities/search/types.d.ts +90 -0
  144. package/dist/src/entities/sharing/access.d.ts +14 -0
  145. package/dist/src/entities/tasks/namespace.d.ts +42 -3
  146. package/dist/src/entities/tasks/task.d.ts +47 -6
  147. package/dist/src/entities/teams/invite.d.ts +30 -0
  148. package/dist/src/entities/teams/namespace.d.ts +3 -0
  149. package/dist/src/entities/teams/team.d.ts +37 -0
  150. package/dist/src/entities/unfurls/namespace.d.ts +5 -1
  151. package/dist/src/entities/users/namespace.d.ts +9 -0
  152. package/dist/src/entities/users/user.d.ts +8 -0
  153. package/dist/src/entities/web/namespace.d.ts +61 -0
  154. package/dist/src/entities/web/namespace.test.d.ts +1 -0
  155. package/dist/src/entities/webhooks/namespace.d.ts +2 -0
  156. package/dist/src/entities/whatsapp/account.d.ts +20 -0
  157. package/dist/src/entities/whatsapp/chat.d.ts +54 -0
  158. package/dist/src/entities/whatsapp/namespace.d.ts +23 -0
  159. package/dist/src/entities/workspace/items.d.ts +7 -0
  160. package/dist/src/entities/workspace/namespace.d.ts +14 -9
  161. package/dist/src/entities/workspace/query.d.ts +23 -0
  162. package/dist/src/entities/workspace/types.d.ts +6 -3
  163. package/dist/src/events/hydrate/agentSession.d.ts +1 -1
  164. package/dist/src/events/hydrate/call.d.ts +101 -0
  165. package/dist/src/events/hydrate/channel.d.ts +8 -1
  166. package/dist/src/events/hydrate/document.d.ts +1 -1
  167. package/dist/src/events/hydrate/message.d.ts +1 -1
  168. package/dist/src/events/types.d.ts +2 -1
  169. package/dist/src/macro.d.ts +73 -4
  170. package/dist/src/macro.js +8235 -3701
  171. package/dist/src/mentions.d.ts +6 -1
  172. package/dist/src/utils/activity.d.ts +23 -2
  173. package/dist/src/utils/index.d.ts +1 -1
  174. package/dist/src/utils/unwrap.d.ts +27 -2
  175. package/package.json +2 -2
package/README.md CHANGED
@@ -8,9 +8,8 @@ plain-English entity guide, and complete API reference, served by the SDK docs W
8
8
  - **`src/`**: a hand-written ergonomic SDK layer that provides an "orm"-y API.
9
9
 
10
10
  The [SDK reference build](../sdk-docs/README.md) uses TypeDoc to generate linked
11
- Markdown and HTML from these sources. The [generated Markdown](../sdk-docs/reference/README.md)
12
- is checked in alongside SDK changes; the HTML can be served with the included
13
- static docs Worker.
11
+ Markdown and HTML from these sources at build time; the HTML is served with the
12
+ included static docs Worker.
14
13
 
15
14
  ## Usage
16
15
 
@@ -61,6 +60,36 @@ const macro = new Macro({
61
60
 
62
61
  An API key always acts as the user who minted it. `requestedAs` is bot-only.
63
62
 
63
+ #### Agent accounts
64
+
65
+ An agent has its own account and seat. Invite one with
66
+ `(await macro.teams.current()).invite('agent@example.com', { agent: true })`, or sign
67
+ up at https://macro.com/app/signup/agent. After signing in, the agent sees its API key once in the
68
+ web app and uses it like any other key. It can set up its profile with
69
+ `macro.me.update({ name, profilePicture: await macro.me.uploadProfilePicture(bytes, options) })`
70
+ and mint more keys with `macro.apiKeys.create(name)`.
71
+
72
+ #### Account managers
73
+
74
+ An agent account can manage a person's account: either side asks in their DM, and
75
+ the other side approves. An agent account can't be managed.
76
+
77
+ ```ts
78
+ // As the agent, ask to manage a person's account:
79
+ const grant = await macro.accountManagers.askToManage(person);
80
+ // Once the person approves, the agent gets the token, once:
81
+ const token = await grant.claimToken();
82
+ ```
83
+
84
+ A person can ask instead, with `macro.accountManagers.askToBeManagedBy(agent)`. Only the
85
+ manager can claim, so the agent approves and claims with its own client, using the grant id
86
+ from the card in the DM: `macro.accountManagers.byId(id)`.
87
+
88
+ The token is an API key for the managed account, with full access except its
89
+ managers, API keys and other credentials, sign-in, and deleting the account. It
90
+ lasts until either side calls `grant.revoke()`, or the managed account revokes it
91
+ in Settings → Account Managers.
92
+
64
93
  #### Bot token
65
94
 
66
95
  ```ts
@@ -339,6 +368,28 @@ await channel.send(msg`Hey ${user}, take a look at ${doc}. cc ${here}`);
339
368
 
340
369
  These will render as @mentions in the Macro UI.
341
370
 
371
+ ### Generating images
372
+
373
+ `macro.images.generate()` makes an image with Google's Nano Banana model, charged
374
+ to the acting user's AI allowance, and stores it as a static file. Attach it to a
375
+ message with `images`; its width and height let the message reserve space before
376
+ the image loads. Pass up to three image documents or earlier images as
377
+ `referenceImages` to edit or combine them. `examples/generate-image.ts` runs this
378
+ end to end.
379
+
380
+ ```ts
381
+ const image = await macro.images.generate({
382
+ prompt: 'A watercolor lighthouse at dusk',
383
+ aspectRatio: 'widescreen',
384
+ });
385
+ await channel.send('Fresh off the press', { images: [image] });
386
+
387
+ const night = await macro.images.generate({
388
+ prompt: 'The lighthouse in image 1, at night under stars',
389
+ referenceImages: [image],
390
+ });
391
+ ```
392
+
342
393
  ### Posting to a channel webhook
343
394
 
344
395
  The web UI can hand you a webhook URL and token for a channel. That token is a
@@ -375,6 +426,37 @@ Event triggers use `{ type: 'events', filters: [{ events, entities, condition }]
375
426
  `entities` takes typed references such as `{ type: 'document', entity: doc }`.
376
427
  Use `{ type: 'multiple', triggers: [...] }` to combine schedules and events.
377
428
  `routine.update(options)` replaces task and trigger settings; `delete()` removes it.
429
+ Routines run as their owner, so share one as a template instead:
430
+ `routine.shareAsTemplate({ description, variables })` publishes a snapshot,
431
+ `routine.template()` reads it (undefined when not shared), and
432
+ `routine.activateTemplate(options)` creates the caller's own routine from it.
433
+ `routine.sourceTemplate()` returns the routine a template came from.
434
+ Publishing, reading, and activating templates require the caller's
435
+ `enable-routine-sharing` PostHog flag. Disabled or unavailable evaluations return
436
+ 404 (`template()` returns `undefined`). `stopSharingTemplate()` stays available
437
+ to owners, and previously activated routines continue working.
438
+
439
+ A GitHub trigger takes a filter of its own, with optional exact payload tests in
440
+ `match`. It needs the owner to have connected GitHub:
441
+
442
+ ```ts
443
+ await routine.update({
444
+ ...options,
445
+ trigger: {
446
+ type: 'events',
447
+ filters: [
448
+ {
449
+ events: ['github'],
450
+ github: { events: ['workflow_run'], actions: ['completed'], repositories: ['macro-inc/macro'] },
451
+ match: [
452
+ { path: ['workflow_run', 'name'], equals: 'CI' },
453
+ { path: ['workflow_run', 'conclusion'], in: ['failure', 'timed_out'] },
454
+ ],
455
+ },
456
+ ],
457
+ },
458
+ });
459
+ ```
378
460
 
379
461
  ### Agents, conversations and hosts
380
462
 
@@ -430,6 +512,9 @@ returns thread handles alongside reminder snapshots.
430
512
  permissions and trash operations live on the pipeline. `pipeline.table()` returns
431
513
  its table handle, with column and row handles. `rows()` and `queryRows({ rows, query })`
432
514
  fetch through the pipeline's authorization boundary and auto-paginate.
515
+ `(await pipeline.table()).views()` returns scoped `PipelineView` handles;
516
+ `view.detail()` reads its definition and `view.positions()` reads its saved board
517
+ order through pipeline permissions.
433
518
  `pipeline.applyOps(ops, { baseVersions: [{ table, version }] })` accepts the generated
434
519
  atomic database operation contract, including batch-local UUIDs, like
435
520
  `Database.applyOps`. Table and column reads share a schema cache invalidated by
@@ -471,12 +556,55 @@ when mutations invalidate metadata. `update`, `cancel`, `invite(email)`,
471
556
  `call.meeting()` creates or reads its shareable meeting; calls also expose
472
557
  `editTranscript(assignments)` and `toggleTeamShare()`.
473
558
 
559
+ ### Programmatic calls
560
+
561
+ Use `macro.calls.active()` to find joinable live calls and reconcile missed
562
+ `call.*` events. `macro.calls.summaries(calls)` previews live or archived call
563
+ handles in one request. `channel.activeCall()` checks without starting a call; use
564
+ `channel.startCall()` only when intending to ring channel members. A live
565
+ `call.join()` never creates a replacement call. `meeting.join()` enters with
566
+ an account and `meeting.joinAsGuest(name)` uses the invitation link.
567
+
568
+ Each entry returns a `CallConnection` with the LiveKit URL, token, identity,
569
+ room name, call handle, and `started` flag. Pass the token directly to a
570
+ LiveKit client; it is omitted from JSON and console inspection. Call
571
+ `connection.leave()` when finished. Joins default to `onOtherCall: 'fail'`;
572
+ pass `{ onOtherCall: 'switch' }` to move intentionally, or `{ replace: true }`
573
+ to take over an existing connection for the same identity. Branch on
574
+ `InOtherCallError`, `AlreadyConnectedError`, and `CallEndedError`.
575
+
576
+ `call.ringState()` reads this account's ring state, `call.participants()` reads
577
+ the live roster with user handles, `call.decline()` declines its ring,
578
+ `call.discussion()` returns the call chat or its channel thread, and
579
+ `call.recording.bytes()` downloads through the Macro host. Historical
580
+ participants remain available as `call.historicParticipants()`.
581
+
582
+
474
583
  `calendar.occurrences(viewport)` auto-paginates and seeds event handles.
475
584
  `calendar.teamPage(viewport)` includes the roster and an optional next cursor;
476
585
  `teamOutOfOffice(viewport)` reports `hasMore` when its bounded results are truncated.
477
586
  `availabilityCalendars`, `calendar.setContributesToAvailability`, `teamSharing` and
478
587
  `setTeamSharing` manage availability and sharing preferences.
479
588
 
589
+ ### Editing documents and tasks
590
+
591
+ `document.edit(instructions, options)` edits a markdown document or a task's body
592
+ by natural-language instructions. The AI editor merges its changes with anyone
593
+ editing at the same time. Say where (name the section or quote the text) and
594
+ describe the outcome:
595
+
596
+ ```ts
597
+ const { revision, webUrl } = await document.edit(
598
+ 'Rewrite the "Summary" section as three bullet points. Keep the heading.',
599
+ { fast: true },
600
+ );
601
+ ```
602
+
603
+ It returns the new revision, not a diff; read `content()` to see what changed.
604
+ `options.signal` cancels the edit, keeping what was applied before the abort. A
605
+ refused edit throws `DocumentEditRefusedError` with the editor's reason;
606
+ `EditOutcomeUnknownError` means read the document before retrying.
607
+
480
608
  ### Document lifecycle and other resources
481
609
 
482
610
  `documents.createUpload(options)` reserves a binary document and returns upload
@@ -782,3 +910,49 @@ handles with `edit(draft)`, `submit()`, and `dismiss()` methods. `submitAll()` a
782
910
  conflict, refresh and inspect the review; never automatically retry a send whose
783
911
  outcome is unknown. These SDK methods have the same user authorization as the
784
912
  ordinary API: review cards offer a user workflow, not a separate security grant.
913
+
914
+ ### External chats and WhatsApp
915
+
916
+ Pair your personal account in Macro's External view first. Your WhatsApp chat
917
+ list (`whatsapp.chats()`) holds groups and direct chats; adding one makes an
918
+ independent `ExternalChat` entity (a group or a direct chat, with `provider`
919
+ `whatsapp`) with its own history and ordinary sharing, and its earlier messages
920
+ are imported from your phone. `externalChats.list()` returns every added chat
921
+ you can view; shared viewers can read without WhatsApp. Sending and media
922
+ uploads require your own connected account in the chat, using your personal
923
+ session or own API credential; only the owner sends in a direct chat, and bots
924
+ never send. Adding and removing require a personal bearer session. Each user is
925
+ limited to one send request per second across all chats.
926
+
927
+ ```ts
928
+ const personal = new Macro({
929
+ auth: { type: 'user', token: () => session.accessToken() },
930
+ });
931
+ let chat;
932
+ for (const entry of await personal.whatsapp.chats()) {
933
+ if (await entry.canAdd()) {
934
+ chat = await entry.add();
935
+ break;
936
+ }
937
+ }
938
+ if (chat && (await chat.canSend())) {
939
+ const [someone] = await chat.participants();
940
+ const send = await chat.send(
941
+ {
942
+ type: 'text',
943
+ text: someone ? `Hello @${someone.mentionToken}` : 'Hello',
944
+ mentions: someone ? [someone] : [],
945
+ },
946
+ { idempotencyKey: crypto.randomUUID() },
947
+ );
948
+ await send.refresh();
949
+ console.log(await send.state());
950
+ }
951
+ for (const shared of await personal.externalChats.list()) {
952
+ for await (const message of shared.messages()) console.log(await message.body());
953
+ }
954
+ ```
955
+
956
+ Keep the same idempotency key when retrying the same request. A delivery state of
957
+ `unknown` must be reconciled; never automatically resend it. Uploads, quoted
958
+ messages, mentions, mutations, and delivery references must belong to the same chat.
@@ -847,6 +847,19 @@ var Sdk = class _Sdk extends HeyApiClient {
847
847
  getChatsForAttachmentHandler(options) {
848
848
  return (options.client ?? this.client).get({ url: "/attachments/{attachment_id}/chats", ...options });
849
849
  }
850
+ /**
851
+ * Create a calendar event the user approved in conversation, quoting their approval.
852
+ */
853
+ createConfirmedCalendarEvent(options) {
854
+ return (options.client ?? this.client).post({
855
+ url: "/calendar/events/create-confirmed",
856
+ ...options,
857
+ headers: {
858
+ "Content-Type": "application/json",
859
+ ...options.headers
860
+ }
861
+ });
862
+ }
850
863
  /**
851
864
  * Soft-delete a chat.
852
865
  */
@@ -983,6 +996,16 @@ var Sdk = class _Sdk extends HeyApiClient {
983
996
  getCitationHandler(options) {
984
997
  return (options.client ?? this.client).get({ url: "/citations/{id}", ...options });
985
998
  }
999
+ generateDatabaseQuery(options) {
1000
+ return (options.client ?? this.client).post({
1001
+ url: "/database-query",
1002
+ ...options,
1003
+ headers: {
1004
+ "Content-Type": "application/json",
1005
+ ...options.headers
1006
+ }
1007
+ });
1008
+ }
986
1009
  decisions(options) {
987
1010
  return (options.client ?? this.client).post({
988
1011
  url: "/decisions",
@@ -993,12 +1016,52 @@ var Sdk = class _Sdk extends HeyApiClient {
993
1016
  }
994
1017
  });
995
1018
  }
1019
+ /**
1020
+ * Send an email the user approved in conversation, quoting their approval.
1021
+ */
1022
+ sendConfirmedEmail(options) {
1023
+ return (options.client ?? this.client).post({
1024
+ url: "/email/send-confirmed",
1025
+ ...options,
1026
+ headers: {
1027
+ "Content-Type": "application/json",
1028
+ ...options.headers
1029
+ }
1030
+ });
1031
+ }
996
1032
  /**
997
1033
  * Health check
998
1034
  */
999
1035
  healthHandler(options) {
1000
1036
  return (options?.client ?? this.client).get({ url: "/health", ...options });
1001
1037
  }
1038
+ /**
1039
+ * Generate an image with Nano Banana and store it as a static file owned by
1040
+ * the caller. Charged to the acting user's AI allowance.
1041
+ */
1042
+ generateImage(options) {
1043
+ return (options.client ?? this.client).post({
1044
+ url: "/images/generate",
1045
+ ...options,
1046
+ headers: {
1047
+ "Content-Type": "application/json",
1048
+ ...options.headers
1049
+ }
1050
+ });
1051
+ }
1052
+ /**
1053
+ * Where the user's Notion workspace import stands.
1054
+ */
1055
+ notionReportHandler(options) {
1056
+ return (options?.client ?? this.client).get({ url: "/import/notion", ...options });
1057
+ }
1058
+ /**
1059
+ * Stop planning or writing the user's Notion import. Objects already
1060
+ * imported stay.
1061
+ */
1062
+ cancelNotionHandler(options) {
1063
+ return (options?.client ?? this.client).post({ url: "/import/notion/cancel", ...options });
1064
+ }
1002
1065
  /**
1003
1066
  * Accept staged imports (starts import jobs) and/or discard staged rows.
1004
1067
  */
@@ -1013,29 +1076,29 @@ var Sdk = class _Sdk extends HeyApiClient {
1013
1076
  });
1014
1077
  }
1015
1078
  /**
1016
- * Discover candidates for user selection without auto-importing them.
1079
+ * Discover candidates for user selection. Only Slack supports discovery.
1017
1080
  */
1018
1081
  discoverHandler(options) {
1019
1082
  return (options.client ?? this.client).post({ url: "/import/runs/{source}/discover", ...options });
1020
1083
  }
1021
1084
  /**
1022
- * Dismiss one source's import section.
1085
+ * Get the authenticated user's import state: discovery runs plus visible
1086
+ * ledger rows.
1023
1087
  */
1024
- dismissRunHandler(options) {
1025
- return (options.client ?? this.client).post({ url: "/import/runs/{source}/dismiss", ...options });
1088
+ getStateHandler(options) {
1089
+ return (options?.client ?? this.client).get({ url: "/import/state", ...options });
1026
1090
  }
1027
1091
  /**
1028
- * Restart a failed (or dismissed) gather run for one source.
1092
+ * Report progress for one reviewed workspace source.
1029
1093
  */
1030
- retryGatherHandler(options) {
1031
- return (options.client ?? this.client).post({ url: "/import/runs/{source}/retry", ...options });
1094
+ workspaceReportHandler(options) {
1095
+ return (options.client ?? this.client).get({ url: "/import/workspaces/{source}", ...options });
1032
1096
  }
1033
1097
  /**
1034
- * Get the authenticated user's import state: gather runs plus visible
1035
- * ledger rows.
1098
+ * Cancel this source's plan or write, keeping completed entities.
1036
1099
  */
1037
- getStateHandler(options) {
1038
- return (options?.client ?? this.client).get({ url: "/import/state", ...options });
1100
+ cancelWorkspaceHandler(options) {
1101
+ return (options.client ?? this.client).post({ url: "/import/workspaces/{source}/cancel", ...options });
1039
1102
  }
1040
1103
  /**
1041
1104
  * Delete an MCP server by URL.
@@ -1050,7 +1113,8 @@ var Sdk = class _Sdk extends HeyApiClient {
1050
1113
  return (options?.client ?? this.client).get({ url: "/mcp/servers", ...options });
1051
1114
  }
1052
1115
  /**
1053
- * Add a new MCP server for the authenticated user.
1116
+ * Add a new MCP server for the authenticated user. A URL the user already
1117
+ * has is returned as stored, keeping its credentials.
1054
1118
  */
1055
1119
  addMcpServer(options) {
1056
1120
  return (options.client ?? this.client).post({
@@ -1104,17 +1168,14 @@ var Sdk = class _Sdk extends HeyApiClient {
1104
1168
  /**
1105
1169
  * Get the authenticated user's latest memory.
1106
1170
  *
1107
- * Returns the current memory if one exists. If the memory is stale or missing,
1108
- * a background generation is triggered and the endpoint returns the stale
1109
- * memory (200) or 404 if none exists yet.
1171
+ * Compose stored private preferences, latest activity, and current team profiles.
1172
+ * Enrolls the caller for daily refresh; generation never runs on this request.
1110
1173
  */
1111
1174
  getMemoryHandler(options) {
1112
1175
  return (options?.client ?? this.client).get({ url: "/memory", ...options });
1113
1176
  }
1114
1177
  /**
1115
- * Get the authenticated user's onboarding state. While the flow is active
1116
- * this also starts any gather runs that are due, so polling this endpoint
1117
- * is what keeps onboarding moving.
1178
+ * Get the authenticated user's onboarding state.
1118
1179
  */
1119
1180
  getStateHandler2(options) {
1120
1181
  return (options?.client ?? this.client).get({ url: "/onboarding", ...options });
@@ -1133,6 +1194,19 @@ var Sdk = class _Sdk extends HeyApiClient {
1133
1194
  }
1134
1195
  });
1135
1196
  }
1197
+ /**
1198
+ * List the sidebar prompts the authenticated user dismissed on any device.
1199
+ */
1200
+ dismissedPromptsHandler(options) {
1201
+ return (options?.client ?? this.client).get({ url: "/onboarding/prompts", ...options });
1202
+ }
1203
+ /**
1204
+ * Dismiss one sidebar prompt for the authenticated user, on every device.
1205
+ * Idempotent.
1206
+ */
1207
+ dismissPromptHandler(options) {
1208
+ return (options.client ?? this.client).post({ url: "/onboarding/prompts/{prompt_id}/dismiss", ...options });
1209
+ }
1136
1210
  /**
1137
1211
  * Browse or search the catalog of connectable apps.
1138
1212
  *
@@ -1145,7 +1219,8 @@ var Sdk = class _Sdk extends HeyApiClient {
1145
1219
  * Register a connected account reported by the Pipedream Connect UI.
1146
1220
  *
1147
1221
  * Verifies with Pipedream that the account exists and was connected for
1148
- * the authenticated user before persisting anything.
1222
+ * the authenticated user before persisting anything. An overlaid app is
1223
+ * refused with 409: it connects through its own MCP server instead.
1149
1224
  */
1150
1225
  completePipedreamMcpConnection(options) {
1151
1226
  return (options.client ?? this.client).post({
@@ -1157,6 +1232,22 @@ var Sdk = class _Sdk extends HeyApiClient {
1157
1232
  }
1158
1233
  });
1159
1234
  }
1235
+ /**
1236
+ * Record an app the user connected through Macro Connect.
1237
+ *
1238
+ * Answers 404 until Connect lists an active connection for this user and
1239
+ * app, so the frontend can poll it while the consent window is open.
1240
+ */
1241
+ completePipedreamMcpConnect(options) {
1242
+ return (options.client ?? this.client).post({
1243
+ url: "/pipedream/mcp/connect/complete",
1244
+ ...options,
1245
+ headers: {
1246
+ "Content-Type": "application/json",
1247
+ ...options.headers
1248
+ }
1249
+ });
1250
+ }
1160
1251
  /**
1161
1252
  * Disconnect an app, revoking its Pipedream account.
1162
1253
  */
@@ -1183,13 +1274,50 @@ var Sdk = class _Sdk extends HeyApiClient {
1183
1274
  });
1184
1275
  }
1185
1276
  /**
1186
- * Create a short-lived Pipedream Connect token for the authenticated user.
1277
+ * List the catalog apps that connect through their own MCP server.
1187
1278
  *
1188
- * The frontend opens Pipedream's hosted Connect UI with this token; the
1189
- * user picks (or is deep-linked into) an app and authorizes it there.
1279
+ * Clients connect these with the native MCP OAuth flow against
1280
+ * `server_url`; Pipedream refuses to complete a connection for them.
1281
+ */
1282
+ listPipedreamMcpOverlays(options) {
1283
+ return (options?.client ?? this.client).get({ url: "/pipedream/mcp/overlays", ...options });
1284
+ }
1285
+ /**
1286
+ * Register an account a Connect flow created but the Connect UI never
1287
+ * reported.
1288
+ *
1289
+ * Called after the Connect UI closes without a success event. Answers 404
1290
+ * when Pipedream has no new account for this user and app.
1291
+ * An overlaid app is refused with 409, as in [`complete_connection`].
1292
+ */
1293
+ recoverPipedreamMcpConnection(options) {
1294
+ return (options.client ?? this.client).post({
1295
+ url: "/pipedream/mcp/recover",
1296
+ ...options,
1297
+ headers: {
1298
+ "Content-Type": "application/json",
1299
+ ...options.headers
1300
+ }
1301
+ });
1302
+ }
1303
+ /**
1304
+ * Start a connect flow for the authenticated user.
1305
+ *
1306
+ * By default, a short-lived Pipedream Connect token: the frontend opens
1307
+ * Pipedream's hosted Connect UI with it, and the user picks (or is
1308
+ * deep-linked into) an app and authorizes it there. When the body names an
1309
+ * app Macro Connect serves and the `macro-connect` rollout is on for the
1310
+ * user, a Connect URL instead.
1190
1311
  */
1191
1312
  createPipedreamMcpToken(options) {
1192
- return (options?.client ?? this.client).post({ url: "/pipedream/mcp/token", ...options });
1313
+ return (options?.client ?? this.client).post({
1314
+ url: "/pipedream/mcp/token",
1315
+ ...options,
1316
+ headers: {
1317
+ "Content-Type": "application/json",
1318
+ ...options?.headers
1319
+ }
1320
+ });
1193
1321
  }
1194
1322
  getBatchPreview(options) {
1195
1323
  return (options.client ?? this.client).post({
@@ -1244,6 +1372,32 @@ var Sdk = class _Sdk extends HeyApiClient {
1244
1372
  }
1245
1373
  });
1246
1374
  }
1375
+ /**
1376
+ * Read one public web page as Markdown. Charged to the acting user's AI allowance.
1377
+ */
1378
+ fetchWebPage(options) {
1379
+ return (options.client ?? this.client).post({
1380
+ url: "/web/fetch",
1381
+ ...options,
1382
+ headers: {
1383
+ "Content-Type": "application/json",
1384
+ ...options.headers
1385
+ }
1386
+ });
1387
+ }
1388
+ /**
1389
+ * Search the public web. Charged to the acting user's AI allowance.
1390
+ */
1391
+ searchWeb(options) {
1392
+ return (options.client ?? this.client).post({
1393
+ url: "/web/search",
1394
+ ...options,
1395
+ headers: {
1396
+ "Content-Type": "application/json",
1397
+ ...options.headers
1398
+ }
1399
+ });
1400
+ }
1247
1401
  };
1248
1402
 
1249
1403
  export {
@@ -861,6 +861,40 @@ var Sdk = class _Sdk extends HeyApiClient {
861
861
  }
862
862
  });
863
863
  }
864
+ /**
865
+ * Add a snapshot of an event shared with one of the requester's channels to
866
+ * one of their Google calendars and return the synced snapshot. The
867
+ * snapshot keeps the meeting's iCalendar UID and organizer, lists only the
868
+ * requester as a guest, and carries no join link; nobody is notified.
869
+ * While the requester's request to join the event is pending or accepted,
870
+ * the copy is refused with `join_request_open`: the meeting reaches their
871
+ * calendar as the invitation, which a copy would otherwise take in.
872
+ */
873
+ copyCalendarEvent(options) {
874
+ return (options.client ?? this.client).post({
875
+ url: "/events/{event_id}/copy",
876
+ ...options,
877
+ headers: {
878
+ "Content-Type": "application/json",
879
+ ...options.headers
880
+ }
881
+ });
882
+ }
883
+ /**
884
+ * Add guests to a calendar event without touching anyone already invited,
885
+ * and return its synced entity. The organizer, and guests the organizer lets
886
+ * invite others, may call it; Google emails the new guests.
887
+ */
888
+ inviteCalendarEventGuests(options) {
889
+ return (options.client ?? this.client).post({
890
+ url: "/events/{event_id}/guests",
891
+ ...options,
892
+ headers: {
893
+ "Content-Type": "application/json",
894
+ ...options.headers
895
+ }
896
+ });
897
+ }
864
898
  /**
865
899
  * Resolve an authorized event's provider link for Outlook-only actions.
866
900
  */
@@ -899,6 +933,21 @@ var Sdk = class _Sdk extends HeyApiClient {
899
933
  healthHandler(options) {
900
934
  return (options?.client ?? this.client).get({ url: "/health", ...options });
901
935
  }
936
+ /**
937
+ * Answer a request to join an event the requester can change and return
938
+ * where it now stands. Accepting adds the guest through the invite path; an
939
+ * already answered request is returned unchanged.
940
+ */
941
+ respondToJoinRequest(options) {
942
+ return (options.client ?? this.client).put({
943
+ url: "/join-requests/{request_id}",
944
+ ...options,
945
+ headers: {
946
+ "Content-Type": "application/json",
947
+ ...options.headers
948
+ }
949
+ });
950
+ }
902
951
  /**
903
952
  * Discard a preview only if no confirmation has been recorded.
904
953
  */
@@ -917,6 +966,101 @@ var Sdk = class _Sdk extends HeyApiClient {
917
966
  confirmCalendarReplacement(options) {
918
967
  return (options.client ?? this.client).post({ url: "/replacements/{operation_id}/confirm", ...options });
919
968
  }
969
+ /**
970
+ * List the profile's bookings, optionally those starting in a half-open range.
971
+ */
972
+ listBookings(options) {
973
+ return (options?.client ?? this.client).get({ url: "/scheduling/bookings", ...options });
974
+ }
975
+ /**
976
+ * Approve, cancel, record attendance for, or reschedule one booking.
977
+ */
978
+ changeBooking(options) {
979
+ return (options.client ?? this.client).post({
980
+ url: "/scheduling/bookings/{id}/change",
981
+ ...options,
982
+ headers: {
983
+ "Content-Type": "application/json",
984
+ ...options.headers
985
+ }
986
+ });
987
+ }
988
+ /**
989
+ * Read one booking as its personal owner, a host, or a team administrator.
990
+ */
991
+ getManagedBooking(options) {
992
+ return (options.client ?? this.client).get({ url: "/scheduling/bookings/{id}/manage", ...options });
993
+ }
994
+ /**
995
+ * Replacement start times for one booking on a schedule-local date.
996
+ */
997
+ listBookingRescheduleSlots(options) {
998
+ return (options.client ?? this.client).get({ url: "/scheduling/bookings/{id}/slots", ...options });
999
+ }
1000
+ /**
1001
+ * Booking statistics for a local date range and the equally long period before it.
1002
+ */
1003
+ getBookingInsights(options) {
1004
+ return (options.client ?? this.client).post({
1005
+ url: "/scheduling/insights",
1006
+ ...options,
1007
+ headers: {
1008
+ "Content-Type": "application/json",
1009
+ ...options.headers
1010
+ }
1011
+ });
1012
+ }
1013
+ /**
1014
+ * List and search booking links with their full drafts and reusable schedules.
1015
+ */
1016
+ listBookingLinks(options) {
1017
+ return (options?.client ?? this.client).get({ url: "/scheduling/links", ...options });
1018
+ }
1019
+ /**
1020
+ * Create a booking link; an identical replay at the same slug returns the saved link.
1021
+ */
1022
+ createBookingLink(options) {
1023
+ return (options.client ?? this.client).post({
1024
+ url: "/scheduling/links",
1025
+ ...options,
1026
+ headers: {
1027
+ "Content-Type": "application/json",
1028
+ ...options.headers
1029
+ }
1030
+ });
1031
+ }
1032
+ /**
1033
+ * Replace one booking link's configuration at the profile revision it was read with.
1034
+ */
1035
+ editBookingLink(options) {
1036
+ return (options.client ?? this.client).put({
1037
+ url: "/scheduling/links/{id}",
1038
+ ...options,
1039
+ headers: {
1040
+ "Content-Type": "application/json",
1041
+ ...options.headers
1042
+ }
1043
+ });
1044
+ }
1045
+ /**
1046
+ * Read personal or team booking settings without creating them.
1047
+ */
1048
+ getBookingSettings(options) {
1049
+ return (options?.client ?? this.client).get({ url: "/scheduling/settings", ...options });
1050
+ }
1051
+ /**
1052
+ * Save booking settings at the revision they were read with.
1053
+ */
1054
+ saveBookingSettings(options) {
1055
+ return (options.client ?? this.client).put({
1056
+ url: "/scheduling/settings",
1057
+ ...options,
1058
+ headers: {
1059
+ "Content-Type": "application/json",
1060
+ ...options.headers
1061
+ }
1062
+ });
1063
+ }
920
1064
  /**
921
1065
  * Read the authenticated user's sharing choice.
922
1066
  */