@distilled.cloud/slack 1.0.0-rc.17 → 1.0.0-rc.19

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 (201) hide show
  1. package/lib/_bundle/sdk.js +1 -1
  2. package/lib/_bundle/sdk.js.map +1 -1
  3. package/lib/credentials.d.ts +2 -1
  4. package/lib/credentials.d.ts.map +1 -1
  5. package/lib/index.d.ts +3 -4
  6. package/lib/index.d.ts.map +1 -1
  7. package/lib/index.lazy.js.map +1 -1
  8. package/lib/protocol.d.ts +3 -2
  9. package/lib/protocol.d.ts.map +1 -1
  10. package/lib/services/admin.d.ts +594 -356
  11. package/lib/services/admin.d.ts.map +1 -1
  12. package/lib/services/admin.js +149 -139
  13. package/lib/services/admin.js.map +1 -1
  14. package/lib/services/agents.d.ts +89 -97
  15. package/lib/services/agents.d.ts.map +1 -1
  16. package/lib/services/agents.js +1 -1
  17. package/lib/services/agents.js.map +1 -1
  18. package/lib/services/api.d.ts +2 -2
  19. package/lib/services/api.d.ts.map +1 -1
  20. package/lib/services/api.js +1 -1
  21. package/lib/services/api.js.map +1 -1
  22. package/lib/services/apps.d.ts +74 -74
  23. package/lib/services/apps.d.ts.map +1 -1
  24. package/lib/services/apps.js +34 -33
  25. package/lib/services/apps.js.map +1 -1
  26. package/lib/services/assistant.d.ts +55 -46
  27. package/lib/services/assistant.d.ts.map +1 -1
  28. package/lib/services/assistant.js +1 -1
  29. package/lib/services/assistant.js.map +1 -1
  30. package/lib/services/auth.d.ts +27 -27
  31. package/lib/services/auth.d.ts.map +1 -1
  32. package/lib/services/auth.js +1 -1
  33. package/lib/services/auth.js.map +1 -1
  34. package/lib/services/blocks.d.ts +3 -3
  35. package/lib/services/blocks.d.ts.map +1 -1
  36. package/lib/services/blocks.js +1 -1
  37. package/lib/services/blocks.js.map +1 -1
  38. package/lib/services/bookmarks.d.ts +19 -19
  39. package/lib/services/bookmarks.d.ts.map +1 -1
  40. package/lib/services/bookmarks.js +1 -1
  41. package/lib/services/bookmarks.js.map +1 -1
  42. package/lib/services/bots.d.ts +23 -23
  43. package/lib/services/bots.d.ts.map +1 -1
  44. package/lib/services/bots.js +1 -1
  45. package/lib/services/bots.js.map +1 -1
  46. package/lib/services/calls.d.ts +10 -10
  47. package/lib/services/calls.d.ts.map +1 -1
  48. package/lib/services/calls.js +1 -1
  49. package/lib/services/calls.js.map +1 -1
  50. package/lib/services/canvases.d.ts +18 -18
  51. package/lib/services/canvases.d.ts.map +1 -1
  52. package/lib/services/canvases.js +1 -1
  53. package/lib/services/canvases.js.map +1 -1
  54. package/lib/services/chat.d.ts +103 -103
  55. package/lib/services/chat.d.ts.map +1 -1
  56. package/lib/services/chat.js +1 -1
  57. package/lib/services/chat.js.map +1 -1
  58. package/lib/services/conversations.d.ts +109 -103
  59. package/lib/services/conversations.d.ts.map +1 -1
  60. package/lib/services/conversations.js +39 -38
  61. package/lib/services/conversations.js.map +1 -1
  62. package/lib/services/dialog.d.ts.map +1 -1
  63. package/lib/services/dialog.js +1 -1
  64. package/lib/services/dialog.js.map +1 -1
  65. package/lib/services/dnd.d.ts +14 -14
  66. package/lib/services/dnd.d.ts.map +1 -1
  67. package/lib/services/dnd.js +1 -1
  68. package/lib/services/dnd.js.map +1 -1
  69. package/lib/services/emoji.d.ts +6 -6
  70. package/lib/services/emoji.d.ts.map +1 -1
  71. package/lib/services/emoji.js +1 -1
  72. package/lib/services/emoji.js.map +1 -1
  73. package/lib/services/entity.d.ts +14 -14
  74. package/lib/services/entity.d.ts.map +1 -1
  75. package/lib/services/entity.js +1 -1
  76. package/lib/services/entity.js.map +1 -1
  77. package/lib/services/files.d.ts +106 -106
  78. package/lib/services/files.d.ts.map +1 -1
  79. package/lib/services/files.js +30 -1
  80. package/lib/services/files.js.map +1 -1
  81. package/lib/services/functions.d.ts +37 -37
  82. package/lib/services/functions.d.ts.map +1 -1
  83. package/lib/services/functions.js +1 -1
  84. package/lib/services/functions.js.map +1 -1
  85. package/lib/services/index.d.ts +1 -0
  86. package/lib/services/index.d.ts.map +1 -1
  87. package/lib/services/index.js +1 -0
  88. package/lib/services/lists.d.ts +47 -45
  89. package/lib/services/lists.d.ts.map +1 -1
  90. package/lib/services/lists.js +1 -1
  91. package/lib/services/lists.js.map +1 -1
  92. package/lib/services/migration.d.ts +3 -3
  93. package/lib/services/migration.d.ts.map +1 -1
  94. package/lib/services/migration.js +1 -1
  95. package/lib/services/migration.js.map +1 -1
  96. package/lib/services/oauth.d.ts +102 -102
  97. package/lib/services/oauth.d.ts.map +1 -1
  98. package/lib/services/oauth.js +1 -1
  99. package/lib/services/oauth.js.map +1 -1
  100. package/lib/services/openid.d.ts +40 -40
  101. package/lib/services/openid.d.ts.map +1 -1
  102. package/lib/services/openid.js +1 -1
  103. package/lib/services/openid.js.map +1 -1
  104. package/lib/services/pins.d.ts +9 -9
  105. package/lib/services/pins.d.ts.map +1 -1
  106. package/lib/services/pins.js +1 -1
  107. package/lib/services/pins.js.map +1 -1
  108. package/lib/services/reactions.d.ts +23 -23
  109. package/lib/services/reactions.d.ts.map +1 -1
  110. package/lib/services/reactions.js +1 -1
  111. package/lib/services/reactions.js.map +1 -1
  112. package/lib/services/reminders.d.ts +8 -8
  113. package/lib/services/reminders.d.ts.map +1 -1
  114. package/lib/services/reminders.js +1 -1
  115. package/lib/services/reminders.js.map +1 -1
  116. package/lib/services/rtm.d.ts +11 -11
  117. package/lib/services/rtm.d.ts.map +1 -1
  118. package/lib/services/rtm.js +1 -1
  119. package/lib/services/rtm.js.map +1 -1
  120. package/lib/services/search.d.ts +84 -80
  121. package/lib/services/search.d.ts.map +1 -1
  122. package/lib/services/search.js +1 -1
  123. package/lib/services/search.js.map +1 -1
  124. package/lib/services/slackbot.d.ts +366 -0
  125. package/lib/services/slackbot.d.ts.map +1 -0
  126. package/lib/services/slackbot.js +2 -0
  127. package/lib/services/slackbot.js.map +1 -0
  128. package/lib/services/stars.d.ts +16 -16
  129. package/lib/services/stars.d.ts.map +1 -1
  130. package/lib/services/stars.js +1 -1
  131. package/lib/services/stars.js.map +1 -1
  132. package/lib/services/team.d.ts +39 -37
  133. package/lib/services/team.d.ts.map +1 -1
  134. package/lib/services/team.js +1 -1
  135. package/lib/services/team.js.map +1 -1
  136. package/lib/services/tooling.d.ts.map +1 -1
  137. package/lib/services/tooling.js +1 -1
  138. package/lib/services/tooling.js.map +1 -1
  139. package/lib/services/usergroups.d.ts +30 -30
  140. package/lib/services/usergroups.d.ts.map +1 -1
  141. package/lib/services/usergroups.js +1 -1
  142. package/lib/services/usergroups.js.map +1 -1
  143. package/lib/services/users.d.ts +37 -37
  144. package/lib/services/users.d.ts.map +1 -1
  145. package/lib/services/users.js +1 -1
  146. package/lib/services/users.js.map +1 -1
  147. package/lib/services/views.d.ts +9 -9
  148. package/lib/services/views.d.ts.map +1 -1
  149. package/lib/services/views.js +1 -1
  150. package/lib/services/views.js.map +1 -1
  151. package/lib/services/workflows.d.ts +16 -16
  152. package/lib/services/workflows.d.ts.map +1 -1
  153. package/lib/services/workflows.js +1 -1
  154. package/lib/services/workflows.js.map +1 -1
  155. package/lib/services.lazy/admin.js +2 -2
  156. package/lib/services.lazy/apps.js +1 -1
  157. package/lib/services.lazy/conversations.js +1 -1
  158. package/lib/services.lazy/files.js +3 -1
  159. package/lib/services.lazy/index.js +2 -2
  160. package/lib/services.lazy/slackbot.js +1 -0
  161. package/package.json +8 -7
  162. package/src/credentials.ts +3 -2
  163. package/src/index.ts +3 -4
  164. package/src/protocol.ts +23 -21
  165. package/src/services/admin.ts +1882 -1034
  166. package/src/services/agents.ts +128 -103
  167. package/src/services/api.ts +17 -2
  168. package/src/services/apps.ts +133 -74
  169. package/src/services/assistant.ts +109 -54
  170. package/src/services/auth.ts +46 -27
  171. package/src/services/blocks.ts +18 -3
  172. package/src/services/bookmarks.ts +40 -19
  173. package/src/services/bots.ts +38 -23
  174. package/src/services/calls.ts +35 -10
  175. package/src/services/canvases.ts +77 -46
  176. package/src/services/chat.ts +142 -103
  177. package/src/services/conversations.ts +195 -115
  178. package/src/services/dialog.ts +15 -0
  179. package/src/services/dnd.ts +37 -14
  180. package/src/services/emoji.ts +21 -6
  181. package/src/services/entity.ts +33 -14
  182. package/src/services/files.ts +149 -106
  183. package/src/services/functions.ts +66 -37
  184. package/src/services/index.ts +1 -0
  185. package/src/services/lists.ts +86 -46
  186. package/src/services/migration.ts +18 -3
  187. package/src/services/oauth.ts +127 -102
  188. package/src/services/openid.ts +57 -40
  189. package/src/services/pins.ts +28 -9
  190. package/src/services/reactions.ts +44 -23
  191. package/src/services/reminders.ts +31 -8
  192. package/src/services/rtm.ts +28 -11
  193. package/src/services/search.ts +142 -130
  194. package/src/services/slackbot.ts +766 -0
  195. package/src/services/stars.ts +35 -16
  196. package/src/services/team.ts +73 -37
  197. package/src/services/tooling.ts +15 -0
  198. package/src/services/usergroups.ts +57 -30
  199. package/src/services/users.ts +76 -37
  200. package/src/services/views.ts +30 -9
  201. package/src/services/workflows.ts +45 -16
@@ -11,11 +11,24 @@ const __s: any[] = [];
11
11
 
12
12
  export type { SlackOpError, SlackOpContext };
13
13
 
14
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
15
+ const TELEMETRY = {
16
+ system: "slack-api",
17
+ responseHeaders: [
18
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
19
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
20
+ { header: "x-slack-req-id", name: "http.response.header.x-slack-req-id", transform: "list" },
21
+ ],
22
+ prefix: "Slack",
23
+ service: "Agents",
24
+ propagate: "w3c",
25
+ } as const;
26
+
14
27
  export interface ArchiveConversationRequest {
15
28
  /** ID of the code channel to archive. */
16
29
  channel_id: string;
17
30
  /** Timestamp of a message in the code channel to share back as a thread reply on the origin message. Requires the channel to have an `origin_link` set. */
18
- summary_message_ts?: string;
31
+ summary_message_ts?: string | undefined;
19
32
  }
20
33
  export interface ArchiveConversationResponse {
21
34
  /** Always `true` (a failed call raises a typed error instead). */
@@ -23,17 +36,17 @@ export interface ArchiveConversationResponse {
23
36
  }
24
37
  export interface CreateConversationRequest {
25
38
  /** Encoded team id to create the channel in. Required for org tokens when `origin_channel_id` is not provided. When omitted, the workspace is derived from the origin channel. */
26
- team_id?: string;
39
+ team_id?: string | undefined;
27
40
  /** An opaque identifier for the agent session. When provided, the call is idempotent: if a channel already exists for this `session_id`, it is returned instead of creating a new one. */
28
- session_id?: string;
41
+ session_id?: string | undefined;
29
42
  /** A friendly display name for the code channel. Optional when `origin_channel_id` and `origin_message_ts` are provided -- in that case the channel is named from the origin message and re-titled automatically. Required when no origin link is given. */
30
43
  name: string;
31
- /** Create a private channel instead of a public one. */
32
- is_private?: boolean;
44
+ /** Whether the code channel is private. When omitted, the channel matches the privacy of `origin_channel_id`, or is public if no origin is given. An explicit value is always honored, even if it differs from the origin channel's privacy: passing `false` creates a public channel from a private origin. */
45
+ is_private?: boolean | undefined;
33
46
  /** The channel ID where the agent session was initiated from. Must be provided together with `origin_message_ts`. The channel must be accessible to the calling user and must not be externally shared (Slack Connect). When `team_id` is omitted with an org token, the channel is created in the same workspace as this origin channel. */
34
- origin_channel_id?: string;
47
+ origin_channel_id?: string | undefined;
35
48
  /** The message timestamp in the origin channel that started the agent session. Must be provided together with `origin_channel_id`. The author of this message is automatically invited to the newly created code channel. */
36
- origin_message_ts?: string;
49
+ origin_message_ts?: string | undefined;
37
50
  }
38
51
  export interface CreateConversationResponse {
39
52
  /** Always `true` (a failed call raises a typed error instead). */
@@ -49,9 +62,9 @@ export interface GetCanvasRequest {
49
62
  /** Encoded ID of the canvas to fetch. */
50
63
  canvas_id: string;
51
64
  /** Format to render the canvas content in. Defaults to markdown. */
52
- content_format?: GetCanvasRequestContentFormat | (string & {});
65
+ content_format?: GetCanvasRequestContentFormat | (string & {}) | undefined;
53
66
  /** Whether to include resolved comment threads in the response. Defaults to false. */
54
- include_resolved?: boolean;
67
+ include_resolved?: boolean | undefined;
55
68
  }
56
69
  export interface GetCanvasResponseCommentsItemRepliesItem {
57
70
  /** Message timestamp of the reply. */
@@ -128,9 +141,9 @@ export interface RemoveViewRequest {
128
141
  /** ID of the code channel to remove the view from. */
129
142
  channel_id: string;
130
143
  /** Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id. */
131
- view_key?: string;
144
+ view_key?: string | undefined;
132
145
  /** Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id. */
133
- view_id?: string;
146
+ view_id?: string | undefined;
134
147
  }
135
148
  export interface RemoveViewResponse {
136
149
  /** Always `true` (a failed call raises a typed error instead). */
@@ -142,19 +155,19 @@ export interface RemoveViewResponse {
142
155
  }
143
156
  export interface RenameSessionRequest {
144
157
  /** ID of the channel containing the agent session. Required for public channels. */
145
- channel_id?: string;
158
+ channel_id?: string | undefined;
146
159
  /** New title for the agent session (1-200 characters). For a session channel, this also renames the channel. */
147
160
  title: string;
148
161
  /** Timestamp of the thread root message the session is scoped to. Required for thread-based sessions in regular channels and DMs. Must be omitted for session channels. */
149
- thread_ts?: string;
162
+ thread_ts?: string | undefined;
150
163
  }
151
164
  export interface RenameSessionResponse {
152
165
  /** Always `true` (a failed call raises a typed error instead). */
153
166
  ok: boolean;
154
167
  /** The updated title of the agent session. */
155
- title?: string;
168
+ title: string;
156
169
  /** The encoded ID of the channel, returned when an agent channel was renamed. */
157
- channel_id?: string;
170
+ channel_id?: string | undefined;
158
171
  }
159
172
  export interface SetCanvasContentRequest {
160
173
  /** ID of the agent session channel the canvas is attached to. */
@@ -199,67 +212,67 @@ export interface SetPropertiesRequestCodeChannelSummaryMessage {
199
212
  /** Timestamp of the summary message in the code channel. */
200
213
  message_ts: string;
201
214
  /** Thread timestamp if the summary message is a thread reply. Clients need this to fetch the message via conversations.replies. */
202
- thread_ts?: string;
215
+ thread_ts?: string | undefined;
203
216
  }
204
217
  /** Code channel properties to set. Only provided fields are updated. */
205
218
  export interface SetPropertiesRequestCodeChannel {
206
219
  /** Git hosting provider (e.g. github.com). */
207
- host?: string;
220
+ host?: string | undefined;
208
221
  /** Repository name (e.g., org/repo). */
209
- repo?: string;
222
+ repo?: string | undefined;
210
223
  /** Working branch name. */
211
- branch?: string;
224
+ branch?: string | undefined;
212
225
  /** Base branch the working branch was created from. */
213
- base_branch?: string;
226
+ base_branch?: string | undefined;
214
227
  /** Current commit SHA. */
215
- commit_sha?: string;
228
+ commit_sha?: string | undefined;
216
229
  /** Pull request number. */
217
- pr_number?: number;
230
+ pr_number?: number | undefined;
218
231
  /** URL of the pull request. */
219
- pr_url?: string;
232
+ pr_url?: string | undefined;
220
233
  /** Title of the pull request. */
221
- pr_title?: string;
222
- /** Status of the pull request (e.g. open, merged, closed). */
223
- pr_status?: string;
234
+ pr_title?: string | undefined;
235
+ /** The pull request status displayed for the channel as a whole. One of: an empty string while the pull request is a draft (no status is displayed); open, when it is ready for review; blocked, when a reviewer requested changes, checks are failing, or it has merge conflicts; merged, once it is merged; or closed, when it is closed without being merged. */
236
+ pr_status?: string | undefined;
224
237
  /** URL to the CI pipeline run. */
225
- ci_url?: string;
238
+ ci_url?: string | undefined;
226
239
  /** State of the CI pipeline (e.g. pending, success, failure). */
227
- ci_state?: string;
240
+ ci_state?: string | undefined;
228
241
  /** List of file paths relevant to this session. */
229
- file_paths?: SetPropertiesRequestCodeChannelFilePathsList;
242
+ file_paths?: SetPropertiesRequestCodeChannelFilePathsList | undefined;
230
243
  /** Primary programming language. */
231
- language?: string;
244
+ language?: string | undefined;
232
245
  /** Upstream repository URL. */
233
- upstream_url?: string;
246
+ upstream_url?: string | undefined;
234
247
  /** URL of the working branch. */
235
- branch_url?: string;
248
+ branch_url?: string | undefined;
236
249
  /** Configurable items to display in the channel context bar. A maximum of 5 items will be applied; any beyond that will be silently truncated and a warning returned. */
237
- context_bar_items?: SetPropertiesRequestCodeChannelContextBarItemsList;
250
+ context_bar_items?: SetPropertiesRequestCodeChannelContextBarItemsList | undefined;
238
251
  /** Points to the current summary message for this code channel. Must reference a message within this channel. When the channel is archived with a summary_message_ts, this property is also set to record where the summary lives so clients can fetch it. */
239
- summary_message?: SetPropertiesRequestCodeChannelSummaryMessage;
252
+ summary_message?: SetPropertiesRequestCodeChannelSummaryMessage | undefined;
240
253
  }
241
254
  /** Agent resource properties to set. Only provided fields are updated. */
242
255
  export interface SetPropertiesRequestAgentResource {
243
256
  /** URL of the external resource. */
244
- url?: string;
257
+ url?: string | undefined;
245
258
  /** Type of the external resource. */
246
- resource_type?: string;
259
+ resource_type?: string | undefined;
247
260
  /** Display title of the external resource. */
248
- title?: string;
261
+ title?: string | undefined;
249
262
  /** Provider of the external resource. */
250
- provider?: string;
263
+ provider?: string | undefined;
251
264
  }
252
265
  export interface SetPropertiesRequest {
253
266
  /** ID of the code channel to update. */
254
267
  channel_id: string;
255
268
  /** New display title for the agent session. */
256
- title?: string;
269
+ title?: string | undefined;
257
270
  /** New status for the agent session. */
258
- status?: SetPropertiesRequestStatus | (string & {});
271
+ status?: SetPropertiesRequestStatus | (string & {}) | undefined;
259
272
  /** Code channel properties to set. Only provided fields are updated. */
260
- code_channel?: SetPropertiesRequestCodeChannel;
273
+ code_channel?: SetPropertiesRequestCodeChannel | undefined;
261
274
  /** Agent resource properties to set. Only provided fields are updated. */
262
- agent_resource?: SetPropertiesRequestAgentResource;
275
+ agent_resource?: SetPropertiesRequestAgentResource | undefined;
263
276
  }
264
277
  export interface SetPropertiesResponse {
265
278
  /** Always `true` (a failed call raises a typed error instead). */
@@ -267,78 +280,70 @@ export interface SetPropertiesResponse {
267
280
  /** The encoded ID of the updated code channel. */
268
281
  channel_id: string;
269
282
  }
270
- /** The lifecycle status to set. */
271
- export type SetStatusRequestStatus = "active" | "processing" | "suspended" | "closed";
272
283
  export interface SetStatusRequest {
273
284
  /** ID of the channel containing the agent session. Required for public channels. */
274
- channel_id?: string;
285
+ channel_id?: string | undefined;
275
286
  /** The lifecycle status to set. */
276
- status: SetStatusRequestStatus | (string & {});
287
+ status: unknown;
277
288
  /** Timestamp of the thread root message the session is scoped to. Required for thread-based sessions in regular channels and DMs. Must be omitted for session channels. */
278
- thread_ts?: string;
289
+ thread_ts?: string | undefined;
279
290
  /** Title for the agent session (max 200 characters). Only used when creating a new session; ignored if the session already exists. To rename an existing session, use `agents.sessions.rename`. */
280
- title?: string;
291
+ title?: string | undefined;
281
292
  /** The user who initiated the session. Only used when creating a new session; ignored if the session already exists. Must be a member of the channel. */
282
- initiator_user_id?: string;
293
+ initiator_user_id?: string | undefined;
283
294
  /** Emoji to use as the agent's icon. Takes priority over `icon_url`. Remains in effect until you clear it (pass `null`) or set a new value. Requires the `chat:write.customize` scope. */
284
- icon_emoji?: string;
295
+ icon_emoji?: string | undefined;
285
296
  /** URL to an image to use as the agent's icon. Remains in effect until you clear it (pass `null`) or set a new value. Requires the `chat:write.customize` scope. */
286
- icon_url?: string;
297
+ icon_url?: string | undefined;
287
298
  /** Display name override for the agent (max 200 characters). Remains in effect until you clear it (pass `null`) or set a new value. Requires the `chat:write.customize` scope. */
288
- username?: string;
299
+ username?: string | undefined;
289
300
  }
290
301
  export interface SetStatusResponse {
291
302
  /** Always `true` (a failed call raises a typed error instead). */
292
303
  ok: boolean;
293
304
  /** The current lifecycle status of the agent session, derived from the statuses of all agents in the session. */
294
- status?: unknown;
305
+ status: unknown;
295
306
  /** The lifecycle status of the calling agent within this session. May differ from the session-level status when other agents are present. */
296
- agent_status?: unknown;
307
+ agent_status: unknown;
297
308
  /** The current title of the agent session, if set. */
298
- title?: string;
309
+ title?: string | undefined;
299
310
  }
300
- /** For canvas views: access level granted to the channel for the canvas tab. Defaults to write. Use 'comment' to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. */
311
+ /** For `canvas` views: access level granted to the channel for the canvas tab. Defaults to `write`. Use `comment` to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. */
301
312
  export type SetViewRequestAccessLevel = "read" | "write" | "comment";
302
- /** Origins the view may fetch()/XHR/WebSocket to. Accepted and stored, but not honored at render time yet. */
303
- export type SetViewRequestCspConnectDomainsList = Array<string>;
304
- /** Origins the view may load scripts/styles/fonts/images/media from, merged into the curated CDN allowlist at render time. */
313
+ /** Origins the view may load scripts, styles, fonts, images, and media from, merged into the curated CDN allowlist at render time. */
305
314
  export type SetViewRequestCspResourceDomainsList = Array<string>;
306
- /** Content-Security-Policy domain declarations for the view. Domains are validated server-side (https-only, no private/internal hosts) and persisted. Only resource_domains is honored at render time today; connect_domains is accepted and stored for forward-compatibility but NOT honored yet. */
315
+ /** Content-Security-Policy domain declarations for the view. Domains are validated server-side (`https://` only, no private or internal hosts) and persisted. */
307
316
  export interface SetViewRequestCsp {
308
- /** Origins the view may fetch()/XHR/WebSocket to. Accepted and stored, but not honored at render time yet. */
309
- connect_domains?: SetViewRequestCspConnectDomainsList;
310
- /** Origins the view may load scripts/styles/fonts/images/media from, merged into the curated CDN allowlist at render time. */
311
- resource_domains?: SetViewRequestCspResourceDomainsList;
317
+ /** Origins the view may load scripts, styles, fonts, images, and media from, merged into the curated CDN allowlist at render time. */
318
+ resource_domains?: SetViewRequestCspResourceDomainsList | undefined;
312
319
  }
313
320
  export interface SetViewRequest {
314
321
  /** ID of the code channel to render the view in. */
315
322
  channel_id: string;
316
- /** The kind of view to create or update. Defaults to html. Determines which other arguments are required: html and diff require content, block_kit requires blocks, canvas requires canvas_id, pull_request requires pr_url. */
317
- type?: unknown;
318
- /** Agent-assigned stable identity for the view (e.g. the source file path on the agent's machine). Used as the upsert key: calls with the same view_key update the same view. Required for html, block_kit, and canvas views; ignored for diff (a diff view is a per-channel singleton). */
319
- view_key?: string;
320
- /** View content. For html, a full self-contained HTML document; for diff, raw unified diff text. Capped at 1,000,000 bytes -- larger content returns content_too_large. The cap is enforced by the handler (not schema maxLength) so the documented error code actually surfaces instead of a generic argument-validation failure. Required when type is html or diff. */
321
- content?: string;
322
- /** Block Kit blocks to render in the view tab. Required when type is block_kit; ignored otherwise. */
323
- blocks?: unknown;
324
- /** Encoded ID of the canvas to attach as the view. Required when type is canvas; ignored otherwise. */
325
- canvas_id?: string;
326
- /** For canvas views: access level granted to the channel for the canvas tab. Defaults to write. Use 'comment' to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. */
327
- access_level?: SetViewRequestAccessLevel | (string & {});
328
- /** For canvas views: hash of the canvas-derived markdown the agent last wrote, recorded so the agent can later detect human edits to the canvas. Opaque to the server. */
329
- agent_content_hash?: string;
330
- /** For pull_request views: the pull request's URL. Required when type is pull_request; ignored otherwise. */
331
- pr_url?: string;
332
- /** For diff views: base branch name for display purposes. */
333
- base_branch?: string;
334
- /** For diff views: head branch name for display purposes. */
335
- head_branch?: string;
336
- /** Display label for the view tab. Preferred over the legacy 'label' argument (name wins if both are supplied). Defaults to the last path segment of view_key, stripped of any .html/.htm extension. */
337
- name?: string;
338
- /** Deprecated alias for 'name'. Display label for the view tab. Defaults to the last path segment of view_key, stripped of any .html/.htm extension. */
339
- label?: string;
340
- /** Content-Security-Policy domain declarations for the view. Domains are validated server-side (https-only, no private/internal hosts) and persisted. Only resource_domains is honored at render time today; connect_domains is accepted and stored for forward-compatibility but NOT honored yet. */
341
- csp?: SetViewRequestCsp;
323
+ /** The kind of view to create or update. Defaults to `html`. Determines which other arguments are required: `html` and `diff` require `content`, `block_kit` requires `blocks`, and `canvas` requires `canvas_id`. */
324
+ type?: unknown | undefined;
325
+ /** Agent-assigned stable identity for the view (e.g. the source file path on the agent's machine). Used as the upsert key: calls with the same `view_key` update the same view. Required for `html`, `block_kit`, and `canvas` views; ignored for `diff` (a `diff` view is a per-channel singleton). */
326
+ view_key?: string | undefined;
327
+ /** View content. For `html`, a full self-contained HTML document; for `diff`, raw unified diff text. Capped at 1,000,000 bytes; larger content returns `content_too_large`. The cap is enforced by the handler (not schema `maxLength`) so the documented error code actually surfaces instead of a generic argument-validation failure. Required when `type` is `html` or `diff`. */
328
+ content?: string | undefined;
329
+ /** Block Kit blocks to render in the view tab. Required when `type` is `block_kit`; ignored otherwise. */
330
+ blocks?: unknown | undefined;
331
+ /** Encoded ID of the canvas to attach as the view. Required when `type` is `canvas`; ignored otherwise. */
332
+ canvas_id?: string | undefined;
333
+ /** For `canvas` views: access level granted to the channel for the canvas tab. Defaults to `write`. Use `comment` to grant channel members comment access (read and comment, no editing) so the agent remains the sole author of the canvas text. */
334
+ access_level?: SetViewRequestAccessLevel | (string & {}) | undefined;
335
+ /** For `canvas` views: hash of the canvas-derived markdown the agent last wrote, recorded so the agent can later detect human edits to the canvas. Opaque to the server. */
336
+ agent_content_hash?: string | undefined;
337
+ /** For `diff` views: base branch name for display purposes. */
338
+ base_branch?: string | undefined;
339
+ /** For `diff` views: head branch name for display purposes. */
340
+ head_branch?: string | undefined;
341
+ /** Display label for the view tab. Preferred over the legacy `label` argument (`name` wins if both are supplied). Defaults to the last path segment of `view_key`, stripped of any `.html` or `.htm` extension. */
342
+ name?: string | undefined;
343
+ /** Deprecated alias for `name`. Display label for the view tab. Defaults to the last path segment of `view_key`, stripped of any `.html` or `.htm` extension. */
344
+ label?: string | undefined;
345
+ /** Content-Security-Policy domain declarations for the view. Domains are validated server-side (`https://` only, no private or internal hosts) and persisted. */
346
+ csp?: SetViewRequestCsp | undefined;
342
347
  }
343
348
  export interface SetViewResponse {
344
349
  /** Always `true` (a failed call raises a typed error instead). */
@@ -347,14 +352,14 @@ export interface SetViewResponse {
347
352
  channel_id: string;
348
353
  /** The encoded channel tab ID of the view. */
349
354
  view_id: string;
350
- /** The encoded ID of the backing file for the view. For html and block_kit views this is the agent-owned content file; for diff views it is the diff snippet file; for canvas views it is the canvas's file ID (same value as canvas_id). Empty for pull_request views, which have no backing file. */
355
+ /** The encoded ID of the backing file for the view. For `html` and `block_kit` views this is the agent-owned content file; for `diff` views it is the diff snippet file; for `canvas` views it is the canvas's file ID (same value as `canvas_id`). */
351
356
  file_id: string;
352
357
  /** Server-assigned content version, monotonically increasing per view. */
353
358
  content_version: number;
354
359
  /** The type of the view that was created or updated. */
355
- type?: unknown;
356
- /** For canvas views, the encoded ID of the attached canvas. Absent for other view types. */
357
- canvas_id?: string;
360
+ type?: unknown | undefined;
361
+ /** For `canvas` views, the encoded ID of the attached canvas. Absent for other view types. */
362
+ canvas_id?: string | undefined;
358
363
  }
359
364
  export type ArchiveConversationError = SlackOpError;
360
365
  /** Archive a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel_id does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `already_archived` -- The channel has already been archived. - `restricted_action` -- The workspace does not allow the bot to archive channels. - `summary_message_not_found` -- The specified summary_message_ts does not correspond to a message in the code channel. - `no_origin_link` -- summary_message_ts was provided but the code channel has no origin_link set. - `origin_channel_not_found` -- The origin channel referenced by the code channel is no longer accessible. - `origin_message_not_found` -- The origin message referenced by the code channel's origin_link could not be found. See https://docs.slack.dev/reference/methods/agents.conversations.archive */
@@ -369,6 +374,8 @@ export const archiveConversation: API.OperationMethod<
369
374
  errors: [SlackError, SlackRateLimited],
370
375
  protocol: SlackProtocol,
371
376
  retry: Retry.Retry,
377
+ telemetry: TELEMETRY,
378
+ span: "ArchiveConversation",
372
379
  }));
373
380
 
374
381
  export type CreateConversationError = SlackOpError;
@@ -384,10 +391,12 @@ export const createConversation: API.OperationMethod<
384
391
  errors: [SlackError, SlackRateLimited],
385
392
  protocol: SlackProtocol,
386
393
  retry: Retry.Retry,
394
+ telemetry: TELEMETRY,
395
+ span: "CreateConversation",
387
396
  }));
388
397
 
389
398
  export type GetCanvasError = SlackOpError;
390
- /** Fetch a canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `canvas_content_fetch_failed` -- The canvas content could not be fetched or rendered. - `comments_fetch_failed` -- The canvas comment threads could not be fetched. See https://docs.slack.dev/reference/methods/agents.conversations.getCanvas */
399
+ /** Fetch a canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `canvas_content_fetch_failed` -- The canvas content could not be fetched or rendered. - `comments_fetch_failed` -- The canvas comment threads could not be fetched. See https://docs.slack.dev/reference/methods/agents.conversations.getCanvas */
391
400
  export const getCanvas: API.OperationMethod<
392
401
  GetCanvasRequest,
393
402
  GetCanvasResponse,
@@ -399,6 +408,8 @@ export const getCanvas: API.OperationMethod<
399
408
  errors: [SlackError, SlackRateLimited],
400
409
  protocol: SlackProtocol,
401
410
  retry: Retry.Retry,
411
+ telemetry: TELEMETRY,
412
+ span: "GetCanvas",
402
413
  }));
403
414
 
404
415
  export type ListViewsError = SlackOpError;
@@ -414,6 +425,8 @@ export const listViews: API.OperationMethod<
414
425
  errors: [SlackError, SlackRateLimited],
415
426
  protocol: SlackProtocol,
416
427
  retry: Retry.Retry,
428
+ telemetry: TELEMETRY,
429
+ span: "ListViews",
417
430
  }));
418
431
 
419
432
  export type RemoveViewError = SlackOpError;
@@ -429,6 +442,8 @@ export const removeView: API.OperationMethod<
429
442
  errors: [SlackError, SlackRateLimited],
430
443
  protocol: SlackProtocol,
431
444
  retry: Retry.Retry,
445
+ telemetry: TELEMETRY,
446
+ span: "RemoveView",
432
447
  }));
433
448
 
434
449
  export type RenameSessionError = SlackOpError;
@@ -444,10 +459,12 @@ export const renameSession: API.OperationMethod<
444
459
  errors: [SlackError, SlackRateLimited],
445
460
  protocol: SlackProtocol,
446
461
  retry: Retry.Retry,
462
+ telemetry: TELEMETRY,
463
+ span: "RenameSession",
447
464
  }));
448
465
 
449
466
  export type SetCanvasContentError = SlackOpError;
450
- /** Replace the full markdown content of a plan canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `feature_not_enabled` -- The set-canvas-content feature is not enabled for this user. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified canvas_id does not correspond to a canvas you can access. - `content_too_large` -- The provided content exceeds the maximum canvas size. - `too_many_sections` -- The provided content or the existing canvas has too many sections to diff. Reduce the number of distinct blocks (paragraphs, headings, code fences) in the document. - `canvas_content_fetch_failed` -- The canvas's current content could not be read to compute the diff. - `canvas_content_update_failed` -- The canvas content could not be updated. See https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent */
467
+ /** Replace the full markdown content of a plan canvas attached to a code channel. Required scopes -- bot: `code_channels:manage` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not an agent session channel. - `not_authorized` -- The caller is not an authorized agent bot for this channel. - `canvas_not_found` -- The specified canvas_id does not correspond to a canvas you can access. - `content_too_large` -- The provided content exceeds the maximum canvas size. - `too_many_sections` -- The provided content or the existing canvas has too many sections to diff. Reduce the number of distinct blocks (paragraphs, headings, code fences) in the document. - `canvas_content_fetch_failed` -- The canvas's current content could not be read to compute the diff. - `canvas_content_update_failed` -- The canvas content could not be updated. See https://docs.slack.dev/reference/methods/agents.conversations.setCanvasContent */
451
468
  export const setCanvasContent: API.OperationMethod<
452
469
  SetCanvasContentRequest,
453
470
  SetCanvasContentResponse,
@@ -459,6 +476,8 @@ export const setCanvasContent: API.OperationMethod<
459
476
  errors: [SlackError, SlackRateLimited],
460
477
  protocol: SlackProtocol,
461
478
  retry: Retry.Retry,
479
+ telemetry: TELEMETRY,
480
+ span: "SetCanvasContent",
462
481
  }));
463
482
 
464
483
  export type SetCommandsError = SlackOpError;
@@ -474,6 +493,8 @@ export const setCommands: API.OperationMethod<
474
493
  errors: [SlackError, SlackRateLimited],
475
494
  protocol: SlackProtocol,
476
495
  retry: Retry.Retry,
496
+ telemetry: TELEMETRY,
497
+ span: "SetCommands",
477
498
  }));
478
499
 
479
500
  export type SetPropertiesError = SlackOpError;
@@ -489,6 +510,8 @@ export const setProperties: API.OperationMethod<
489
510
  errors: [SlackError, SlackRateLimited],
490
511
  protocol: SlackProtocol,
491
512
  retry: Retry.Retry,
513
+ telemetry: TELEMETRY,
514
+ span: "SetProperties",
492
515
  }));
493
516
 
494
517
  export type SetStatusError = SlackOpError;
@@ -504,10 +527,12 @@ export const setStatus: API.OperationMethod<
504
527
  errors: [SlackError, SlackRateLimited],
505
528
  protocol: SlackProtocol,
506
529
  retry: Retry.Retry,
530
+ telemetry: TELEMETRY,
531
+ span: "SetStatus",
507
532
  }));
508
533
 
509
534
  export type SetViewError = SlackOpError;
510
- /** Create or update a view in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `content_too_large` -- The view content exceeds the maximum allowed size (1 MB). - `too_many_views` -- The channel already has the maximum number of views (5), or already has a diff view (at most 1 is allowed). - `invalid_csp_domain` -- One or more declared CSP domains failed validation (must be https:// origins, no private/reserved/internal hosts). - `invalid_view_type` -- The supplied type is not a recognized view type. - `missing_required_arg` -- A required argument for the supplied view type is missing (content for html/diff, blocks for block_kit, canvas_id for canvas, pr_url for pull_request). - `invalid_pr_url` -- The supplied pr_url is not a valid https pull request URL. - `invalid_blocks` -- The supplied blocks failed Block Kit validation. - `canvas_not_found` -- The specified canvas_id does not correspond to a canvas you can access. - `not_view_owner` -- The view already exists and was created by a different agent bot; only its owner may update it. - `view_creation_failed` -- The view could not be created as a channel tab. See https://docs.slack.dev/reference/methods/agents.conversations.setView */
535
+ /** Create or update a view in a code channel. Required scopes -- bot: `code_channels:manage` Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` -- The specified channel does not correspond to a valid channel. - `not_agent_channel` -- The specified channel is not a code channel. - `not_authorized` -- The caller is not an authorized agent bot or member for this channel. - `content_too_large` -- The view content exceeds the maximum allowed size (1 MB). - `too_many_views` -- The channel already has the maximum number of views (5), or already has a `diff` view (at most 1 is allowed). - `invalid_csp_domain` -- One or more declared CSP domains failed validation (must be `https://` origins, no private, reserved, or internal hosts). - `invalid_view_type` -- The supplied `type` is not a recognized view type. - `missing_required_arg` -- A required argument for the supplied view type is missing (`content` for `html` or `diff`, `blocks` for `block_kit`, `canvas_id` for `canvas`). - `invalid_blocks` -- The supplied `blocks` failed Block Kit validation. - `canvas_not_found` -- The specified `canvas_id` does not correspond to a canvas you can access. - `not_view_owner` -- The view already exists and was created by a different agent bot; only its owner may update it. - `view_creation_failed` -- The view could not be created as a channel tab. See https://docs.slack.dev/reference/methods/agents.conversations.setView */
511
536
  export const setView: API.OperationMethod<
512
537
  SetViewRequest,
513
538
  SetViewResponse,
@@ -519,6 +544,8 @@ export const setView: API.OperationMethod<
519
544
  errors: [SlackError, SlackRateLimited],
520
545
  protocol: SlackProtocol,
521
546
  retry: Retry.Retry,
547
+ telemetry: TELEMETRY,
548
+ span: "SetView",
522
549
  }));
523
550
 
524
551
  // Schema builders: each runs one schema initializer, on that schema's first use.
@@ -570,7 +597,6 @@ function __c3(j: number): any {
570
597
  case 0:
571
598
  return S.suspend(() =>
572
599
  S.Struct({
573
- connect_domains: S.optional(__S(96, __c12, 0)),
574
600
  resource_domains: S.optional(__S(96, __c12, 0)),
575
601
  }),
576
602
  ).annotate({ identifier: "SetViewRequestCsp" });
@@ -585,7 +611,6 @@ function __c3(j: number): any {
585
611
  canvas_id: S.optional(S.String),
586
612
  access_level: S.optional(S.String),
587
613
  agent_content_hash: S.optional(S.String),
588
- pr_url: S.optional(S.String),
589
614
  base_branch: S.optional(S.String),
590
615
  head_branch: S.optional(S.String),
591
616
  name: S.optional(S.String),
@@ -720,7 +745,7 @@ function __c7(j: number): any {
720
745
  return S.suspend(() =>
721
746
  S.Struct({
722
747
  ok: S.Boolean,
723
- title: S.optional(S.String),
748
+ title: S.String,
724
749
  channel_id: S.optional(S.String),
725
750
  }),
726
751
  ).annotate({ identifier: "RenameSessionResponse" });
@@ -837,7 +862,7 @@ function __c13(j: number): any {
837
862
  return S.suspend(() =>
838
863
  S.Struct({
839
864
  channel_id: S.optional(S.String),
840
- status: S.String,
865
+ status: S.Unknown,
841
866
  thread_ts: S.optional(S.String),
842
867
  title: S.optional(S.String),
843
868
  initiator_user_id: S.optional(S.String),
@@ -850,8 +875,8 @@ function __c13(j: number): any {
850
875
  return S.suspend(() =>
851
876
  S.Struct({
852
877
  ok: S.Boolean,
853
- status: S.optional(S.Unknown),
854
- agent_status: S.optional(S.Unknown),
878
+ status: S.Unknown,
879
+ agent_status: S.Unknown,
855
880
  title: S.optional(S.String),
856
881
  }),
857
882
  ).annotate({ identifier: "SetStatusResponse" });
@@ -11,15 +11,28 @@ const __s: any[] = [];
11
11
 
12
12
  export type { SlackOpError, SlackOpContext };
13
13
 
14
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
15
+ const TELEMETRY = {
16
+ system: "slack-api",
17
+ responseHeaders: [
18
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
19
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
20
+ { header: "x-slack-req-id", name: "http.response.header.x-slack-req-id", transform: "list" },
21
+ ],
22
+ prefix: "Slack",
23
+ service: "Api",
24
+ propagate: "w3c",
25
+ } as const;
26
+
14
27
  export interface TestApiRequest {
15
28
  /** Error response to return */
16
- error?: string;
29
+ error?: string | undefined;
17
30
  }
18
31
  export type TestApiResponseArgsMap = { [key: string]: unknown | undefined };
19
32
  export interface TestApiResponse {
20
33
  /** Always `true` (a failed call raises a typed error instead). */
21
34
  ok: boolean;
22
- args?: TestApiResponseArgsMap;
35
+ args?: TestApiResponseArgsMap | undefined;
23
36
  }
24
37
  export type TestApiError = SlackOpError;
25
38
  /** Checks API calling code. Rate limit tier: 4 See https://docs.slack.dev/reference/methods/api.test */
@@ -34,6 +47,8 @@ export const testApi: API.OperationMethod<
34
47
  errors: [SlackError, SlackRateLimited],
35
48
  protocol: SlackProtocol,
36
49
  retry: Retry.Retry,
50
+ telemetry: TELEMETRY,
51
+ span: "TestApi",
37
52
  }));
38
53
 
39
54
  // Schema builders: each runs one schema initializer, on that schema's first use.