@macro-inc/sdk 0.4.0 → 0.5.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 (193) hide show
  1. package/CALLS.md +82 -0
  2. package/README.md +176 -7
  3. package/dist/chunk-2IVGAIGQ.js +80 -0
  4. package/dist/{chunk-PTX2RV2N.js → chunk-3SW6QVDV.js} +33 -0
  5. package/dist/{chunk-XFA7NCJ5.js → chunk-GT5EUYOR.js} +13 -15
  6. package/dist/{chunk-ZLBDES7U.js → chunk-HIW6KU2I.js} +490 -4
  7. package/dist/{chunk-AZJUIUIV.js → chunk-J2VK3NOR.js} +56 -0
  8. package/dist/{chunk-PZPTJI6F.js → chunk-UVJLWLSJ.js} +41 -2
  9. package/dist/generated/agent-fold/index.d.ts +8 -6
  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 +17 -1
  13. package/dist/generated/agent-harness/types.gen.d.ts +188 -3
  14. package/dist/generated/auth/index.js +1 -1
  15. package/dist/generated/auth/sdk.gen.d.ts +13 -15
  16. package/dist/generated/auth/types.gen.d.ts +36 -17
  17. package/dist/generated/cognition/index.d.ts +1 -1
  18. package/dist/generated/cognition/index.js +1 -1
  19. package/dist/generated/cognition/sdk.gen.d.ts +38 -1
  20. package/dist/generated/cognition/types.gen.d.ts +473 -4
  21. package/dist/generated/connection/types.gen.d.ts +1 -1
  22. package/dist/generated/notification/index.d.ts +1 -1
  23. package/dist/generated/notification/types.gen.d.ts +36 -1
  24. package/dist/generated/scheduled-action/index.d.ts +1 -1
  25. package/dist/generated/scheduled-action/index.js +1 -1
  26. package/dist/generated/scheduled-action/sdk.gen.d.ts +17 -2
  27. package/dist/generated/scheduled-action/types.gen.d.ts +642 -104
  28. package/dist/generated/storage/index.d.ts +1 -1
  29. package/dist/generated/storage/index.js +1 -1
  30. package/dist/generated/storage/sdk.gen.d.ts +204 -5
  31. package/dist/generated/storage/types.gen.d.ts +3969 -374
  32. package/dist/src/calls/browser.d.ts +14 -0
  33. package/dist/src/calls/browser.js +102 -0
  34. package/dist/src/calls/common.d.ts +18 -0
  35. package/dist/src/calls/node.d.ts +24 -0
  36. package/dist/src/calls/node.js +145 -0
  37. package/dist/src/calls/telemetry.d.ts +5 -0
  38. package/dist/src/entities/account-managers/grant.d.ts +28 -5
  39. package/dist/src/entities/account-managers/namespace.d.ts +15 -3
  40. package/dist/src/entities/activity/entity.d.ts +7 -0
  41. package/dist/src/entities/activity/namespace.d.ts +58 -0
  42. package/dist/src/entities/activity/namespace.test.d.ts +1 -0
  43. package/dist/src/entities/agent-sessions/activity.d.ts +10 -2
  44. package/dist/src/entities/agent-sessions/agent-session.d.ts +193 -18
  45. package/dist/src/entities/agent-sessions/code-execution.d.ts +15 -3
  46. package/dist/src/entities/agent-sessions/conversation.d.ts +46 -9
  47. package/dist/src/entities/agent-sessions/namespace.d.ts +71 -16
  48. package/dist/src/entities/agent-sessions/origin.d.ts +1 -1
  49. package/dist/src/entities/agent-sessions/queued-action.d.ts +17 -3
  50. package/dist/src/entities/agent-sessions/review.d.ts +55 -4
  51. package/dist/src/entities/agent-sessions/tool-approval.d.ts +5 -1
  52. package/dist/src/entities/agents/agent.d.ts +98 -3
  53. package/dist/src/entities/agents/namespace.d.ts +52 -8
  54. package/dist/src/entities/ai/namespace.d.ts +9 -1
  55. package/dist/src/entities/api-keys/api-key.d.ts +6 -1
  56. package/dist/src/entities/api-keys/namespace.d.ts +15 -3
  57. package/dist/src/entities/bots/bot.d.ts +38 -6
  58. package/dist/src/entities/bots/namespace.d.ts +13 -1
  59. package/dist/src/entities/bots/token.d.ts +6 -1
  60. package/dist/src/entities/calendar/booking-link.d.ts +7 -1
  61. package/dist/src/entities/calendar/booking-namespace.d.ts +13 -0
  62. package/dist/src/entities/calendar/booking.d.ts +15 -0
  63. package/dist/src/entities/calendar/calendar.d.ts +7 -1
  64. package/dist/src/entities/calendar/event.d.ts +59 -9
  65. package/dist/src/entities/calendar/namespace.d.ts +88 -10
  66. package/dist/src/entities/calendar/replacement.d.ts +19 -3
  67. package/dist/src/entities/calls/call-record.d.ts +90 -14
  68. package/dist/src/entities/calls/connection.d.ts +7 -1
  69. package/dist/src/entities/calls/message.d.ts +27 -5
  70. package/dist/src/entities/calls/namespace.d.ts +15 -3
  71. package/dist/src/entities/canvases/canvas.d.ts +324 -0
  72. package/dist/src/entities/channels/access-request.d.ts +10 -2
  73. package/dist/src/entities/channels/activity.d.ts +20 -4
  74. package/dist/src/entities/channels/channel.d.ts +130 -23
  75. package/dist/src/entities/channels/labels.d.ts +41 -7
  76. package/dist/src/entities/channels/message.d.ts +41 -7
  77. package/dist/src/entities/channels/namespace.d.ts +28 -3
  78. package/dist/src/entities/channels/post.test.d.ts +1 -0
  79. package/dist/src/entities/channels/thread.d.ts +19 -3
  80. package/dist/src/entities/chats/chat.d.ts +56 -6
  81. package/dist/src/entities/chats/generation.d.ts +11 -2
  82. package/dist/src/entities/chats/namespace.d.ts +10 -2
  83. package/dist/src/entities/connected-apps/connected-app.d.ts +14 -1
  84. package/dist/src/entities/connected-apps/connector.d.ts +3 -0
  85. package/dist/src/entities/connected-apps/namespace.d.ts +16 -0
  86. package/dist/src/entities/crm/company.d.ts +63 -15
  87. package/dist/src/entities/crm/contact.d.ts +60 -13
  88. package/dist/src/entities/crm/namespace.d.ts +85 -11
  89. package/dist/src/entities/crm/pipeline-entry.d.ts +102 -0
  90. package/dist/src/entities/crm/pipeline.d.ts +271 -27
  91. package/dist/src/entities/crm/pipelines.d.ts +39 -2
  92. package/dist/src/entities/databases/column.d.ts +54 -7
  93. package/dist/src/entities/databases/database.d.ts +126 -12
  94. package/dist/src/entities/databases/namespace.d.ts +16 -4
  95. package/dist/src/entities/databases/row.d.ts +2 -0
  96. package/dist/src/entities/databases/saved-query.d.ts +145 -0
  97. package/dist/src/entities/databases/table.d.ts +64 -10
  98. package/dist/src/entities/databases/view.d.ts +27 -5
  99. package/dist/src/entities/databases/webhook.d.ts +8 -1
  100. package/dist/src/entities/documents/ai-edit.d.ts +2 -0
  101. package/dist/src/entities/documents/anchor.d.ts +12 -2
  102. package/dist/src/entities/documents/comment.d.ts +29 -5
  103. package/dist/src/entities/documents/document.d.ts +243 -20
  104. package/dist/src/entities/documents/markdown.d.ts +25 -0
  105. package/dist/src/entities/documents/namespace.d.ts +132 -13
  106. package/dist/src/entities/documents/skills.test.d.ts +1 -0
  107. package/dist/src/entities/documents/system-skill.d.ts +21 -1
  108. package/dist/src/entities/documents/text-comment.d.ts +41 -0
  109. package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
  110. package/dist/src/entities/documents/version.d.ts +5 -1
  111. package/dist/src/entities/email/attachment.d.ts +3 -0
  112. package/dist/src/entities/email/draft.d.ts +61 -9
  113. package/dist/src/entities/email/filter.d.ts +12 -2
  114. package/dist/src/entities/email/label.d.ts +7 -1
  115. package/dist/src/entities/email/link.d.ts +5 -1
  116. package/dist/src/entities/email/message.d.ts +55 -8
  117. package/dist/src/entities/email/namespace.d.ts +127 -21
  118. package/dist/src/entities/email/thread.d.ts +99 -16
  119. package/dist/src/entities/entity-mentions/mention.d.ts +6 -1
  120. package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
  121. package/dist/src/entities/entity.d.ts +56 -6
  122. package/dist/src/entities/external-chat/chat.d.ts +62 -11
  123. package/dist/src/entities/external-chat/message.d.ts +1 -1
  124. package/dist/src/entities/external-chat/namespace.d.ts +5 -1
  125. package/dist/src/entities/external-chat/send.d.ts +10 -2
  126. package/dist/src/entities/favorites/namespace.d.ts +20 -3
  127. package/dist/src/entities/foreign/foreign-entity.d.ts +5 -1
  128. package/dist/src/entities/foreign/namespace.d.ts +4 -0
  129. package/dist/src/entities/forms/form.d.ts +71 -13
  130. package/dist/src/entities/forms/namespace.d.ts +10 -2
  131. package/dist/src/entities/forms/question.d.ts +35 -7
  132. package/dist/src/entities/forms/response.d.ts +25 -5
  133. package/dist/src/entities/forms/section.d.ts +15 -3
  134. package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
  135. package/dist/src/entities/github-pull-requests/pull-request.d.ts +15 -3
  136. package/dist/src/entities/harnesses/harness.d.ts +51 -3
  137. package/dist/src/entities/harnesses/namespace.d.ts +53 -7
  138. package/dist/src/entities/harnesses/pairing.d.ts +12 -2
  139. package/dist/src/entities/images/image.d.ts +16 -5
  140. package/dist/src/entities/images/namespace.d.ts +8 -1
  141. package/dist/src/entities/initiatives/initiative.d.ts +117 -3
  142. package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
  143. package/dist/src/entities/initiatives/namespace.d.ts +69 -7
  144. package/dist/src/entities/me/namespace.d.ts +27 -2
  145. package/dist/src/entities/meetings/meeting.d.ts +45 -8
  146. package/dist/src/entities/meetings/namespace.d.ts +20 -4
  147. package/dist/src/entities/memory/namespace.d.ts +49 -0
  148. package/dist/src/entities/memory/namespace.test.d.ts +1 -0
  149. package/dist/src/entities/messages/discussion.d.ts +84 -0
  150. package/dist/src/entities/messages/thread.d.ts +19 -5
  151. package/dist/src/entities/notifications/namespace.d.ts +40 -7
  152. package/dist/src/entities/notifications/notification.d.ts +29 -5
  153. package/dist/src/entities/pins/namespace.d.ts +23 -4
  154. package/dist/src/entities/projects/namespace.d.ts +29 -0
  155. package/dist/src/entities/projects/project.d.ts +47 -6
  156. package/dist/src/entities/properties/namespace.d.ts +67 -11
  157. package/dist/src/entities/properties/namespace.test.d.ts +1 -0
  158. package/dist/src/entities/properties/property-definition.d.ts +30 -5
  159. package/dist/src/entities/properties/property-option.d.ts +14 -2
  160. package/dist/src/entities/referrals/namespace.d.ts +8 -1
  161. package/dist/src/entities/routines/namespace.d.ts +128 -7
  162. package/dist/src/entities/routines/routine.d.ts +111 -25
  163. package/dist/src/entities/saved-views/namespace.d.ts +57 -0
  164. package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
  165. package/dist/src/entities/search/namespace.d.ts +5 -1
  166. package/dist/src/entities/sharing/access.d.ts +50 -9
  167. package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
  168. package/dist/src/entities/tasks/namespace.d.ts +13 -1
  169. package/dist/src/entities/tasks/task.d.ts +7 -1
  170. package/dist/src/entities/teams/invite.d.ts +3 -0
  171. package/dist/src/entities/teams/namespace.d.ts +10 -2
  172. package/dist/src/entities/teams/team.d.ts +7 -0
  173. package/dist/src/entities/unfurls/namespace.d.ts +12 -2
  174. package/dist/src/entities/users/namespace.d.ts +19 -1
  175. package/dist/src/entities/users/profile-picture.d.ts +29 -0
  176. package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
  177. package/dist/src/entities/users/user.d.ts +52 -1
  178. package/dist/src/entities/web/namespace.d.ts +6 -0
  179. package/dist/src/entities/webhooks/namespace.d.ts +5 -0
  180. package/dist/src/entities/webhooks/webhook.d.ts +47 -7
  181. package/dist/src/entities/whatsapp/account.d.ts +5 -1
  182. package/dist/src/entities/whatsapp/chat.d.ts +9 -1
  183. package/dist/src/entities/whatsapp/namespace.d.ts +7 -1
  184. package/dist/src/entities/workspace/namespace.d.ts +7 -1
  185. package/dist/src/entities/workspace/query.d.ts +5 -1
  186. package/dist/src/events/hydrate/user.d.ts +14 -0
  187. package/dist/src/events/receiver.d.ts +2 -0
  188. package/dist/src/events/types.d.ts +2 -1
  189. package/dist/src/macro.d.ts +33 -5
  190. package/dist/src/macro.js +15635 -10132
  191. package/dist/src/utils/lazy.d.ts +7 -1
  192. package/package.json +32 -5
  193. package/dist/src/entities/crm/comment.d.ts +0 -64
@@ -33,24 +33,58 @@ export declare class Message extends FavoritableEntity<MessageRecord> {
33
33
  readonly editedAt: () => Promise<string | undefined>;
34
34
  /** When the message was last updated. */
35
35
  readonly updatedAt: () => Promise<string>;
36
- /** The user who sent this message. */
36
+ /**
37
+ * The user who sent this message.
38
+ *
39
+ * @readonly
40
+ */
37
41
  author(): Promise<User>;
38
- /** The channel this message is in. */
42
+ /**
43
+ * The channel this message is in.
44
+ *
45
+ * @readonly
46
+ */
39
47
  channel(): Channel;
40
- /** The thread rooted at this message. */
48
+ /**
49
+ * The thread rooted at this message.
50
+ *
51
+ * @readonly
52
+ */
41
53
  thread(): Thread;
42
- /** Add an emoji reaction to this message. */
54
+ /**
55
+ * Add an emoji reaction to this message.
56
+ *
57
+ * @write
58
+ * @idempotent
59
+ */
43
60
  react(emoji: string): Promise<this>;
44
- /** Remove one of your emoji reactions from this message. */
61
+ /**
62
+ * Remove one of your emoji reactions from this message.
63
+ *
64
+ * @write
65
+ * @idempotent
66
+ */
45
67
  unreact(emoji: string): Promise<this>;
46
68
  /**
47
69
  * Replace this message's body.
48
70
  *
49
71
  * @param body - Plain text, or a rich body composed with {@link msg}.
72
+ *
73
+ * @destructive
74
+ * @idempotent
50
75
  */
51
76
  edit(body: string | RichMessage): Promise<this>;
52
- /** Delete this message. */
77
+ /**
78
+ * Delete this message.
79
+ *
80
+ * @destructive
81
+ * @idempotent
82
+ */
53
83
  delete(): Promise<void>;
54
- /** Post a reply in this message's thread. */
84
+ /**
85
+ * Post a reply in this message's thread.
86
+ *
87
+ * @write
88
+ */
55
89
  reply(body: string | RichMessage): Promise<Message>;
56
90
  }
@@ -20,16 +20,37 @@ import { ChannelLabelsNamespace } from './labels';
20
20
  */
21
21
  export declare class ChannelNamespace {
22
22
  private readonly client;
23
- /** Recent channel activity, with channel and user handles. */
23
+ /**
24
+ * Recent channel activity, with channel and user handles.
25
+ *
26
+ * @readonly
27
+ */
24
28
  activity(): Promise<ChannelActivity[]>;
25
29
  /** Team-shared labels that group channels in the Chat sidebar. */
26
30
  readonly labels: ChannelLabelsNamespace;
27
31
  constructor(client: MacroClient);
28
32
  byId(id: string): Channel;
33
+ /**
34
+ * Open (creating if needed) the user's 1:1 direct message with one person.
35
+ * For several people, use {@link private}.
36
+ *
37
+ * @write
38
+ * @idempotent
39
+ */
29
40
  dm(recipient: User): Promise<Channel>;
30
- /** Open (creating if needed) the private group channel with a set of users. */
41
+ /**
42
+ * Open (creating if needed) the group direct message with exactly these
43
+ * people, excluding the user. For one person, use {@link dm}.
44
+ *
45
+ * @write
46
+ * @idempotent
47
+ */
31
48
  private(recipients: User[]): Promise<Channel>;
32
- /** Create a channel. The caller becomes the owner. */
49
+ /**
50
+ * Create a channel. The caller becomes the owner.
51
+ *
52
+ * @write
53
+ */
33
54
  create(opts: {
34
55
  type: ChannelType;
35
56
  name?: string;
@@ -41,11 +62,15 @@ export declare class ChannelNamespace {
41
62
  /**
42
63
  * Every channel the authenticated user is a member of, auto-paginated.
43
64
  * Iterate with `for await`; collect with `Array.fromAsync`.
65
+ *
66
+ * @readonly
44
67
  */
45
68
  list(): AsyncGenerator<Channel>;
46
69
  /**
47
70
  * Search channels by name (case-insensitive substring match over every
48
71
  * channel the user is a member of) or by content (server-side unified search).
72
+ *
73
+ * @readonly
49
74
  */
50
75
  search(query: string, opts?: SearchOpts): AsyncGenerator<Channel>;
51
76
  private records;
@@ -0,0 +1 @@
1
+ export {};
@@ -16,16 +16,30 @@ export declare class Thread {
16
16
  constructor(client: MacroClient, channelId: string,
17
17
  /** The id of the message this thread hangs off. */
18
18
  rootId: string);
19
+ /** A handle to the thread under the message `rootId` in `channel`. */
20
+ static byId(client: MacroClient, channel: Channel, rootId: string): Thread;
19
21
  /** Serialize the thread identity without its authenticated client. */
20
22
  toJSON(): {
21
23
  channelId: string;
22
24
  rootId: string;
23
25
  };
24
- /** The channel this thread is in. */
26
+ /**
27
+ * The channel this thread is in.
28
+ *
29
+ * @readonly
30
+ */
25
31
  channel(): Channel;
26
- /** The message this thread hangs off. */
32
+ /**
33
+ * The message this thread hangs off.
34
+ *
35
+ * @readonly
36
+ */
27
37
  root(): Message;
28
- /** List the replies in this thread, oldest first. */
38
+ /**
39
+ * List the replies in this thread, oldest first.
40
+ *
41
+ * @readonly
42
+ */
29
43
  replies(): Promise<Message[]>;
30
44
  /**
31
45
  * Post a reply in this thread.
@@ -36,6 +50,8 @@ export declare class Thread {
36
50
  * @param opts.documents - Macro documents to attach as file chips, such as
37
51
  * a file from `macro.documents.upload()`.
38
52
  * @returns The created reply.
53
+ *
54
+ * @write
39
55
  */
40
56
  reply(body: string | RichMessage, opts?: {
41
57
  images?: StaticImage[];
@@ -5,12 +5,18 @@ import { PropertiedEntity } from '../entity';
5
5
  import { Project } from '../projects/project';
6
6
  import type { EntityReference } from '../reference';
7
7
  import { EntityAccess } from '../sharing/access';
8
+ import { type SharePermissionOptions } from '../sharing/permissions';
8
9
  import { ChatGeneration } from './generation';
9
10
  type ChatDetail = GetChatResponses[200]['chat'];
10
11
  type ChatHistory = GetChatHistoryHandlerResponses[200]['conversation'];
11
12
  /** A Macro AI chat. */
12
13
  export declare class Chat extends PropertiedEntity<ChatDetail> implements Mentionable {
13
- /** Send a message and start a background generation. Tools may perform writes. */
14
+ /**
15
+ * Send a message and start a background generation. Tools may perform writes.
16
+ *
17
+ * @write
18
+ * @openworld
19
+ */
14
20
  send(options: Omit<HttpSendChatMessageRequest, 'chat_id' | 'attachments' | 'additional_instructions'> & {
15
21
  attachments?: EntityReference[];
16
22
  additionalInstructions?: string;
@@ -41,22 +47,61 @@ export declare class Chat extends PropertiedEntity<ChatDetail> implements Mentio
41
47
  readonly updatedAt: () => Promise<string | undefined>;
42
48
  /** The messages in the chat, with their attachments. */
43
49
  readonly messages: () => Promise<import("../../../generated/cognition").ChatMessageWithAttachments[]>;
44
- /** Rename the chat. */
50
+ /**
51
+ * Sharing configuration.
52
+ *
53
+ * @readonly
54
+ */
55
+ sharePermissions(): Promise<import("../../../generated/cognition").GetChatPermissionsResponse>;
56
+ /**
57
+ * Change who can open the chat: the link share and its access level, the
58
+ * owner's team, and channel grants. Omitted fields are left as they are.
59
+ *
60
+ * @write
61
+ * @idempotent
62
+ */
63
+ updateSharePermissions(options: SharePermissionOptions): Promise<void>;
64
+ /**
65
+ * Rename the chat.
66
+ *
67
+ * @write
68
+ * @idempotent
69
+ */
45
70
  rename(name: string): Promise<void>;
46
71
  /**
47
72
  * Delete the chat. Soft by default (reversible with {@link restore});
48
73
  * pass `permanent: true` to delete irreversibly.
74
+ *
75
+ * @destructive
76
+ * @idempotent
49
77
  */
50
78
  delete(opts?: {
51
79
  permanent?: boolean;
52
80
  }): Promise<void>;
53
- /** Copy the chat, returning a handle to the new copy. */
81
+ /**
82
+ * Copy the chat, returning a handle to the new copy.
83
+ *
84
+ * @write
85
+ */
54
86
  copy(): Promise<Chat>;
55
- /** Restore a soft-deleted chat. */
87
+ /**
88
+ * Restore a soft-deleted chat.
89
+ *
90
+ * @write
91
+ * @idempotent
92
+ */
56
93
  restore(): Promise<void>;
57
- /** The chat's conversation history: titled records of messages with attachment ids. */
94
+ /**
95
+ * The chat's conversation history: titled records of messages with attachment ids.
96
+ *
97
+ * @readonly
98
+ */
58
99
  history(): Promise<ChatHistory>;
59
- /** The chat's URL in the Macro web app. */
100
+ /**
101
+ * The chat's URL in the Macro web app.
102
+ *
103
+ * @readonly
104
+ */
60
105
  webUrl(): string;
61
106
  /** Identity, loaded detail and {@link webUrl}, so serialized handles carry their link. */
62
107
  toJSON(): {
@@ -66,6 +111,11 @@ export declare class Chat extends PropertiedEntity<ChatDetail> implements Mentio
66
111
  };
67
112
  /** Search chats by name and content, most relevant first, auto-paginated. */
68
113
  static search: (client: MacroClient, query: string, searchOpts?: import("../search/options").SearchOpts) => AsyncGenerator<Chat, any, any>;
114
+ /**
115
+ * Render this chat as a mention for a message body.
116
+ *
117
+ * @readonly
118
+ */
69
119
  toMention(): MentionPart;
70
120
  }
71
121
  export {};
@@ -14,7 +14,12 @@ export declare class ChatGeneration {
14
14
  private constructor();
15
15
  /** Construct from a send receipt. */
16
16
  static byId(client: MacroClient, chat: Chat, id: string, message: ChatMessage): ChatGeneration;
17
- /** Request cancellation of this generation. */
17
+ /**
18
+ * Request cancellation of this generation.
19
+ *
20
+ * @destructive
21
+ * @idempotent
22
+ */
18
23
  stop(): Promise<void>;
19
24
  /** Serialize scoped identity. */
20
25
  toJSON(): {
@@ -35,7 +40,11 @@ export declare class ChatMessage extends MacroEntity<ChatMessageWithAttachments>
35
40
  readonly content: () => Promise<import("../../../generated/cognition").ChatMessageContent>;
36
41
  /** Role of the message author. */
37
42
  readonly role: () => Promise<import("../../../generated/cognition").Role>;
38
- /** Reload after a running generation changes or finishes. */
43
+ /**
44
+ * Reload after a running generation changes or finishes.
45
+ *
46
+ * @readonly
47
+ */
39
48
  refresh(): Promise<void>;
40
49
  /** Serialize scoped identity and any loaded message. */
41
50
  toJSON(): {
@@ -17,11 +17,19 @@ export declare class ChatNamespace {
17
17
  constructor(client: MacroClient);
18
18
  /** A handle to an AI chat by id; read its messages with `history()`. */
19
19
  byId(id: string): Chat;
20
- /** Create an empty AI chat, optionally named and in a project. */
20
+ /**
21
+ * Create an empty AI chat, optionally named and in a project.
22
+ *
23
+ * @write
24
+ */
21
25
  create(opts?: {
22
26
  name?: string;
23
27
  project?: Project;
24
28
  }): Promise<Chat>;
25
- /** Search AI chats by name and content, most relevant first, auto-paginated. */
29
+ /**
30
+ * Search AI chats by name and content, most relevant first, auto-paginated.
31
+ *
32
+ * @readonly
33
+ */
26
34
  search(query: string, opts?: SearchOpts): AsyncGenerator<Chat>;
27
35
  }
@@ -43,9 +43,18 @@ export declare class ConnectedApp {
43
43
  /**
44
44
  * The tools this app serves, with each one's description and argument
45
45
  * schema. Read a tool's `inputSchema` before calling it.
46
+ *
47
+ * @readonly
48
+ * @openworld
49
+ * @mcp-exclude Needs the CodeExecution of a running program.
46
50
  */
47
51
  tools(): Promise<ConnectedTool[]>;
48
- /** @internal The harness route that names this app. */
52
+ /**
53
+ * @internal The harness route that names this app.
54
+ *
55
+ * @readonly
56
+ * @mcp-exclude Internal route helper.
57
+ */
49
58
  path(): {
50
59
  session_id: string;
51
60
  execution_id: string;
@@ -91,6 +100,10 @@ export declare class ConnectedTool {
91
100
  * or whose connection expired, answers with `isError` and text telling you
92
101
  * what to say to the user, including any connect markup to put in your
93
102
  * reply verbatim.
103
+ *
104
+ * @destructive
105
+ * @openworld
106
+ * @mcp-exclude Needs the CodeExecution of a running program.
94
107
  */
95
108
  call(args?: Record<string, unknown>): Promise<ConnectedToolResult>;
96
109
  /** Serialize the tool's description, not its client. */
@@ -45,6 +45,9 @@ export declare class Connector {
45
45
  /**
46
46
  * Read the actions this app advertises and whether the execution's account
47
47
  * has it connected. Inspection never calls the app or changes a connection.
48
+ *
49
+ * @readonly
50
+ * @mcp-exclude Needs the CodeExecution of a running program.
48
51
  */
49
52
  inspect(): Promise<ConnectorInspection>;
50
53
  /** Serialize the catalog entry, not its client. */
@@ -39,6 +39,10 @@ export declare class ConnectedAppNamespace {
39
39
  * List the apps a running code execution's session agent may use; pass the
40
40
  * `execution` given to `main`. Fails outside a running execution of the
41
41
  * session's current turn.
42
+ *
43
+ * @readonly
44
+ * @openworld
45
+ * @mcp-exclude Needs the CodeExecution of a running program.
42
46
  */
43
47
  list(execution: CodeExecution): Promise<ConnectedApp[]>;
44
48
  /**
@@ -46,6 +50,10 @@ export declare class ConnectedAppNamespace {
46
50
  * by keywords matched against tool names and descriptions (e.g. `linear
47
51
  * issue`), best first, at most 20. Apps whose tools could not be read come
48
52
  * back in `unsearched`, not as an error.
53
+ *
54
+ * @readonly
55
+ * @openworld
56
+ * @mcp-exclude Needs the CodeExecution of a running program.
49
57
  */
50
58
  searchTools(execution: CodeExecution, query: string): Promise<{
51
59
  matches: ConnectedTool[];
@@ -55,6 +63,9 @@ export declare class ConnectedAppNamespace {
55
63
  * Search the catalog of apps the user could connect, by app name (e.g.
56
64
  * `Linear`, not a task description). Inspect a result before recommending
57
65
  * it: its description alone does not show what it can do.
66
+ *
67
+ * @readonly
68
+ * @mcp-exclude Needs the CodeExecution of a running program.
58
69
  */
59
70
  discover(execution: CodeExecution, appName: string): Promise<{
60
71
  connectors: Connector[];
@@ -66,6 +77,11 @@ export declare class ConnectedAppNamespace {
66
77
  * never guess. Most servers then need the user to sign in under
67
78
  * Settings → Connections, which the result's `summary` says. A URL the
68
79
  * user already has is left as it is.
80
+ *
81
+ * @write
82
+ * @idempotent
83
+ * @openworld
84
+ * @mcp-exclude Needs the CodeExecution of a running program.
69
85
  */
70
86
  addServer(execution: CodeExecution, server: {
71
87
  url: string;
@@ -2,17 +2,25 @@ import type { GetCompanyResponses } from '../../../generated/storage/types.gen';
2
2
  import type { RichMessage } from '../../mentions';
3
3
  import type { MacroClient } from '../../utils/client';
4
4
  import { PropertiedEntity } from '../entity';
5
+ import { DiscussionComment, type DiscussionThread } from '../messages/discussion';
5
6
  import { MessageThread, type TimelineOptions } from '../messages/thread';
6
7
  import { Team } from '../teams/team';
7
- import { CrmComment, type CrmCommentThread } from './comment';
8
8
  import { Contact } from './contact';
9
9
  type CompanyDetail = GetCompanyResponses[200];
10
10
  /** A CRM company: an organization the team has interacted with. */
11
11
  export declare class Company extends PropertiedEntity<CompanyDetail> {
12
- /** A shared message thread scoped to this resource. */
12
+ /**
13
+ * A shared message thread scoped to this resource.
14
+ *
15
+ * @readonly
16
+ */
13
17
  messageThreadById(id: string): MessageThread;
14
- /** A mixed message and activity timeline page. */
15
- timelinePage(selection?: TimelineOptions<CrmComment>): Promise<{
18
+ /**
19
+ * A mixed message and activity timeline page.
20
+ *
21
+ * @readonly
22
+ */
23
+ timelinePage(selection?: TimelineOptions<DiscussionComment>): Promise<{
16
24
  entries: ({
17
25
  type: "activity";
18
26
  activity: {
@@ -26,7 +34,7 @@ export declare class Company extends PropertiedEntity<CompanyDetail> {
26
34
  message?: undefined;
27
35
  } | {
28
36
  type: "message";
29
- message: CrmComment;
37
+ message: DiscussionComment;
30
38
  activity?: undefined;
31
39
  })[];
32
40
  nextCursor: import("../../../generated/storage").MessageCursor | undefined;
@@ -55,33 +63,63 @@ export declare class Company extends PropertiedEntity<CompanyDetail> {
55
63
  readonly createdAt: () => Promise<string>;
56
64
  /** When the company was last updated. */
57
65
  readonly updatedAt: () => Promise<string>;
58
- /** The company's primary domain (e.g. `acme.com`), if any. */
66
+ /**
67
+ * The company's primary domain (e.g. `acme.com`), if any.
68
+ *
69
+ * @readonly
70
+ */
59
71
  domain(): Promise<string | undefined>;
60
- /** All domains associated with the company, primary first. */
72
+ /**
73
+ * All domains associated with the company, primary first.
74
+ *
75
+ * @readonly
76
+ */
61
77
  domains(): Promise<string[]>;
62
- /** The contacts attached to this company (hidden ones filtered for non-admins). */
78
+ /**
79
+ * The contacts attached to this company (hidden ones filtered for non-admins).
80
+ *
81
+ * @readonly
82
+ */
63
83
  contacts(): Promise<Contact[]>;
64
84
  /** Search CRM companies by name/domain, most relevant first, auto-paginated. */
65
85
  static search: (client: MacroClient, query: string, searchOpts?: import("../search/options").SearchOpts) => AsyncGenerator<Company, any, any>;
66
86
  /**
67
87
  * Hide the company from CRM listings: disables email sync and soft-hides
68
88
  * its contacts. Reversible with {@link unhide}.
89
+ *
90
+ * @write
91
+ * @idempotent
69
92
  */
70
93
  hide(): Promise<void>;
71
- /** Un-hide the company, restoring it and its contacts to CRM listings. */
94
+ /**
95
+ * Un-hide the company, restoring it and its contacts to CRM listings.
96
+ *
97
+ * @write
98
+ * @idempotent
99
+ */
72
100
  unhide(): Promise<void>;
73
101
  private setHidden;
74
102
  /**
75
103
  * Enable or disable team-wide email sync for this company. Rejects with 409
76
104
  * when enabling on a hidden company — {@link unhide} first.
105
+ *
106
+ * @write
107
+ * @idempotent
77
108
  */
78
109
  setEmailSync(enabled: boolean): Promise<void>;
79
- /** Rename the company for the caller's current team. */
110
+ /**
111
+ * Rename the company for the caller's current team.
112
+ *
113
+ * @write
114
+ * @idempotent
115
+ */
80
116
  rename(name: string): Promise<void>;
81
117
  /**
82
118
  * Create a contact under this company. The email is optional and need not
83
119
  * match the company's domains, so personal addresses work too; omitting it
84
120
  * adds the contact by name alone.
121
+ *
122
+ * @write
85
123
  */
86
124
  createContact(opts: {
87
125
  email?: string;
@@ -89,18 +127,28 @@ export declare class Company extends PropertiedEntity<CompanyDetail> {
89
127
  }): Promise<Contact>;
90
128
  /** The CRM record this company's discussions hang off. */
91
129
  private get commentParent();
92
- /** The comment threads on this company, newest thread first. */
93
- comments(): Promise<CrmCommentThread[]>;
130
+ /**
131
+ * The comment threads on this company, newest thread first.
132
+ *
133
+ * @readonly
134
+ */
135
+ comments(): Promise<DiscussionThread[]>;
94
136
  /**
95
137
  * Add a comment. Starts a new thread, or replies to an existing one when
96
138
  * `threadId` (the thread's root comment id) is given.
97
139
  *
98
140
  * @param body - Plain text, or a rich body composed with {@link msg}.
141
+ *
142
+ * @write
99
143
  */
100
144
  comment(body: string | RichMessage, opts?: {
101
145
  threadId?: string;
102
- }): Promise<CrmComment>;
103
- /** A handle to one of this company's comments by id. */
104
- commentById(id: string): CrmComment;
146
+ }): Promise<DiscussionComment>;
147
+ /**
148
+ * A handle to one of this company's comments by id.
149
+ *
150
+ * @readonly
151
+ */
152
+ commentById(id: string): DiscussionComment;
105
153
  }
106
154
  export {};
@@ -2,16 +2,24 @@ import type { GetContactResponses } from '../../../generated/storage/types.gen';
2
2
  import type { RichMessage } from '../../mentions';
3
3
  import type { MacroClient } from '../../utils/client';
4
4
  import { FavoritableEntity } from '../entity';
5
+ import { DiscussionComment, type DiscussionThread } from '../messages/discussion';
5
6
  import { MessageThread, type TimelineOptions } from '../messages/thread';
6
- import { CrmComment, type CrmCommentThread } from './comment';
7
7
  import { Company } from './company';
8
8
  type ContactDetail = GetContactResponses[200];
9
9
  /** A CRM contact: a person observed interacting with the team. */
10
10
  export declare class Contact extends FavoritableEntity<ContactDetail> {
11
- /** A shared message thread scoped to this resource. */
11
+ /**
12
+ * A shared message thread scoped to this resource.
13
+ *
14
+ * @readonly
15
+ */
12
16
  messageThreadById(id: string): MessageThread;
13
- /** A mixed message and activity timeline page. */
14
- timelinePage(selection?: TimelineOptions<CrmComment>): Promise<{
17
+ /**
18
+ * A mixed message and activity timeline page.
19
+ *
20
+ * @readonly
21
+ */
22
+ timelinePage(selection?: TimelineOptions<DiscussionComment>): Promise<{
15
23
  entries: ({
16
24
  type: "activity";
17
25
  activity: {
@@ -25,7 +33,7 @@ export declare class Contact extends FavoritableEntity<ContactDetail> {
25
33
  message?: undefined;
26
34
  } | {
27
35
  type: "message";
28
- message: CrmComment;
36
+ message: DiscussionComment;
29
37
  activity?: undefined;
30
38
  })[];
31
39
  nextCursor: import("../../../generated/storage").MessageCursor | undefined;
@@ -54,27 +62,66 @@ export declare class Contact extends FavoritableEntity<ContactDetail> {
54
62
  readonly firstInteraction: () => Promise<string>;
55
63
  /** When the team last interacted with this contact. */
56
64
  readonly lastInteraction: () => Promise<string>;
57
- /** Hide the contact from CRM listings. Display-only; reversible with {@link unhide}. */
65
+ /**
66
+ * Hide the contact from CRM listings. Display-only; reversible with {@link unhide}.
67
+ *
68
+ * @write
69
+ * @idempotent
70
+ */
58
71
  hide(): Promise<void>;
59
- /** Un-hide the contact, restoring it to CRM listings. */
72
+ /**
73
+ * Un-hide the contact, restoring it to CRM listings.
74
+ *
75
+ * @write
76
+ * @idempotent
77
+ */
60
78
  unhide(): Promise<void>;
61
79
  private setHidden;
62
- /** Rename the contact for the caller's current team. */
80
+ /**
81
+ * Rename the contact for the caller's current team.
82
+ *
83
+ * @write
84
+ * @idempotent
85
+ */
63
86
  rename(name: string): Promise<void>;
87
+ /**
88
+ * Add an email when absent. Existing addresses cannot be replaced or cleared.
89
+ *
90
+ * @write
91
+ * @idempotent
92
+ */
93
+ setEmail(email: string): Promise<void>;
94
+ /**
95
+ * Link or switch a personal-provider contact's company. Unlinking is not supported.
96
+ *
97
+ * @write
98
+ * @idempotent
99
+ */
100
+ setCompany(company: Company): Promise<void>;
64
101
  /** The CRM record this contact's discussions hang off. */
65
102
  private get commentParent();
66
- /** The comment threads on this contact, newest thread first. */
67
- comments(): Promise<CrmCommentThread[]>;
103
+ /**
104
+ * The comment threads on this contact, newest thread first.
105
+ *
106
+ * @readonly
107
+ */
108
+ comments(): Promise<DiscussionThread[]>;
68
109
  /**
69
110
  * Add a comment. Starts a new thread, or replies to an existing one when
70
111
  * `threadId` (the thread's root comment id) is given.
71
112
  *
72
113
  * @param body - Plain text, or a rich body composed with {@link msg}.
114
+ *
115
+ * @write
73
116
  */
74
117
  comment(body: string | RichMessage, opts?: {
75
118
  threadId?: string;
76
- }): Promise<CrmComment>;
77
- /** A handle to one of this contact's comments by id. */
78
- commentById(id: string): CrmComment;
119
+ }): Promise<DiscussionComment>;
120
+ /**
121
+ * A handle to one of this contact's comments by id.
122
+ *
123
+ * @readonly
124
+ */
125
+ commentById(id: string): DiscussionComment;
79
126
  }
80
127
  export {};