@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
@@ -804,6 +804,33 @@ var Sdk = class _Sdk extends HeyApiClient {
804
804
  super(args);
805
805
  _Sdk.__registry.set(this, args?.key);
806
806
  }
807
+ /**
808
+ * Forgets the agent's API key. Does not revoke it at the provider; succeeds
809
+ * when there was none.
810
+ */
811
+ deleteAgentApiKey(options) {
812
+ return (options.client ?? this.client).delete({ url: "/agents/{agent_id}/api-key", ...options });
813
+ }
814
+ /**
815
+ * The agent's API key, if it has one, and whether its plan allows one.
816
+ */
817
+ getAgentApiKey(options) {
818
+ return (options.client ?? this.client).get({ url: "/agents/{agent_id}/api-key", ...options });
819
+ }
820
+ /**
821
+ * Registers or replaces the agent's API key, for its model's provider.
822
+ * Only in-memory agents on an Anthropic or OpenAI model, on a paid plan.
823
+ */
824
+ putAgentApiKey(options) {
825
+ return (options.client ?? this.client).put({
826
+ url: "/agents/{agent_id}/api-key",
827
+ ...options,
828
+ headers: {
829
+ "Content-Type": "application/json",
830
+ ...options.headers
831
+ }
832
+ });
833
+ }
807
834
  /**
808
835
  * Turn automatic credit reloads on with the given
809
836
  * thresholds, or off. Payer only. Enabling settles right away, so a balance
@@ -832,6 +859,20 @@ var Sdk = class _Sdk extends HeyApiClient {
832
859
  }
833
860
  });
834
861
  }
862
+ /**
863
+ * Buy a credit pack now, charged to the payer's card on file. Any paid team
864
+ * member may buy, within the team's monthly credit limit.
865
+ */
866
+ purchaseAiCredits(options) {
867
+ return (options.client ?? this.client).post({
868
+ url: "/ai-billing/credits/purchase",
869
+ ...options,
870
+ headers: {
871
+ "Content-Type": "application/json",
872
+ ...options.headers
873
+ }
874
+ });
875
+ }
835
876
  /**
836
877
  * Retired direct-usage opt-in. Enabling is rejected; disabling remains supported.
837
878
  */
@@ -1055,6 +1096,20 @@ var Sdk = class _Sdk extends HeyApiClient {
1055
1096
  }
1056
1097
  });
1057
1098
  }
1099
+ /**
1100
+ * Closes a GitHub pull request, or reopens it, as the authenticated user
1101
+ * with their own GitHub grant.
1102
+ */
1103
+ setGithubPullRequestState(options) {
1104
+ return (options.client ?? this.client).post({
1105
+ url: "/github_pull_requests/state",
1106
+ ...options,
1107
+ headers: {
1108
+ "Content-Type": "application/json",
1109
+ ...options.headers
1110
+ }
1111
+ });
1112
+ }
1058
1113
  /**
1059
1114
  * Lists invite links, newest first. Macro staff only.
1060
1115
  */
@@ -1335,6 +1390,44 @@ var Sdk = class _Sdk extends HeyApiClient {
1335
1390
  sessionLogin(options) {
1336
1391
  return (options.client ?? this.client).get({ url: "/session/login/{session_code}", ...options });
1337
1392
  }
1393
+ /**
1394
+ * The status every user sees. Public: the banner shows wherever the app
1395
+ * runs, signed in or not.
1396
+ */
1397
+ getSystemStatus(options) {
1398
+ return (options?.client ?? this.client).get({ url: "/system-status", ...options });
1399
+ }
1400
+ /**
1401
+ * Sets the status every user sees and pushes it to every open app. Macro
1402
+ * staff only.
1403
+ *
1404
+ * Authenticate with a Macro session, or from a script with a personal API
1405
+ * key (Settings → API keys) in the `x-macro-user-api-key` header. The body
1406
+ * is the new status:
1407
+ *
1408
+ * - `{"status": "operational"}` clears the banner. It takes no message.
1409
+ * - `{"status": "degraded", "message": "Search is slow to update."}`
1410
+ * - `{"status": "major_outage", "message": "Macro is unavailable. We're on it."}`
1411
+ *
1412
+ * Messages are trimmed and must be 1–500 characters. Every call is kept in
1413
+ * the history, even when it repeats the current status.
1414
+ */
1415
+ setSystemStatus(options) {
1416
+ return (options.client ?? this.client).post({
1417
+ url: "/system-status",
1418
+ ...options,
1419
+ headers: {
1420
+ "Content-Type": "application/json",
1421
+ ...options.headers
1422
+ }
1423
+ });
1424
+ }
1425
+ /**
1426
+ * Recent status updates, newest first, with who set each. Macro staff only.
1427
+ */
1428
+ listSystemStatusHistory(options) {
1429
+ return (options?.client ?? this.client).get({ url: "/system-status/history", ...options });
1430
+ }
1338
1431
  /**
1339
1432
  * Deletes a team.
1340
1433
  * This will update all team members roles and cancel your subscription for the team.
@@ -1407,6 +1500,16 @@ var Sdk = class _Sdk extends HeyApiClient {
1407
1500
  }
1408
1501
  });
1409
1502
  }
1503
+ /**
1504
+ * Emails the caller's contacts on the team's auto-join domain that the team
1505
+ * exists, so they can sign up and join. Contacts already on Macro, on the
1506
+ * team, invited, or emailed before are skipped, and a team emails at most 25
1507
+ * people in total. Call it after sending the team's invites. Requires the
1508
+ * caller to be an Admin or Owner of the team.
1509
+ */
1510
+ sendTeamDomainNotice(options) {
1511
+ return (options?.client ?? this.client).post({ url: "/team/domain-notice", ...options });
1512
+ }
1410
1513
  /**
1411
1514
  * Invites a user to a team.
1412
1515
  */
@@ -1420,6 +1523,53 @@ var Sdk = class _Sdk extends HeyApiClient {
1420
1523
  }
1421
1524
  });
1422
1525
  }
1526
+ /**
1527
+ * Turns off the team's invite link. Requires a team admin or owner.
1528
+ */
1529
+ deleteTeamInviteLink(options) {
1530
+ return (options?.client ?? this.client).delete({ url: "/team/invite-link", ...options });
1531
+ }
1532
+ /**
1533
+ * Gets the team's invite link. Anyone who may invite people to the team may
1534
+ * see it.
1535
+ */
1536
+ getTeamInviteLink(options) {
1537
+ return (options?.client ?? this.client).get({ url: "/team/invite-link", ...options });
1538
+ }
1539
+ /**
1540
+ * Creates the team's invite link, replacing any existing one. Anyone who may
1541
+ * invite people may create the first link; replacing one requires a team
1542
+ * admin or owner.
1543
+ */
1544
+ createTeamInviteLink(options) {
1545
+ return (options?.client ?? this.client).post({ url: "/team/invite-link", ...options });
1546
+ }
1547
+ /**
1548
+ * Joins the team an invite link belongs to.
1549
+ */
1550
+ joinTeamByInviteLink(options) {
1551
+ return (options.client ?? this.client).post({
1552
+ url: "/team/invite-link/join",
1553
+ ...options,
1554
+ headers: {
1555
+ "Content-Type": "application/json",
1556
+ ...options.headers
1557
+ }
1558
+ });
1559
+ }
1560
+ /**
1561
+ * Gets the team an invite link joins, so the user can see it before joining.
1562
+ */
1563
+ getTeamByInviteLink(options) {
1564
+ return (options.client ?? this.client).post({
1565
+ url: "/team/invite-link/team",
1566
+ ...options,
1567
+ headers: {
1568
+ "Content-Type": "application/json",
1569
+ ...options.headers
1570
+ }
1571
+ });
1572
+ }
1423
1573
  /**
1424
1574
  * Deletes a team invite from a team.
1425
1575
  */
@@ -1488,6 +1638,16 @@ var Sdk = class _Sdk extends HeyApiClient {
1488
1638
  getUserInvites(options) {
1489
1639
  return (options?.client ?? this.client).get({ url: "/team/user/invites", ...options });
1490
1640
  }
1641
+ /**
1642
+ * Finishes an agent's signup: joins the team that invited it and mints its
1643
+ * SDK token.
1644
+ *
1645
+ * Safe to repeat until the agent confirms it saved the token: a reload replaces
1646
+ * the key, and a failed join stays pending for the next attempt.
1647
+ */
1648
+ agentSetup(options) {
1649
+ return (options?.client ?? this.client).post({ url: "/user/agent_setup", ...options });
1650
+ }
1491
1651
  /**
1492
1652
  * Retrieves user names in bulk
1493
1653
  */
@@ -1527,6 +1687,26 @@ var Sdk = class _Sdk extends HeyApiClient {
1527
1687
  }
1528
1688
  });
1529
1689
  }
1690
+ /**
1691
+ * Get the caller's interface language.
1692
+ */
1693
+ getUserLanguage(options) {
1694
+ return (options?.client ?? this.client).get({ url: "/user/language", ...options });
1695
+ }
1696
+ /**
1697
+ * Set the caller's interface language, or clear it to follow their team's,
1698
+ * else their browser's.
1699
+ */
1700
+ putUserLanguage(options) {
1701
+ return (options.client ?? this.client).put({
1702
+ url: "/user/language",
1703
+ ...options,
1704
+ headers: {
1705
+ "Content-Type": "application/json",
1706
+ ...options.headers
1707
+ }
1708
+ });
1709
+ }
1530
1710
  /**
1531
1711
  * Gets the calling user's info which matches what was given in the **deprecated**
1532
1712
  * getUserPermissions query in our graphql api.
@@ -1592,6 +1772,33 @@ var Sdk = class _Sdk extends HeyApiClient {
1592
1772
  putProfilePicture(options) {
1593
1773
  return (options.client ?? this.client).put({ url: "/user/profile_picture", ...options });
1594
1774
  }
1775
+ /**
1776
+ * Reserves storage for a new profile picture. Static file storage has no
1777
+ * MacroDB, so it cannot check API keys; this route lets key holders upload.
1778
+ */
1779
+ createProfilePictureUpload(options) {
1780
+ return (options.client ?? this.client).post({
1781
+ url: "/user/profile_picture/file",
1782
+ ...options,
1783
+ headers: {
1784
+ "Content-Type": "application/json",
1785
+ ...options.headers
1786
+ }
1787
+ });
1788
+ }
1789
+ /**
1790
+ * Sets the caller's profile picture to an image they uploaded.
1791
+ */
1792
+ putProfilePictureFile(options) {
1793
+ return (options.client ?? this.client).put({
1794
+ url: "/user/profile_picture/file",
1795
+ ...options,
1796
+ headers: {
1797
+ "Content-Type": "application/json",
1798
+ ...options.headers
1799
+ }
1800
+ });
1801
+ }
1595
1802
  /**
1596
1803
  * Retrieves profile picture URLs for a list of users
1597
1804
  */