@macro-inc/sdk 0.4.1 → 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 (228) hide show
  1. package/README.md +316 -21
  2. package/dist/{chunk-PTX2RV2N.js → chunk-4MI52GWV.js} +93 -1
  3. package/dist/{chunk-XFA7NCJ5.js → chunk-HO75UE4Z.js} +146 -15
  4. package/dist/{chunk-P4DTO6VD.js → chunk-MCSQNZ4E.js} +6 -0
  5. package/dist/{chunk-ZLBDES7U.js → chunk-SJ6S2GAT.js} +1271 -87
  6. package/dist/{chunk-AZJUIUIV.js → chunk-SK5CMXRV.js} +100 -14
  7. package/dist/{chunk-PZPTJI6F.js → chunk-TMTYN2UK.js} +229 -2
  8. package/dist/{chunk-PPR7IWZ7.js → chunk-ZYBAKW25.js} +2 -1
  9. package/dist/generated/agent-fold/index.d.ts +202 -14
  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 +49 -2
  13. package/dist/generated/agent-harness/types.gen.d.ts +527 -9
  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 +82 -16
  18. package/dist/generated/auth/types.gen.d.ts +768 -18
  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 +60 -6
  23. package/dist/generated/cognition/types.gen.d.ts +663 -106
  24. package/dist/generated/connection/types.gen.d.ts +1 -1
  25. package/dist/generated/contacts/index.d.ts +1 -1
  26. package/dist/generated/contacts/index.js +1 -1
  27. package/dist/generated/contacts/sdk.gen.d.ts +5 -1
  28. package/dist/generated/contacts/types.gen.d.ts +56 -0
  29. package/dist/generated/email/types.gen.d.ts +8 -2
  30. package/dist/generated/notification/index.d.ts +1 -1
  31. package/dist/generated/notification/index.js +1 -1
  32. package/dist/generated/notification/sdk.gen.d.ts +2 -1
  33. package/dist/generated/notification/types.gen.d.ts +174 -1
  34. package/dist/generated/scheduled-action/index.d.ts +1 -1
  35. package/dist/generated/scheduled-action/index.js +1 -1
  36. package/dist/generated/scheduled-action/sdk.gen.d.ts +107 -2
  37. package/dist/generated/scheduled-action/types.gen.d.ts +2451 -479
  38. package/dist/generated/search/index.d.ts +1 -1
  39. package/dist/generated/search/types.gen.d.ts +50 -11
  40. package/dist/generated/storage/index.d.ts +1 -1
  41. package/dist/generated/storage/index.js +1 -1
  42. package/dist/generated/storage/sdk.gen.d.ts +511 -18
  43. package/dist/generated/storage/types.gen.d.ts +18528 -11395
  44. package/dist/src/entities/account-managers/grant.d.ts +28 -5
  45. package/dist/src/entities/account-managers/namespace.d.ts +15 -3
  46. package/dist/src/entities/activity/entity.d.ts +7 -0
  47. package/dist/src/entities/activity/namespace.d.ts +58 -0
  48. package/dist/src/entities/activity/namespace.test.d.ts +1 -0
  49. package/dist/src/entities/agent-sessions/activity.d.ts +12 -3
  50. package/dist/src/entities/agent-sessions/agent-session.d.ts +209 -22
  51. package/dist/src/entities/agent-sessions/code-execution.d.ts +15 -3
  52. package/dist/src/entities/agent-sessions/conversation.d.ts +46 -9
  53. package/dist/src/entities/agent-sessions/namespace.d.ts +72 -16
  54. package/dist/src/entities/agent-sessions/origin.d.ts +1 -1
  55. package/dist/src/entities/agent-sessions/queued-action.d.ts +17 -3
  56. package/dist/src/entities/agent-sessions/review.d.ts +56 -5
  57. package/dist/src/entities/agent-sessions/tool-approval.d.ts +5 -1
  58. package/dist/src/entities/agents/agent.d.ts +98 -3
  59. package/dist/src/entities/agents/namespace.d.ts +52 -8
  60. package/dist/src/entities/ai/namespace.d.ts +10 -2
  61. package/dist/src/entities/api-keys/api-key.d.ts +6 -1
  62. package/dist/src/entities/api-keys/namespace.d.ts +18 -3
  63. package/dist/src/entities/bots/bot.d.ts +44 -9
  64. package/dist/src/entities/bots/namespace.d.ts +13 -1
  65. package/dist/src/entities/bots/token.d.ts +6 -1
  66. package/dist/src/entities/calendar/booking-link.d.ts +7 -1
  67. package/dist/src/entities/calendar/booking-namespace.d.ts +14 -1
  68. package/dist/src/entities/calendar/booking.d.ts +15 -0
  69. package/dist/src/entities/calendar/calendar.d.ts +10 -3
  70. package/dist/src/entities/calendar/event.d.ts +68 -9
  71. package/dist/src/entities/calendar/namespace.d.ts +91 -12
  72. package/dist/src/entities/calendar/replacement.d.ts +19 -3
  73. package/dist/src/entities/calls/call-record.d.ts +107 -17
  74. package/dist/src/entities/calls/connection.d.ts +7 -1
  75. package/dist/src/entities/calls/message.d.ts +27 -5
  76. package/dist/src/entities/calls/namespace.d.ts +15 -3
  77. package/dist/src/entities/canvases/canvas.d.ts +329 -0
  78. package/dist/src/entities/channels/access-request.d.ts +10 -2
  79. package/dist/src/entities/channels/activity.d.ts +20 -4
  80. package/dist/src/entities/channels/channel.d.ts +154 -27
  81. package/dist/src/entities/channels/labels.d.ts +41 -7
  82. package/dist/src/entities/channels/message.d.ts +105 -8
  83. package/dist/src/entities/channels/message.test.d.ts +1 -0
  84. package/dist/src/entities/channels/namespace.d.ts +37 -7
  85. package/dist/src/entities/channels/post.d.ts +13 -7
  86. package/dist/src/entities/channels/post.test.d.ts +1 -0
  87. package/dist/src/entities/channels/share.d.ts +9 -0
  88. package/dist/src/entities/channels/share.test.d.ts +1 -0
  89. package/dist/src/entities/channels/thread.d.ts +24 -4
  90. package/dist/src/entities/chats/chat.d.ts +57 -7
  91. package/dist/src/entities/chats/generation.d.ts +11 -2
  92. package/dist/src/entities/chats/namespace.d.ts +10 -2
  93. package/dist/src/entities/connected-apps/connected-app.d.ts +16 -2
  94. package/dist/src/entities/connected-apps/connector.d.ts +3 -0
  95. package/dist/src/entities/connected-apps/namespace.d.ts +18 -0
  96. package/dist/src/entities/crm/company.d.ts +64 -16
  97. package/dist/src/entities/crm/contact.d.ts +102 -14
  98. package/dist/src/entities/crm/namespace.d.ts +113 -22
  99. package/dist/src/entities/crm/pipeline-entry.d.ts +109 -0
  100. package/dist/src/entities/crm/pipeline.d.ts +292 -29
  101. package/dist/src/entities/crm/pipelines.d.ts +69 -4
  102. package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
  103. package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
  104. package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
  105. package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
  106. package/dist/src/entities/databases/column.d.ts +54 -7
  107. package/dist/src/entities/databases/database.d.ts +160 -18
  108. package/dist/src/entities/databases/namespace.d.ts +40 -8
  109. package/dist/src/entities/databases/row.d.ts +2 -0
  110. package/dist/src/entities/databases/saved-query.d.ts +151 -0
  111. package/dist/src/entities/databases/table.d.ts +73 -10
  112. package/dist/src/entities/databases/view.d.ts +37 -5
  113. package/dist/src/entities/databases/webhook.d.ts +8 -1
  114. package/dist/src/entities/documents/ai-edit.d.ts +2 -0
  115. package/dist/src/entities/documents/anchor.d.ts +12 -2
  116. package/dist/src/entities/documents/comment.d.ts +29 -5
  117. package/dist/src/entities/documents/create.test.d.ts +1 -0
  118. package/dist/src/entities/documents/document.d.ts +284 -26
  119. package/dist/src/entities/documents/markdown.d.ts +25 -0
  120. package/dist/src/entities/documents/namespace.d.ts +146 -13
  121. package/dist/src/entities/documents/skills.test.d.ts +1 -0
  122. package/dist/src/entities/documents/system-skill.d.ts +21 -1
  123. package/dist/src/entities/documents/text-comment.d.ts +41 -0
  124. package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
  125. package/dist/src/entities/documents/version.d.ts +5 -1
  126. package/dist/src/entities/email/attachment.d.ts +3 -0
  127. package/dist/src/entities/email/draft.d.ts +61 -9
  128. package/dist/src/entities/email/filter.d.ts +12 -2
  129. package/dist/src/entities/email/label.d.ts +7 -1
  130. package/dist/src/entities/email/link.d.ts +5 -1
  131. package/dist/src/entities/email/message.d.ts +72 -14
  132. package/dist/src/entities/email/namespace.d.ts +134 -24
  133. package/dist/src/entities/email/thread.d.ts +124 -18
  134. package/dist/src/entities/entity-mentions/mention.d.ts +6 -1
  135. package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
  136. package/dist/src/entities/entity.d.ts +65 -6
  137. package/dist/src/entities/external-chat/chat.d.ts +80 -12
  138. package/dist/src/entities/external-chat/message.d.ts +1 -1
  139. package/dist/src/entities/external-chat/namespace.d.ts +5 -1
  140. package/dist/src/entities/external-chat/send.d.ts +10 -2
  141. package/dist/src/entities/favorites/namespace.d.ts +20 -3
  142. package/dist/src/entities/foreign/foreign-entity.d.ts +5 -1
  143. package/dist/src/entities/foreign/namespace.d.ts +5 -1
  144. package/dist/src/entities/forms/form.d.ts +91 -14
  145. package/dist/src/entities/forms/namespace.d.ts +10 -2
  146. package/dist/src/entities/forms/question.d.ts +35 -7
  147. package/dist/src/entities/forms/response.d.ts +25 -5
  148. package/dist/src/entities/forms/section.d.ts +15 -3
  149. package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
  150. package/dist/src/entities/github-pull-requests/pull-request.d.ts +15 -3
  151. package/dist/src/entities/harnesses/harness.d.ts +51 -3
  152. package/dist/src/entities/harnesses/namespace.d.ts +54 -8
  153. package/dist/src/entities/harnesses/pairing.d.ts +13 -2
  154. package/dist/src/entities/images/image.d.ts +16 -5
  155. package/dist/src/entities/images/namespace.d.ts +8 -1
  156. package/dist/src/entities/imports/entry.d.ts +65 -0
  157. package/dist/src/entities/imports/namespace.d.ts +103 -0
  158. package/dist/src/entities/imports/namespace.test.d.ts +1 -0
  159. package/dist/src/entities/initiatives/initiative.d.ts +128 -4
  160. package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
  161. package/dist/src/entities/initiatives/namespace.d.ts +71 -7
  162. package/dist/src/entities/me/namespace.d.ts +28 -3
  163. package/dist/src/entities/meetings/meeting.d.ts +46 -8
  164. package/dist/src/entities/meetings/namespace.d.ts +20 -4
  165. package/dist/src/entities/memory/namespace.d.ts +49 -0
  166. package/dist/src/entities/memory/namespace.test.d.ts +1 -0
  167. package/dist/src/entities/messages/discussion.d.ts +84 -0
  168. package/dist/src/entities/messages/thread.d.ts +19 -5
  169. package/dist/src/entities/notifications/namespace.d.ts +41 -7
  170. package/dist/src/entities/notifications/notification.d.ts +31 -6
  171. package/dist/src/entities/passwords/item.d.ts +118 -0
  172. package/dist/src/entities/passwords/namespace.d.ts +45 -0
  173. package/dist/src/entities/pins/namespace.d.ts +23 -4
  174. package/dist/src/entities/projects/namespace.d.ts +29 -0
  175. package/dist/src/entities/projects/project.d.ts +58 -7
  176. package/dist/src/entities/properties/namespace.d.ts +67 -11
  177. package/dist/src/entities/properties/namespace.test.d.ts +1 -0
  178. package/dist/src/entities/properties/property-definition.d.ts +30 -5
  179. package/dist/src/entities/properties/property-option.d.ts +14 -2
  180. package/dist/src/entities/referrals/namespace.d.ts +8 -1
  181. package/dist/src/entities/routines/namespace.d.ts +198 -14
  182. package/dist/src/entities/routines/routine.d.ts +174 -27
  183. package/dist/src/entities/routines/suggestion.d.ts +38 -0
  184. package/dist/src/entities/saved-views/namespace.d.ts +58 -0
  185. package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
  186. package/dist/src/entities/search/exclusions.d.ts +6 -0
  187. package/dist/src/entities/search/namespace.d.ts +9 -3
  188. package/dist/src/entities/search/options.d.ts +3 -2
  189. package/dist/src/entities/sharing/access.d.ts +50 -9
  190. package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
  191. package/dist/src/entities/suggestions/namespace.d.ts +118 -0
  192. package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
  193. package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
  194. package/dist/src/entities/tasks/namespace.d.ts +18 -5
  195. package/dist/src/entities/tasks/task.d.ts +21 -3
  196. package/dist/src/entities/teams/invite.d.ts +3 -0
  197. package/dist/src/entities/teams/namespace.d.ts +10 -2
  198. package/dist/src/entities/teams/team.d.ts +22 -2
  199. package/dist/src/entities/ui/app-link.d.ts +24 -0
  200. package/dist/src/entities/ui/namespace.d.ts +75 -0
  201. package/dist/src/entities/unfurls/namespace.d.ts +12 -2
  202. package/dist/src/entities/users/namespace.d.ts +26 -4
  203. package/dist/src/entities/users/profile-picture.d.ts +29 -0
  204. package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
  205. package/dist/src/entities/users/user.d.ts +52 -1
  206. package/dist/src/entities/web/namespace.d.ts +6 -0
  207. package/dist/src/entities/webhooks/namespace.d.ts +5 -0
  208. package/dist/src/entities/webhooks/webhook.d.ts +47 -7
  209. package/dist/src/entities/whatsapp/account.d.ts +5 -1
  210. package/dist/src/entities/whatsapp/chat.d.ts +9 -1
  211. package/dist/src/entities/whatsapp/namespace.d.ts +7 -1
  212. package/dist/src/entities/workspace/namespace.d.ts +12 -4
  213. package/dist/src/entities/workspace/query.d.ts +5 -1
  214. package/dist/src/entities/workspace/query.test.d.ts +1 -0
  215. package/dist/src/events/hydrate/document.d.ts +5 -0
  216. package/dist/src/events/hydrate/user.d.ts +14 -0
  217. package/dist/src/events/receiver.d.ts +2 -0
  218. package/dist/src/events/types.d.ts +2 -1
  219. package/dist/src/macro.d.ts +59 -6
  220. package/dist/src/macro.js +18710 -10355
  221. package/dist/src/utils/activity.d.ts +2 -0
  222. package/dist/src/utils/index.d.ts +1 -1
  223. package/dist/src/utils/lazy.d.ts +20 -1
  224. package/dist/src/utils/options.d.ts +7 -0
  225. package/dist/src/utils/pagination.d.ts +16 -0
  226. package/dist/src/utils/verbs.d.ts +3 -0
  227. package/package.json +1 -1
  228. package/dist/src/entities/crm/comment.d.ts +0 -64
@@ -14,6 +14,9 @@ export declare class WebhooksNamespace {
14
14
  * workspace's webhooks (the endpoint returns 409 on a clash) and cannot be
15
15
  * changed later. `filters` must be non-empty (each entry matches event
16
16
  * names, optionally narrowed to entity ids); `scope` defaults to `'user'`.
17
+ *
18
+ * @write
19
+ * @openworld
17
20
  */
18
21
  create(opts: {
19
22
  url: string;
@@ -28,6 +31,8 @@ export declare class WebhooksNamespace {
28
31
  /**
29
32
  * The caller's webhooks across their personal and team workspaces, newest
30
33
  * first. Each returned handle already holds its record.
34
+ *
35
+ * @readonly
31
36
  */
32
37
  list(): Promise<Webhook[]>;
33
38
  }
@@ -65,26 +65,66 @@ export declare class Webhook extends MacroEntity<WebhookRecord> {
65
65
  * their team (`team`). Derived from ownership: a personal webhook's owning
66
66
  * workspace is the creator's own user id, whereas a team webhook's workspace
67
67
  * is a distinct team id.
68
+ *
69
+ * @readonly
68
70
  */
69
71
  scope(): Promise<WebhookScope>;
70
- /** Update the webhook. */
72
+ /**
73
+ * Update the webhook.
74
+ *
75
+ * @write
76
+ * @idempotent
77
+ */
71
78
  update(body: PatchWebhookRequest): Promise<void>;
72
- /** Rename the webhook. */
79
+ /**
80
+ * Rename the webhook.
81
+ *
82
+ * @write
83
+ * @idempotent
84
+ */
73
85
  rename(name: string): Promise<void>;
74
- /** Point the webhook at a new HTTPS endpoint URL. */
86
+ /**
87
+ * Point the webhook at a new HTTPS endpoint URL.
88
+ *
89
+ * @write
90
+ * @idempotent
91
+ */
75
92
  setUrl(url: string): Promise<void>;
76
- /** Replace the webhook's delivery filters (must be non-empty). */
93
+ /**
94
+ * Replace the webhook's delivery filters (must be non-empty).
95
+ *
96
+ * @write
97
+ * @idempotent
98
+ */
77
99
  setFilters(filters: WebhookFilter[]): Promise<void>;
78
- /** Pause deliveries. */
100
+ /**
101
+ * Pause deliveries.
102
+ *
103
+ * @write
104
+ * @idempotent
105
+ */
79
106
  pause(): Promise<void>;
80
- /** Resume deliveries. */
107
+ /**
108
+ * Resume deliveries.
109
+ *
110
+ * @write
111
+ * @idempotent
112
+ */
81
113
  resume(): Promise<void>;
82
- /** Delete the webhook. */
114
+ /**
115
+ * Delete the webhook.
116
+ *
117
+ * @destructive
118
+ * @idempotent
119
+ */
83
120
  delete(): Promise<void>;
84
121
  /**
85
122
  * Send a signed validation test delivery to the endpoint and report whether
86
123
  * it was accepted. Drops the cached detail so a subsequent {@link isValid}
87
124
  * read reflects the new validation state.
125
+ *
126
+ * @write
127
+ * @openworld
88
128
  */
89
129
  validate(): Promise<ValidateWebhookResponse>;
90
130
  }
@@ -15,6 +15,10 @@ export declare class WhatsAppAccount extends MacroEntity<WhatsAppAccountRecord>
15
15
  readonly identity: () => Promise<string | undefined>;
16
16
  /** The Macro user who owns this account. */
17
17
  readonly owner: () => Promise<User>;
18
- /** Discard cached connection state and load its current value. */
18
+ /**
19
+ * Discard cached connection state and load its current value.
20
+ *
21
+ * @readonly
22
+ */
19
23
  refresh(): Promise<this>;
20
24
  }
@@ -47,8 +47,16 @@ export declare class WhatsAppChat extends MacroEntity<WhatsAppChatRecord> {
47
47
  * own external chat; its earlier messages are imported from the phone.
48
48
  * Adding it again returns the same chat. Only the owner sends in a direct
49
49
  * chat.
50
+ *
51
+ * @write
52
+ * @idempotent
53
+ * @openworld
50
54
  */
51
55
  add(): Promise<ExternalChat>;
52
- /** Reload the chat's list entry. */
56
+ /**
57
+ * Reload the chat's list entry.
58
+ *
59
+ * @readonly
60
+ */
53
61
  refresh(): Promise<this>;
54
62
  }
@@ -12,12 +12,18 @@ export declare class WhatsAppNamespace {
12
12
  private readonly client;
13
13
  /** Bind existing-account operations to this authenticated client. */
14
14
  constructor(client: MacroClient);
15
- /** Current owner's account, or undefined when no account has been connected. */
15
+ /**
16
+ * Current owner's account, or undefined when no account has been connected.
17
+ *
18
+ * @readonly
19
+ */
16
20
  account(): Promise<WhatsAppAccount | undefined>;
17
21
  /**
18
22
  * The caller's WhatsApp chat list (groups and direct chats), newest
19
23
  * activity first: each chat says whether it is added, shared with the caller
20
24
  * or addable, and `chat.add()` adds it.
25
+ *
26
+ * @readonly
21
27
  */
22
28
  chats(): Promise<WhatsAppChat[]>;
23
29
  }
@@ -1,3 +1,4 @@
1
+ import { type IterationOptions } from '../../utils';
1
2
  import type { MacroClient } from '../../utils/client';
2
3
  import type { WorkspaceItem, WorkspaceListOptions, WorkspacePage, WorkspacePageOptions } from './types';
3
4
  /**
@@ -75,14 +76,21 @@ import type { WorkspaceItem, WorkspaceListOptions, WorkspacePage, WorkspacePageO
75
76
  export declare class WorkspaceNamespace {
76
77
  private readonly client;
77
78
  constructor(client: MacroClient);
78
- /** One bounded page of recent items, newest first by default; resume using nextCursor and the same options. */
79
+ /**
80
+ * One bounded page of recent items, newest first by default; resume using nextCursor and the same options.
81
+ *
82
+ * @readonly
83
+ */
79
84
  page(options?: WorkspacePageOptions): Promise<WorkspacePage>;
80
85
  /**
81
- * Every matching item, newest first by default, auto-paginated. `limit` is a
82
- * page size, not a total result limit.
86
+ * Every matching item, newest first by default, auto-paginated; `maxItems` caps the total. `limit` is a
87
+ * page size; `maxItems` caps the total.
83
88
  * Break a `for await` loop to stop; no speculative next page is fetched.
84
89
  * Tag/inbox resolution is reused within this iterator.
90
+ *
91
+ * @readonly
85
92
  */
86
- list(options?: WorkspaceListOptions): AsyncGenerator<WorkspaceItem>;
93
+ list(options?: WorkspaceListOptions & IterationOptions): AsyncGenerator<WorkspaceItem>;
94
+ private listPages;
87
95
  private fetch;
88
96
  }
@@ -12,7 +12,11 @@ type ResolvedTag = WorkspaceTag & {
12
12
  id: string;
13
13
  definitionId: string;
14
14
  };
15
- /** @internal */
15
+ /**
16
+ * @internal
17
+ *
18
+ * @mcp-exclude Internal query-building helper, not reachable from the `Macro` client.
19
+ */
16
20
  export declare class WorkspaceQuery {
17
21
  private readonly client;
18
22
  private tagSets?;
@@ -0,0 +1 @@
1
+ export {};
@@ -51,4 +51,9 @@ export declare function hydrateDocumentEvent(client: MacroClient, event: Documen
51
51
  event_type: "document.interaction";
52
52
  metadata: import("../../../generated/storage").DocumentInteractionMetadata;
53
53
  document: Document;
54
+ } | {
55
+ event_type: "document.email_attachments_released";
56
+ metadata: import("../../../generated/storage").EmailAttachmentsReleasedMetadata;
57
+ trashedDocuments: Document[];
58
+ keptDocuments: Document[];
54
59
  } | undefined;
@@ -0,0 +1,14 @@
1
+ import { StaticImage } from '../../entities/images/image';
2
+ import { User } from '../../entities/users/user';
3
+ import type { MacroClient } from '../../utils/client';
4
+ import type { MacroEvent } from '../types';
5
+ export type UserEvent = Extract<MacroEvent, {
6
+ event_type: `user.${string}`;
7
+ }>;
8
+ /** Attach SDK entity handles to a user webhook event. */
9
+ export declare function hydrateUserEvent(client: MacroClient, event: UserEvent): {
10
+ event_type: "user.picture_changed";
11
+ metadata: import("../../../generated/storage").UserPictureChangedMetadata;
12
+ user: User;
13
+ image: StaticImage | undefined;
14
+ } | undefined;
@@ -23,6 +23,8 @@ export interface ListenOptions {
23
23
  * {@link MacroEvents.webhook} at a persisted webhook URL.
24
24
  *
25
25
  * Obtain via `macro.events` — do not construct directly.
26
+ *
27
+ * @mcp-exclude Registers live event handlers and listeners; MCP calls carry JSON only.
26
28
  */
27
29
  export declare class MacroEvents {
28
30
  private readonly client;
@@ -4,6 +4,7 @@ import type { hydrateCallEvent } from './hydrate/call';
4
4
  import type { hydrateChannelEvent } from './hydrate/channel';
5
5
  import type { hydrateDocumentEvent } from './hydrate/document';
6
6
  import type { hydrateMessageEvent } from './hydrate/message';
7
+ import type { hydrateUserEvent } from './hydrate/user';
7
8
  /** A webhook delivery body, exactly as Macro serializes it. */
8
9
  export type MacroEvent = WebhookEvent;
9
10
  /** Every entity event name Macro can deliver. */
@@ -19,7 +20,7 @@ export type EventPayload<E extends EventName> = Extract<MacroEvent, {
19
20
  * ride along with which event — this reads their inferred return types back
20
21
  * rather than restating the mapping.
21
22
  */
22
- type HydratedEvent = ReturnType<typeof hydrateAgentSessionEvent> | ReturnType<typeof hydrateChannelEvent> | ReturnType<typeof hydrateCallEvent> | ReturnType<typeof hydrateDocumentEvent> | ReturnType<typeof hydrateMessageEvent>;
23
+ type HydratedEvent = ReturnType<typeof hydrateAgentSessionEvent> | ReturnType<typeof hydrateChannelEvent> | ReturnType<typeof hydrateCallEvent> | ReturnType<typeof hydrateDocumentEvent> | ReturnType<typeof hydrateMessageEvent> | ReturnType<typeof hydrateUserEvent>;
23
24
  /**
24
25
  * What a handler receives, per event: the raw `metadata` plus the ORM handles
25
26
  * named by that event's ids.
@@ -1,5 +1,6 @@
1
1
  import type { MacroOpts } from './config';
2
2
  import { AccountManagerNamespace } from './entities/account-managers/namespace';
3
+ import { ActivityNamespace } from './entities/activity/namespace';
3
4
  import { AgentSessionNamespace } from './entities/agent-sessions/namespace';
4
5
  import { AgentNamespace } from './entities/agents/namespace';
5
6
  import { AiNamespace } from './entities/ai/namespace';
@@ -22,18 +23,24 @@ import { FormNamespace } from './entities/forms/namespace';
22
23
  import { GithubPullRequestNamespace } from './entities/github-pull-requests/namespace';
23
24
  import { HarnessNamespace } from './entities/harnesses/namespace';
24
25
  import { ImagesNamespace } from './entities/images/namespace';
26
+ import { ImportNamespace } from './entities/imports/namespace';
25
27
  import { InitiativeNamespace } from './entities/initiatives/namespace';
26
28
  import { MeNamespace } from './entities/me/namespace';
27
29
  import { MeetingNamespace } from './entities/meetings/namespace';
30
+ import { MemoryNamespace } from './entities/memory/namespace';
28
31
  import { NotificationNamespace } from './entities/notifications/namespace';
32
+ import { PasswordNamespace } from './entities/passwords/namespace';
29
33
  import { PinsNamespace } from './entities/pins/namespace';
30
34
  import { ProjectNamespace } from './entities/projects/namespace';
31
35
  import { PropertiesNamespace } from './entities/properties/namespace';
32
36
  import { ReferralNamespace } from './entities/referrals/namespace';
33
37
  import { RoutineNamespace } from './entities/routines/namespace';
38
+ import { SavedViewsNamespace } from './entities/saved-views/namespace';
34
39
  import { SearchNamespace } from './entities/search/namespace';
40
+ import { SuggestionNamespace } from './entities/suggestions/namespace';
35
41
  import { TaskNamespace } from './entities/tasks/namespace';
36
42
  import { TeamNamespace } from './entities/teams/namespace';
43
+ import { UiNamespace } from './entities/ui/namespace';
37
44
  import { UnfurlNamespace } from './entities/unfurls/namespace';
38
45
  import { UserNamespace } from './entities/users/namespace';
39
46
  import type { User } from './entities/users/user';
@@ -43,7 +50,9 @@ import { WhatsAppNamespace } from './entities/whatsapp/namespace';
43
50
  import { WorkspaceNamespace } from './entities/workspace/namespace';
44
51
  import type { MacroEvents } from './events/receiver';
45
52
  import { MacroClient } from './utils/client';
53
+ export type { AppearanceColor, AppearanceIcon, EntityAppearance, } from '../generated/storage/types.gen';
46
54
  export type { MacroOpts } from './config';
55
+ export type { ActivityAction, ActivityEvent, ActivityRange, } from './entities/activity/namespace';
47
56
  export { CodeExecution } from './entities/agent-sessions/code-execution';
48
57
  export type { DecisionRequest, DecisionResponse, StructuredCompletionRequest, StructuredCompletionResponse, } from './entities/ai/namespace';
49
58
  export { CallRecord } from './entities/calls/call-record';
@@ -55,11 +64,17 @@ export { CallParticipant } from './entities/calls/participant';
55
64
  export { ConnectedApp, ConnectedTool, } from './entities/connected-apps/connected-app';
56
65
  export { Connector } from './entities/connected-apps/connector';
57
66
  export { ConnectedAppNamespace } from './entities/connected-apps/namespace';
58
- export { type AddColumnOptions, type ApplyOpsOptions, type ChangeColumnTypeOptions, type ColumnType, type ConvertIntoNewColumnOptions, MacroOpRefusedError, type OpResultOf, } from './entities/databases/database';
67
+ export type { CrmEmailPolicy, CrmEmailPolicyHistoryEvent, CrmEmailPolicyResult, CrmEmailPolicyToken, CrmEmailPolicyWriteOptions, CrmEmailPrivacySettings, CrmEmailRuleValidation, CrmExcludedEmailThread, } from './entities/crm-email-privacy/email-privacy';
68
+ export { type CrmEmailPreviewState, CrmEmailRulePreview, } from './entities/crm-email-privacy/email-rule-preview';
69
+ export { type CrmEmailRuleDefinition, CrmEmailRuleRevision, } from './entities/crm-email-privacy/email-rule-revision';
70
+ export type { CrmEmailRule, CrmEmailRuleSet, } from './entities/crm-email-privacy/email-rules';
71
+ export { type AddColumnOptions, type ApplyOpsOptions, type ChangeColumnTypeOptions, type ColumnType, type ConvertIntoNewColumnOptions, type CreateDatabaseOptions, MacroOpRefusedError, type OpResultOf, } from './entities/databases/database';
59
72
  export { Form, type FormAnswer, type FormAnswerValue, type FormBookingStep, type FormBookingTarget, type FormEntityHandle, type FormLayoutResult, type FormQuestionPlacement, type FormQuestionTally, FormReference, type FormResponseSummary, type FormRules, type FormRuleTest, type FormSectionPlacement, type FormSubmissionOutcome, type MyFormResponse, type SavedFormResponse, } from './entities/forms/form';
60
73
  export { FormOption, FormQuestion } from './entities/forms/question';
61
74
  export { FormResponse } from './entities/forms/response';
62
75
  export { FormSection } from './entities/forms/section';
76
+ export type { CreatedEntity } from './entities/routines/namespace';
77
+ export { AppLink, UiNamespace, type UiOpenOptions, type UiOpenResult, type UiTarget, } from './entities/ui/namespace';
63
78
  export type { ListenOptions, MacroEvents } from './events/receiver';
64
79
  export { here, type Interpolation, type Mentionable, type MentionPart, msg, type RichMessage, type SimpleMention, toBody, wrapXml, } from './mentions';
65
80
  export type { RequestActivity } from './utils/activity';
@@ -71,6 +86,8 @@ export type { RequestActivity } from './utils/activity';
71
86
  export declare class Macro<T extends MacroOpts = MacroOpts> {
72
87
  /** routines resources and operations. */
73
88
  readonly routines: RoutineNamespace;
89
+ /** suggestions resources and operations. */
90
+ readonly suggestions: SuggestionNamespace;
74
91
  /** unfurls resources and operations. */
75
92
  readonly unfurls: UnfurlNamespace;
76
93
  /** agents resources and operations. */
@@ -106,14 +123,22 @@ export declare class Macro<T extends MacroOpts = MacroOpts> {
106
123
  readonly email: EmailNamespace;
107
124
  /** Call the user's connected apps and MCP servers from a code execution. */
108
125
  readonly connectedApps: ConnectedAppNamespace;
126
+ /** Open items in the Macro app tab the user prompted from. */
127
+ readonly ui: UiNamespace;
109
128
  readonly favorites: FavoritesNamespace;
110
129
  readonly foreignEntities: ForeignEntityNamespace;
111
130
  /** Build forms and submit answers without granting respondents database access. */
112
131
  readonly forms: FormNamespace;
113
132
  /** Generate images with AI and attach them to messages. */
114
133
  readonly images: ImagesNamespace;
134
+ /** The import ledger: external items proposed for, or copied into, Macro. */
135
+ readonly imports: ImportNamespace;
115
136
  /** Search the public web and read web pages. */
116
137
  readonly web: WebNamespace;
138
+ /** The acting user's private explicit memory. */
139
+ readonly memory: MemoryNamespace;
140
+ /** The acting user's own action history. */
141
+ readonly activity: ActivityNamespace;
117
142
  /** Your own profile: set your name and profile picture. */
118
143
  readonly me: MeNamespace;
119
144
  readonly notifications: NotificationNamespace;
@@ -122,6 +147,10 @@ export declare class Macro<T extends MacroOpts = MacroOpts> {
122
147
  readonly properties: PropertiesNamespace;
123
148
  /** Share the caller's referral link and email invites to join Macro. */
124
149
  readonly referrals: ReferralNamespace;
150
+ /** Saved views: named filter definitions shown in a surface's sidebar, such as Email. */
151
+ readonly savedViews: SavedViewsNamespace;
152
+ /** The authenticated agent's view of its team vaults; agent API keys only. */
153
+ readonly passwords: PasswordNamespace;
125
154
  readonly tasks: TaskNamespace;
126
155
  /** Search every kind of item at once: documents, email, channels, calls, events, sessions and chats. */
127
156
  readonly search: SearchNamespace;
@@ -140,15 +169,21 @@ export declare class Macro<T extends MacroOpts = MacroOpts> {
140
169
  /**
141
170
  * The authenticated caller's mentionable principal — `bot|<uuid>` for bot
142
171
  * auth, `macro|<email>` for user auth — fetched once and cached.
172
+ *
173
+ * @readonly
143
174
  */
144
175
  myPrincipalId(): Promise<string>;
145
176
  /** Clone of this SDK acting on behalf of `user` (sent as
146
177
  * `x-macro-bot-for-macro-user-id`). Bot auth only — throws for user auth,
147
- * since a user token always acts as its own user. */
178
+ * since a user token always acts as its own user.
179
+ *
180
+ * @readonly
181
+ * @mcp-exclude Returns a new SDK client, which an MCP result cannot carry.
182
+ */
148
183
  requestedAs(user: User): Macro<T>;
149
184
  }
150
185
  export { type AgentActivity, type AgentActivityOptions, AgentInvocation, } from './entities/agent-sessions/activity';
151
- export type { ArchiveCause, AutoArchiveOverrides, FoldedAgentSessionLog, SessionAutoArchive, } from './entities/agent-sessions/agent-session';
186
+ export type { AgentSessionUpdate, AgentSessionUpdates, ArchiveCause, AutoArchiveOverrides, FoldedAgentSessionLog, LinkedTask, PendingToolApproval, SessionAutoArchive, } from './entities/agent-sessions/agent-session';
152
187
  export type { CodeResult } from './entities/agent-sessions/code-execution';
153
188
  export { AgentConversation, ConversationTurn, } from './entities/agent-sessions/conversation';
154
189
  export type { SessionOrigin, SessionOriginCaller, SessionOriginLineage, SessionOriginRoot, } from './entities/agent-sessions/origin';
@@ -156,22 +191,29 @@ export type { CreateReviewOptions, ReviewCalendarDraft, ReviewDraft, ReviewEmail
156
191
  export { ReviewItem, SessionReview } from './entities/agent-sessions/review';
157
192
  export { ToolApproval } from './entities/agent-sessions/tool-approval';
158
193
  export type { SessionView } from './entities/agent-sessions/view';
159
- export { Agent, type AgentOptions } from './entities/agents/agent';
194
+ export { Agent, type AgentApps, type AgentOptions, type AgentPatch, } from './entities/agents/agent';
195
+ export type { CodingAgent } from './entities/agents/namespace';
160
196
  export { UserApiKey } from './entities/api-keys/api-key';
161
197
  export { Bot, type BotOwner, type BotWebhook, type CreateBotOptions, type UpdateBotOptions, } from './entities/bots/bot';
162
198
  export { BotToken } from './entities/bots/token';
199
+ export { Canvas, type CanvasApplyOptions, type CanvasApplyResult, type CanvasBounds, type CanvasEditOptions, CanvasEditRejectedError, type CanvasEditResult, CanvasRenderImage, type CanvasRenderObject, type CanvasRenderOptions, CanvasRevisionConflictError, type CanvasScene, type CanvasSceneItem, type CanvasSceneOptions, type CanvasTextLayout, type CanvasUnavailable, } from './entities/canvases/canvas';
163
200
  export { ChannelAccessRequest } from './entities/channels/access-request';
164
201
  export { ChannelActivity } from './entities/channels/activity';
202
+ export type { MessageContext, MessageContextOptions, ReplyContext, } from './entities/channels/message';
165
203
  export { ChannelPicture } from './entities/channels/picture';
166
204
  export { ChatGeneration, ChatMessage } from './entities/chats/generation';
167
205
  export type { ConnectedAppKind, ConnectedToolResult, } from './entities/connected-apps/connected-app';
168
206
  export type { ConnectorAction, ConnectorInspection, } from './entities/connected-apps/connector';
169
207
  export type { ConnectMcpServerResponse } from './entities/connected-apps/namespace';
170
208
  export { CrmPipeline, PipelineColumn, PipelineRow, type PipelineStageRequirement, PipelineTable, PipelineView, } from './entities/crm/pipeline';
209
+ export { type CompanyImport, PipelineEntry, type PipelineField, type PipelineFieldChange, type PipelineFieldInput, type PipelineFieldInputs, type PipelineFieldTotal, type PipelineFieldValue, type PipelineImport, type PipelineImportSkip, type PipelineOptionCounts, type PipelineRecordInput, } from './entities/crm/pipeline-entry';
171
210
  export type { DatabaseQueryOptions, DatabaseQueryResult, QueryColumn, QueryResultSet, QueryStatement, QueryTableVersion, } from './entities/databases/query';
211
+ export { SAVED_QUERY_CHART_MODES, SAVED_QUERY_HEIGHT_RANGE, SAVED_QUERY_MAX_SERIES, SavedQuery, type SavedQueryChart, type SavedQueryChartMode, type SavedQueryDisplay, type SavedQueryDisplayMode, type SavedQueryView, type SaveQueryOptions, } from './entities/databases/saved-query';
172
212
  export { type DocumentEditOptions, DocumentEditRefusedError, type DocumentEditResult, EditOutcomeUnknownError, } from './entities/documents/ai-edit';
173
213
  export { DocumentAnchor } from './entities/documents/anchor';
214
+ export { DocumentChangedError, type DocumentMarkdown, type DocumentMarkdownWritten, type SetContentOptions, } from './entities/documents/markdown';
174
215
  export type { FileContent } from './entities/documents/namespace';
216
+ export { CommentQuoteNotPlacedError, type TextComment, type TextCommentOptions, } from './entities/documents/text-comment';
175
217
  export { DocumentVersion } from './entities/documents/version';
176
218
  export { DraftAttachment, type DraftOptions, type DraftSendOptions, EmailDraft, } from './entities/email/draft';
177
219
  export { EmailFilter, type EmailFilterOptions } from './entities/email/filter';
@@ -186,22 +228,33 @@ export { Harness } from './entities/harnesses/harness';
186
228
  export { DevicePairing, HarnessPairing } from './entities/harnesses/pairing';
187
229
  export { GeneratedImage, StaticImage } from './entities/images/image';
188
230
  export type { GenerateImageAspectRatio, GenerateImageOptions, } from './entities/images/namespace';
189
- export { Initiative, type InitiativeOptions, } from './entities/initiatives/initiative';
190
- export type { InitiativeSummary } from './entities/initiatives/namespace';
231
+ export { Initiative, type InitiativeActivityEntry, type InitiativeOptions, } from './entities/initiatives/initiative';
232
+ export type { InitiativeListing, InitiativeListOptions, InitiativePriority, InitiativeStatus, InitiativeSummary, } from './entities/initiatives/namespace';
191
233
  export { MeNamespace, type UpdateMeOptions, type UploadProfilePictureOptions, } from './entities/me/namespace';
192
234
  export { Meeting } from './entities/meetings/meeting';
235
+ export type { ExplicitMemory, MemoryEdit, } from './entities/memory/namespace';
193
236
  export type { TimelineOptions } from './entities/messages/thread';
194
237
  export { type MessageParent, MessageThread } from './entities/messages/thread';
238
+ export type { AgentAccessRequest, AgentWake, DisclosedSecret, SecretSelector, VerificationCode, } from './entities/passwords/item';
239
+ export { PasswordItem } from './entities/passwords/item';
240
+ export { AgentVault, PasswordNamespace } from './entities/passwords/namespace';
195
241
  export type { EntityReference } from './entities/reference';
196
242
  export type { ReferralLink } from './entities/referrals/namespace';
197
243
  export type { RoutineEventFilter, RoutineTriggerOptions, SingleRoutineTrigger, } from './entities/routines/routine';
198
244
  export { Routine, RoutineExecution, type RoutineOptions, } from './entities/routines/routine';
245
+ export { RoutineSuggestion } from './entities/routines/suggestion';
246
+ export { SavedView, type SavedViewConfig, } from './entities/saved-views/saved-view';
199
247
  export type { SearchOn, SearchOpts } from './entities/search/options';
200
248
  export type { SearchOptions, SearchPage, SearchPageOptions, SearchResult, SearchType, } from './entities/search/types';
201
249
  export { AccessRequest, EntityAccess } from './entities/sharing/access';
202
250
  export type { SharePermissionOptions } from './entities/sharing/permissions';
251
+ export { RevisionConflictError, Spreadsheet, type SpreadsheetCalculateOptions, type SpreadsheetCalculation, type SpreadsheetEdited, type SpreadsheetEditOptions, type SpreadsheetRead, type SpreadsheetReadOptions, type SpreadsheetSheet, } from './entities/spreadsheets/spreadsheet';
252
+ export type { SuggestionInput, SuggestionsReview, } from './entities/suggestions/namespace';
253
+ export { Suggestion, type SuggestionChanges, type SuggestionItem, type SuggestionWriteOutcome, } from './entities/suggestions/suggestion';
203
254
  export type { TaskSummary } from './entities/tasks/task';
204
255
  export { TeamInvite } from './entities/teams/invite';
256
+ export { ExternalProfilePicture, type ProfilePicture, } from './entities/users/profile-picture';
257
+ export type { ActivityReport } from './entities/users/user';
205
258
  export type { WebFetchOptions, WebFetchResponse, WebSearchOptions, WebSearchResult, WebSearchTopic, } from './entities/web/namespace';
206
259
  export { WhatsAppAccount } from './entities/whatsapp/account';
207
260
  export { WhatsAppChat, type WhatsAppCommunity, } from './entities/whatsapp/chat';