@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
@@ -1,4 +1,7 @@
1
+ import type { InitiativePageRow } from '../../../generated/storage/types.gen';
2
+ import { type IterationOptions } from '../../utils';
1
3
  import type { MacroClient } from '../../utils/client';
4
+ import { User } from '../users/user';
2
5
  import { Initiative, type InitiativeOptions } from './initiative';
3
6
  /** An initiative with the name and update time its listing already carries. */
4
7
  export interface InitiativeSummary {
@@ -6,21 +9,82 @@ export interface InitiativeSummary {
6
9
  name: string;
7
10
  updatedAt: string;
8
11
  }
12
+ /** An initiative's canonical Status. */
13
+ export type InitiativeStatus = 'not_started' | 'in_progress' | 'in_review' | 'completed' | 'canceled';
14
+ /** An initiative's canonical Priority. */
15
+ export type InitiativePriority = 'low' | 'medium' | 'high' | 'urgent';
16
+ /** Filters and order for {@link InitiativeNamespace.list}. */
17
+ export interface InitiativeListOptions extends IterationOptions {
18
+ /** Case-insensitive substring of the name. */
19
+ query?: string;
20
+ /** Only initiatives with this Status. */
21
+ status?: InitiativeStatus;
22
+ /** Only initiatives with this Priority. */
23
+ priority?: InitiativePriority;
24
+ /** Only initiatives assigned to this user. */
25
+ assignee?: User;
26
+ /** Only initiatives due at or after this time. */
27
+ dueAfter?: Date;
28
+ /** Only initiatives due at or before this time. */
29
+ dueBefore?: Date;
30
+ /** Order by last update (the default), name, or due date with undated last. */
31
+ sort?: 'updated' | 'name' | 'due';
32
+ /** Descending order; defaults to newest first for `updated`, ascending otherwise. */
33
+ descending?: boolean;
34
+ /** Page size, 1 through 100; defaults to 50. Iteration still covers every match. */
35
+ limit?: number;
36
+ }
37
+ /** An initiative with its canonical properties and progress, as one listing row. */
38
+ export interface InitiativeListing {
39
+ initiative: Initiative;
40
+ name: string;
41
+ updatedAt: string;
42
+ /** The caller's access. */
43
+ accessLevel: InitiativePageRow['userAccessLevel'];
44
+ status: InitiativeStatus | undefined;
45
+ priority: InitiativePriority | undefined;
46
+ /** Assigned users, independent of sharing membership. */
47
+ assignees: User[];
48
+ dueDate: string | undefined;
49
+ /** Whether the Status counts as complete. */
50
+ completed: boolean;
51
+ /** Tasks in the initiative that the caller can view. */
52
+ taskCount: number;
53
+ /** Of those, the completed ones. */
54
+ completedTaskCount: number;
55
+ }
9
56
  /**
10
- * Initiatives in the caller's workspace; find one by name with one
11
- * `summaries()` call, not `name()` on each listed handle (one request each).
57
+ * Initiatives in the caller's workspace; filter them by name, status,
58
+ * priority, assignee or due date with one `list()` iteration, which also
59
+ * carries each one's name, properties and task progress.
12
60
  *
13
- * @routing Use when grouping tasks and members into initiatives or reading an initiative's tasks; not a single task.
61
+ * @routing Use when grouping tasks and members into initiatives, finding initiatives by status, priority, assignee or due date, or reading an initiative's description, tasks or discussion; not a single task.
14
62
  */
15
63
  export declare class InitiativeNamespace {
16
64
  private readonly client;
17
65
  constructor(client: MacroClient);
18
66
  /** Construct a lazy initiative handle. */
19
67
  byId(id: string): Initiative;
20
- /** List accessible initiatives as handles; use `summaries()` for their names. */
21
- list(): Promise<Initiative[]>;
22
- /** Every accessible initiative with its name, in one request. */
68
+ /**
69
+ * Initiatives the caller can view that match every given filter, with their
70
+ * name, Status, Priority, assignees, due date and progress over the tasks the
71
+ * caller can view; most recently updated first unless `sort` says otherwise.
72
+ * Iterate with `for await`; pages load as the loop advances, and `maxItems` caps the total.
73
+ *
74
+ * @readonly
75
+ */
76
+ list(options?: InitiativeListOptions): AsyncGenerator<InitiativeListing>;
77
+ private listPages;
78
+ /**
79
+ * Every accessible initiative with its name, in one request.
80
+ *
81
+ * @readonly
82
+ */
23
83
  summaries(): Promise<InitiativeSummary[]>;
24
- /** Create an initiative. */
84
+ /**
85
+ * Create an initiative.
86
+ *
87
+ * @write
88
+ */
25
89
  create(options: InitiativeOptions): Promise<Initiative>;
26
90
  }
@@ -1,5 +1,6 @@
1
1
  import type { MacroClient } from '../../utils/client';
2
2
  import { StaticImage } from '../images/image';
3
+ import type { ProfilePicture } from '../users/profile-picture';
3
4
  /** How to store an uploaded profile picture. */
4
5
  export interface UploadProfilePictureOptions {
5
6
  /** File name, such as `avatar.png`. */
@@ -11,13 +12,18 @@ export interface UploadProfilePictureOptions {
11
12
  export interface UpdateMeOptions {
12
13
  /** Display name. The first word becomes the first name. */
13
14
  name?: string;
14
- /** An image from {@link MeNamespace.uploadProfilePicture}. */
15
+ /**
16
+ * An image from {@link MeNamespace.uploadProfilePicture}. To switch back to
17
+ * an earlier upload without uploading again, pass its handle again, or
18
+ * `macro.images.byId(savedId)`. Setting is throttled to once a second per
19
+ * user; a faster call fails with 429.
20
+ */
15
21
  profilePicture?: StaticImage;
16
22
  }
17
23
  /**
18
24
  * The authenticated user's own profile.
19
25
  *
20
- * @routing Use when changing the user's own name or profile picture; not looking up other people (`macro.users`).
26
+ * @routing Use when reading who the user is or changing their own name or profile picture; not looking up other people (`macro.users`).
21
27
  */
22
28
  export declare class MeNamespace {
23
29
  private readonly client;
@@ -25,9 +31,23 @@ export declare class MeNamespace {
25
31
  /**
26
32
  * Upload an image to use as your profile picture. This only stores it; pass
27
33
  * the result to {@link MeNamespace.update} to start using it. Pictures can be
28
- * at most 16 MB, and each user can start 20 uploads an hour.
34
+ * at most 16 MB, and each user can start 20 uploads an hour (more fail with
35
+ * 429). Keep the returned image, or its `id`, to switch back later.
36
+ *
37
+ * @write
38
+ * @mcp-exclude Takes raw image bytes; MCP calls carry JSON only.
29
39
  */
30
40
  uploadProfilePicture(data: Blob | Uint8Array<ArrayBuffer>, options: UploadProfilePictureOptions): Promise<StaticImage>;
41
+ /**
42
+ * Your current profile picture, read fresh from the auth service.
43
+ *
44
+ * @returns A `StaticImage` for a picture set through Macro (usable with
45
+ * {@link MeNamespace.update}), an `ExternalProfilePicture` for an older
46
+ * picture stored as a bare URL, or `undefined` if you have none.
47
+ *
48
+ * @readonly
49
+ */
50
+ profilePicture(): Promise<ProfilePicture | undefined>;
31
51
  /**
32
52
  * Set your display name and profile picture. Agents should do this after
33
53
  * signing in, so teammates can tell who they are working with.
@@ -38,6 +58,11 @@ export declare class MeNamespace {
38
58
  * contentType: 'image/png',
39
59
  * });
40
60
  * await macro.me.update({ name: 'Research Agent', profilePicture: image });
61
+ * // Later, switch back to it from its saved id:
62
+ * await macro.me.update({ profilePicture: macro.images.byId(savedId) });
63
+ *
64
+ * @write
65
+ * @idempotent
41
66
  */
42
67
  update(options: UpdateMeOptions): Promise<void>;
43
68
  }
@@ -7,9 +7,20 @@ import { MacroEntity } from '../entity';
7
7
  import type { User } from '../users/user';
8
8
  /** A meeting's schedule and invitation link. */
9
9
  export declare class Meeting extends MacroEntity<MeetingRecord> {
10
- /** Join this meeting as the current account; always send a program join body. */
10
+ /**
11
+ * Join this meeting as the current account, always sending a program join
12
+ * body; refused to an agent's program (ExecuteCode, a routine).
13
+ *
14
+ * @write
15
+ * @mcp-exclude Returns a live call connection; MCP calls carry JSON only.
16
+ */
11
17
  join(opts?: JoinOptions): Promise<CallConnection>;
12
- /** Join the link as a named guest. */
18
+ /**
19
+ * Join the link as a named guest.
20
+ *
21
+ * @write
22
+ * @mcp-exclude Returns a live call connection; MCP calls carry JSON only.
23
+ */
13
24
  joinAsGuest(name: string): Promise<CallConnection>;
14
25
  private lookupToken?;
15
26
  private constructor();
@@ -28,16 +39,43 @@ export declare class Meeting extends MacroEntity<MeetingRecord> {
28
39
  readonly channel: () => Promise<Channel | undefined>;
29
40
  /** Associated call record. */
30
41
  readonly call: () => Promise<CallRecord | undefined>;
31
- /** Update schedule or title. */
42
+ /**
43
+ * Update schedule or title.
44
+ *
45
+ * @write
46
+ * @idempotent
47
+ */
32
48
  update(options: UpdateMeetingRequest): Promise<void>;
33
- /** Cancel this meeting. */
49
+ /**
50
+ * Cancel this meeting.
51
+ *
52
+ * @destructive
53
+ * @idempotent
54
+ */
34
55
  cancel(): Promise<void>;
35
- /** Whether the caller can send invitations. */
56
+ /**
57
+ * Whether the caller can send invitations.
58
+ *
59
+ * @readonly
60
+ */
36
61
  invitePermissions(): Promise<import("../../../generated/storage").MeetingInvitePermissions>;
37
- /** Invite an email address. */
62
+ /**
63
+ * Invite an email address.
64
+ *
65
+ * @destructive
66
+ * @openworld
67
+ */
38
68
  invite(email: string): Promise<void>;
39
- /** Invite Macro users. */
69
+ /**
70
+ * Invite Macro users.
71
+ *
72
+ * @write
73
+ */
40
74
  inviteUsers(users: User[]): Promise<void>;
41
- /** Shareable meeting link. */
75
+ /**
76
+ * Shareable meeting link.
77
+ *
78
+ * @readonly
79
+ */
42
80
  webUrl(): Promise<string>;
43
81
  }
@@ -11,12 +11,28 @@ export declare class MeetingNamespace {
11
11
  constructor(client: MacroClient);
12
12
  /** Construct a handle to one of the caller's newest 100 standalone meetings. Use lookup for invitations. */
13
13
  byId(id: string): Meeting;
14
- /** Create a meeting. */
14
+ /**
15
+ * Create a meeting.
16
+ *
17
+ * @write
18
+ */
15
19
  create(options: Omit<CreateMeetingRequest, 'preparationId'>): Promise<Meeting>;
16
- /** List the caller's newest 100 standalone meetings. */
20
+ /**
21
+ * List the caller's newest 100 standalone meetings.
22
+ *
23
+ * @readonly
24
+ */
17
25
  list(): Promise<Meeting[]>;
18
- /** List active meetings. */
26
+ /**
27
+ * List active meetings.
28
+ *
29
+ * @readonly
30
+ */
19
31
  active(): Promise<Meeting[]>;
20
- /** Resolve a meeting's invitation token. */
32
+ /**
33
+ * Resolve a meeting's invitation token.
34
+ *
35
+ * @readonly
36
+ */
21
37
  lookup(token: string): Promise<Meeting>;
22
38
  }
@@ -0,0 +1,49 @@
1
+ import type { ExplicitMemory, MemoryEdit } from '../../../generated/cognition/types.gen';
2
+ import type { MacroClient } from '../../utils/client';
3
+ export type { ExplicitMemory, MemoryEdit };
4
+ /**
5
+ * The acting user's private explicit memory: the preferences and facts they
6
+ * asked AI to remember, one per line.
7
+ *
8
+ * @routing Use when the user asks to remember, correct or forget something, or to see what AI remembers about them; not what someone worked on (`macro.activity`, `User.activity`).
9
+ *
10
+ * @agent Change memory only when the user explicitly asks to remember,
11
+ * correct or forget something; never save inferred preferences. Read first:
12
+ * edits address one-based lines and must carry the revision you read. A
13
+ * stale revision fails with 409 and changes nothing; read again and reconcile
14
+ * before retrying. Private or sensitive additions are rejected with 422.
15
+ */
16
+ export declare class MemoryNamespace {
17
+ private readonly client;
18
+ constructor(client: MacroClient);
19
+ /**
20
+ * Read the acting user's explicit memory and its revision; `content` is
21
+ * newline-separated, and edits address its one-based lines.
22
+ *
23
+ * @example
24
+ * const memory = await macro.memory.read();
25
+ * const lines = memory.content.split('\n');
26
+ *
27
+ * @readonly
28
+ */
29
+ read(): Promise<ExplicitMemory>;
30
+ /**
31
+ * Apply one line edit at the `revision` you read, only when the user asked
32
+ * to remember, correct or forget something; returns the new memory and
33
+ * revision.
34
+ *
35
+ * A stale revision fails with 409 and changes nothing: read again before
36
+ * retrying. Insert at `lines.length + 1` to append.
37
+ *
38
+ * @example
39
+ * const memory = await macro.memory.read();
40
+ * const lines = memory.content ? memory.content.split('\n') : [];
41
+ * await macro.memory.edit(
42
+ * { action: 'insert', line: lines.length + 1, content: 'Prefers metric units' },
43
+ * memory.revision,
44
+ * );
45
+ *
46
+ * @destructive
47
+ */
48
+ edit(edit: MemoryEdit, revision: number): Promise<ExplicitMemory>;
49
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { Message as MessageRecord, ThreadState } from '../../../generated/storage/types.gen';
2
+ import { type RichMessage } from '../../mentions';
3
+ import type { MacroClient } from '../../utils/client';
4
+ import { MacroEntity } from '../entity';
5
+ import { User } from '../users/user';
6
+ /** The CRM record or initiative a discussion hangs off. */
7
+ export interface DiscussionParent {
8
+ type: 'crm_company' | 'crm_contact' | 'initiative';
9
+ id: string;
10
+ }
11
+ /** One of a discussion's comment threads: its state and its comments. */
12
+ export interface DiscussionThread {
13
+ /** The thread state: root id, resolved flag, owner, timestamps. */
14
+ thread: ThreadState;
15
+ /** The thread's comments, root first, then replies oldest first. */
16
+ comments: DiscussionComment[];
17
+ }
18
+ /**
19
+ * A comment on a CRM company, CRM contact or initiative: a message whose
20
+ * parent is that record, addressed by the record and the message UUID. Its
21
+ * record and mutations are the ones document comments and channel messages use.
22
+ */
23
+ export declare class DiscussionComment extends MacroEntity<MessageRecord> {
24
+ /** The company, contact or initiative this comment belongs to. */
25
+ readonly parent: DiscussionParent;
26
+ private constructor();
27
+ private get path();
28
+ protected fetch(): Promise<MessageRecord>;
29
+ /** A handle to a comment by id. Fields load on first access. */
30
+ static byId(client: MacroClient, parent: DiscussionParent, id: string): DiscussionComment;
31
+ /** Build a comment from a message record (pre-seeded, no fetch). */
32
+ static from(client: MacroClient, parent: DiscussionParent, record: MessageRecord): DiscussionComment;
33
+ /** The comment's text (markdown). */
34
+ readonly text: () => Promise<string>;
35
+ /** When the comment was created. */
36
+ readonly createdAt: () => Promise<string>;
37
+ /** When the comment was last updated. */
38
+ readonly updatedAt: () => Promise<string>;
39
+ /** When the comment was deleted, if it has been. */
40
+ readonly deletedAt: () => Promise<string | undefined>;
41
+ /**
42
+ * The id of the thread this comment belongs to: its root, or itself for a root.
43
+ *
44
+ * @readonly
45
+ */
46
+ threadId(): Promise<string>;
47
+ /**
48
+ * The user who wrote this comment.
49
+ *
50
+ * @readonly
51
+ */
52
+ author(): Promise<User>;
53
+ /**
54
+ * Reply in this comment's thread.
55
+ *
56
+ * @write
57
+ */
58
+ reply(body: string | RichMessage): Promise<DiscussionComment>;
59
+ /**
60
+ * Replace the comment's text. Only its author may.
61
+ *
62
+ * @param body - Plain text, or a rich body composed with {@link msg}.
63
+ *
64
+ * @write
65
+ * @idempotent
66
+ */
67
+ edit(body: string | RichMessage): Promise<this>;
68
+ /**
69
+ * Delete this comment. Deleting a thread's root keeps its replies.
70
+ *
71
+ * @destructive
72
+ * @idempotent
73
+ */
74
+ delete(): Promise<void>;
75
+ }
76
+ /** A discussion's live comment threads, each with its comments, newest thread first. */
77
+ export declare function listDiscussionThreads(client: MacroClient, parent: DiscussionParent): Promise<DiscussionThread[]>;
78
+ /**
79
+ * Post a comment in a discussion: a new thread, or a reply when `threadId`
80
+ * (the thread's root comment id) is given.
81
+ */
82
+ export declare function postDiscussionComment(client: MacroClient, parent: DiscussionParent, body: string | RichMessage, opts?: {
83
+ threadId?: string;
84
+ }): Promise<DiscussionComment>;
@@ -4,15 +4,16 @@ import type { CallRecord } from '../calls/call-record';
4
4
  import type { CallMessage } from '../calls/message';
5
5
  import type { Channel } from '../channels/channel';
6
6
  import type { Message } from '../channels/message';
7
- import type { CrmComment } from '../crm/comment';
8
7
  import type { Company } from '../crm/company';
9
8
  import type { Contact } from '../crm/contact';
10
9
  import type { Comment } from '../documents/comment';
11
10
  import type { Document } from '../documents/document';
12
11
  import { MacroEntity } from '../entity';
12
+ import type { Initiative } from '../initiatives/initiative';
13
13
  import { User } from '../users/user';
14
+ import type { DiscussionComment } from './discussion';
14
15
  /** A message handle accepted by a mixed timeline selector. */
15
- export type TimelineMessage = Message | Comment | CrmComment | CallMessage;
16
+ export type TimelineMessage = Message | Comment | DiscussionComment | CallMessage;
16
17
  /** Timeline selection with typed message references and camel case options. */
17
18
  export interface TimelineOptions<TMessage extends TimelineMessage = TimelineMessage> {
18
19
  /** Opaque continuation cursor from a previous page. */
@@ -47,6 +48,9 @@ export type MessageParent = {
47
48
  } | {
48
49
  type: 'crm_contact';
49
50
  entity: Contact;
51
+ } | {
52
+ type: 'initiative';
53
+ entity: Initiative;
50
54
  } | {
51
55
  type: 'call';
52
56
  entity: CallRecord;
@@ -57,7 +61,7 @@ export declare class MessageThread extends MacroEntity<ThreadState> {
57
61
  readonly parent: MessageParent;
58
62
  /** Serialize identity with its owning resource. */
59
63
  toJSON(): {
60
- parentType: "call" | "channel" | "document" | "crm_company" | "crm_contact";
64
+ parentType: "call" | "channel" | "document" | "crm_company" | "crm_contact" | "initiative";
61
65
  parentId: string;
62
66
  id: string;
63
67
  detail?: ThreadState | undefined;
@@ -69,13 +73,23 @@ export declare class MessageThread extends MacroEntity<ThreadState> {
69
73
  protected fetch(): Promise<ThreadState>;
70
74
  /** Whether the thread is resolved. */
71
75
  readonly resolved: () => Promise<boolean>;
72
- /** Resolve the thread or detach its annotation anchor. */
76
+ /**
77
+ * Resolve the thread or detach its annotation anchor.
78
+ *
79
+ * @write
80
+ * @idempotent
81
+ */
73
82
  update(options: {
74
83
  resolved?: boolean;
75
84
  detachAnchor?: boolean;
76
85
  nonce?: string;
77
86
  }): Promise<void>;
78
- /** Delete the entire thread, including replies. */
87
+ /**
88
+ * Delete the entire thread, including replies.
89
+ *
90
+ * @destructive
91
+ * @idempotent
92
+ */
79
93
  delete(nonce?: string): Promise<void>;
80
94
  }
81
95
  /** A bounded mixed message/activity page with typed message handles. */
@@ -12,21 +12,55 @@ export declare class NotificationNamespace {
12
12
  constructor(client: MacroClient);
13
13
  /** A handle to a notification by id. */
14
14
  byId(id: string): Notification;
15
- /** The viewer's notification feed, most recent first, auto-paginated. */
15
+ /**
16
+ * The viewer's notification feed, most recent first, auto-paginated; `maxItems` caps the total.
17
+ *
18
+ * @readonly
19
+ */
16
20
  list(opts?: {
17
21
  pageSize?: number;
22
+ maxItems?: number;
18
23
  }): AsyncGenerator<Notification>;
19
- /** Mark a batch of notifications as seen. */
24
+ /**
25
+ * Mark a batch of notifications as seen.
26
+ *
27
+ * @write
28
+ * @idempotent
29
+ */
20
30
  markSeen(ids: string[]): Promise<void>;
21
- /** Mark a batch of notifications as done. */
31
+ /**
32
+ * Mark a batch of notifications as done.
33
+ *
34
+ * @write
35
+ * @idempotent
36
+ */
22
37
  markDone(ids: string[]): Promise<void>;
23
- /** Delete a batch of notifications. */
38
+ /**
39
+ * Delete a batch of notifications.
40
+ *
41
+ * @destructive
42
+ * @idempotent
43
+ */
24
44
  delete(ids: string[]): Promise<void>;
25
- /** The viewer's notification type preferences (disabled types). */
45
+ /**
46
+ * The viewer's notification type preferences (disabled types).
47
+ *
48
+ * @readonly
49
+ */
26
50
  preferences(): Promise<NotificationTypePreferences>;
27
- /** Re-enable delivery of a notification type. */
51
+ /**
52
+ * Re-enable delivery of a notification type.
53
+ *
54
+ * @write
55
+ * @idempotent
56
+ */
28
57
  enableType(type: NotificationType): Promise<void>;
29
- /** Disable delivery of a notification type. */
58
+ /**
59
+ * Disable delivery of a notification type.
60
+ *
61
+ * @write
62
+ * @idempotent
63
+ */
30
64
  disableType(type: NotificationType): Promise<void>;
31
65
  }
32
66
  export {};
@@ -12,10 +12,11 @@ export declare class Notification extends MacroEntity<NotificationDetail> {
12
12
  static byId(client: MacroClient, id: string): Notification;
13
13
  /** Build a notification from a list-endpoint record (pre-seeded, no fetch). */
14
14
  static from(client: MacroClient, data: NotificationDetail): Notification;
15
- /** The viewer's notification feed, most recent first, auto-paginated. */
15
+ /** The viewer's notification feed, most recent first, auto-paginated; `maxItems` caps the total. */
16
16
  static list(client: MacroClient, opts?: {
17
17
  pageSize?: number;
18
18
  states?: NotificationState[];
19
+ maxItems?: number;
19
20
  }): AsyncGenerator<Notification>;
20
21
  /** The notification event type (e.g. `channel_mention`). */
21
22
  readonly type: () => Promise<string>;
@@ -39,15 +40,39 @@ export declare class Notification extends MacroEntity<NotificationDetail> {
39
40
  readonly sender: () => Promise<User | undefined>;
40
41
  /** The typed notification payload (tagged by event type). */
41
42
  readonly metadata: () => Promise<import("../../../generated/notification").NotifEvent>;
42
- /** Whether the notification is acknowledged (seen or done). */
43
+ /**
44
+ * Whether the notification is acknowledged (seen or done).
45
+ *
46
+ * @readonly
47
+ */
43
48
  seen(): Promise<boolean>;
44
- /** Mark the notification as seen. */
49
+ /**
50
+ * Mark the notification as seen.
51
+ *
52
+ * @write
53
+ * @idempotent
54
+ */
45
55
  markSeen(): Promise<void>;
46
- /** Mark the notification as done. */
56
+ /**
57
+ * Mark the notification as done.
58
+ *
59
+ * @write
60
+ * @idempotent
61
+ */
47
62
  markDone(): Promise<void>;
48
- /** Move the notification back to not-done. */
63
+ /**
64
+ * Move the notification back to not-done.
65
+ *
66
+ * @write
67
+ * @idempotent
68
+ */
49
69
  markUndone(): Promise<void>;
50
- /** Delete the notification. */
70
+ /**
71
+ * Delete the notification.
72
+ *
73
+ * @destructive
74
+ * @idempotent
75
+ */
51
76
  delete(): Promise<void>;
52
77
  }
53
78
  export {};