@distilled.cloud/slack 1.0.0-rc.20 → 1.0.0-rc.22

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 (189) hide show
  1. package/README.md +2 -2
  2. package/lib/.lazy.json +1 -1
  3. package/lib/_bundle/sdk.js +1 -1
  4. package/lib/_bundle/sdk.js.map +1 -1
  5. package/lib/credentials.d.ts +6 -2
  6. package/lib/credentials.d.ts.map +1 -1
  7. package/lib/errors.d.ts +10 -0
  8. package/lib/errors.d.ts.map +1 -1
  9. package/lib/errors.js +1 -1
  10. package/lib/index.d.ts +0 -1
  11. package/lib/index.d.ts.map +1 -1
  12. package/lib/index.js +0 -1
  13. package/lib/pagination.d.ts.map +1 -1
  14. package/lib/protocol.d.ts +47 -12
  15. package/lib/protocol.d.ts.map +1 -1
  16. package/lib/retry.d.ts +1 -2
  17. package/lib/retry.d.ts.map +1 -1
  18. package/lib/services/admin.d.ts +268 -87
  19. package/lib/services/admin.d.ts.map +1 -1
  20. package/lib/services/admin.js +154 -149
  21. package/lib/services/admin.js.map +1 -1
  22. package/lib/services/agents.d.ts +54 -28
  23. package/lib/services/agents.d.ts.map +1 -1
  24. package/lib/services/agents.js +1 -1
  25. package/lib/services/agents.js.map +1 -1
  26. package/lib/services/api.d.ts.map +1 -1
  27. package/lib/services/api.js +1 -1
  28. package/lib/services/api.js.map +1 -1
  29. package/lib/services/apps.d.ts +69 -9
  30. package/lib/services/apps.d.ts.map +1 -1
  31. package/lib/services/apps.js +36 -34
  32. package/lib/services/apps.js.map +1 -1
  33. package/lib/services/assistant.d.ts +4 -1
  34. package/lib/services/assistant.d.ts.map +1 -1
  35. package/lib/services/assistant.js +1 -1
  36. package/lib/services/assistant.js.map +1 -1
  37. package/lib/services/auth.d.ts.map +1 -1
  38. package/lib/services/auth.js +1 -1
  39. package/lib/services/auth.js.map +1 -1
  40. package/lib/services/blocks.d.ts.map +1 -1
  41. package/lib/services/blocks.js +1 -1
  42. package/lib/services/blocks.js.map +1 -1
  43. package/lib/services/bookmarks.d.ts.map +1 -1
  44. package/lib/services/bookmarks.js +1 -1
  45. package/lib/services/bookmarks.js.map +1 -1
  46. package/lib/services/bots.d.ts.map +1 -1
  47. package/lib/services/bots.js +1 -1
  48. package/lib/services/bots.js.map +1 -1
  49. package/lib/services/calls.d.ts.map +1 -1
  50. package/lib/services/calls.js +1 -1
  51. package/lib/services/calls.js.map +1 -1
  52. package/lib/services/canvases.d.ts +1 -1
  53. package/lib/services/canvases.d.ts.map +1 -1
  54. package/lib/services/canvases.js +1 -1
  55. package/lib/services/canvases.js.map +1 -1
  56. package/lib/services/chat.d.ts.map +1 -1
  57. package/lib/services/chat.js +1 -1
  58. package/lib/services/chat.js.map +1 -1
  59. package/lib/services/conversations.d.ts +5 -5
  60. package/lib/services/conversations.d.ts.map +1 -1
  61. package/lib/services/conversations.js +39 -39
  62. package/lib/services/conversations.js.map +1 -1
  63. package/lib/services/dialog.d.ts.map +1 -1
  64. package/lib/services/dialog.js +1 -1
  65. package/lib/services/dialog.js.map +1 -1
  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.map +1 -1
  70. package/lib/services/emoji.js +1 -1
  71. package/lib/services/emoji.js.map +1 -1
  72. package/lib/services/entity.d.ts.map +1 -1
  73. package/lib/services/entity.js +1 -1
  74. package/lib/services/entity.js.map +1 -1
  75. package/lib/services/files.d.ts +1 -1
  76. package/lib/services/files.d.ts.map +1 -1
  77. package/lib/services/files.js +28 -28
  78. package/lib/services/files.js.map +1 -1
  79. package/lib/services/functions.d.ts.map +1 -1
  80. package/lib/services/functions.js +1 -1
  81. package/lib/services/functions.js.map +1 -1
  82. package/lib/services/index.d.ts.map +1 -1
  83. package/lib/services/lists.d.ts.map +1 -1
  84. package/lib/services/lists.js +1 -1
  85. package/lib/services/lists.js.map +1 -1
  86. package/lib/services/migration.d.ts.map +1 -1
  87. package/lib/services/migration.js +1 -1
  88. package/lib/services/migration.js.map +1 -1
  89. package/lib/services/oauth.d.ts +6 -6
  90. package/lib/services/oauth.d.ts.map +1 -1
  91. package/lib/services/oauth.js +1 -1
  92. package/lib/services/oauth.js.map +1 -1
  93. package/lib/services/openid.d.ts +2 -2
  94. package/lib/services/openid.d.ts.map +1 -1
  95. package/lib/services/openid.js +1 -1
  96. package/lib/services/openid.js.map +1 -1
  97. package/lib/services/pins.d.ts.map +1 -1
  98. package/lib/services/pins.js +1 -1
  99. package/lib/services/pins.js.map +1 -1
  100. package/lib/services/reactions.d.ts.map +1 -1
  101. package/lib/services/reactions.js +1 -1
  102. package/lib/services/reactions.js.map +1 -1
  103. package/lib/services/reminders.d.ts.map +1 -1
  104. package/lib/services/reminders.js +1 -1
  105. package/lib/services/reminders.js.map +1 -1
  106. package/lib/services/rtm.d.ts.map +1 -1
  107. package/lib/services/rtm.js +1 -1
  108. package/lib/services/rtm.js.map +1 -1
  109. package/lib/services/search.d.ts.map +1 -1
  110. package/lib/services/search.js +1 -1
  111. package/lib/services/search.js.map +1 -1
  112. package/lib/services/slackbot.d.ts +299 -7
  113. package/lib/services/slackbot.d.ts.map +1 -1
  114. package/lib/services/slackbot.js +1 -1
  115. package/lib/services/slackbot.js.map +1 -1
  116. package/lib/services/stars.d.ts.map +1 -1
  117. package/lib/services/stars.js +1 -1
  118. package/lib/services/stars.js.map +1 -1
  119. package/lib/services/team.d.ts +1 -1
  120. package/lib/services/team.d.ts.map +1 -1
  121. package/lib/services/team.js +1 -1
  122. package/lib/services/team.js.map +1 -1
  123. package/lib/services/tooling.d.ts +1 -1
  124. package/lib/services/tooling.d.ts.map +1 -1
  125. package/lib/services/tooling.js +1 -1
  126. package/lib/services/tooling.js.map +1 -1
  127. package/lib/services/usergroups.d.ts.map +1 -1
  128. package/lib/services/usergroups.js +1 -1
  129. package/lib/services/usergroups.js.map +1 -1
  130. package/lib/services/users.d.ts +73 -1
  131. package/lib/services/users.d.ts.map +1 -1
  132. package/lib/services/users.js +1 -1
  133. package/lib/services/users.js.map +1 -1
  134. package/lib/services/views.d.ts.map +1 -1
  135. package/lib/services/views.js +1 -1
  136. package/lib/services/views.js.map +1 -1
  137. package/lib/services/workflows.d.ts +4 -4
  138. package/lib/services/workflows.d.ts.map +1 -1
  139. package/lib/services/workflows.js +1 -1
  140. package/lib/services/workflows.js.map +1 -1
  141. package/lib/services.lazy/admin.js +2 -2
  142. package/lib/services.lazy/apps.js +2 -2
  143. package/lib/services.lazy/conversations.js +1 -1
  144. package/lib/services.lazy/files.js +1 -1
  145. package/lib/traits.d.ts.map +1 -1
  146. package/package.json +6 -7
  147. package/src/credentials.ts +20 -15
  148. package/src/errors.ts +12 -1
  149. package/src/index.ts +0 -1
  150. package/src/protocol.ts +96 -86
  151. package/src/retry.ts +1 -2
  152. package/src/services/admin.ts +1527 -955
  153. package/src/services/agents.ts +110 -50
  154. package/src/services/api.ts +3 -2
  155. package/src/services/apps.ts +307 -136
  156. package/src/services/assistant.ts +17 -8
  157. package/src/services/auth.ts +7 -4
  158. package/src/services/blocks.ts +3 -2
  159. package/src/services/bookmarks.ts +9 -5
  160. package/src/services/bots.ts +3 -2
  161. package/src/services/calls.ts +13 -7
  162. package/src/services/canvases.ts +16 -9
  163. package/src/services/chat.ts +27 -14
  164. package/src/services/conversations.ts +62 -34
  165. package/src/services/dialog.ts +3 -2
  166. package/src/services/dnd.ts +11 -6
  167. package/src/services/emoji.ts +3 -2
  168. package/src/services/entity.ts +7 -4
  169. package/src/services/files.ts +32 -17
  170. package/src/services/functions.ts +17 -9
  171. package/src/services/lists.ts +25 -13
  172. package/src/services/migration.ts +3 -2
  173. package/src/services/oauth.ts +23 -17
  174. package/src/services/openid.ts +8 -6
  175. package/src/services/pins.ts +7 -4
  176. package/src/services/reactions.ts +9 -5
  177. package/src/services/reminders.ts +11 -6
  178. package/src/services/rtm.ts +5 -3
  179. package/src/services/search.ts +7 -4
  180. package/src/services/slackbot.ts +700 -74
  181. package/src/services/stars.ts +7 -4
  182. package/src/services/team.ts +20 -11
  183. package/src/services/tooling.ts +5 -4
  184. package/src/services/usergroups.ts +15 -8
  185. package/src/services/users.ts +136 -17
  186. package/src/services/views.ts +9 -5
  187. package/src/services/workflows.ts +21 -13
  188. package/lib/index.lazy.js +0 -7
  189. package/lib/index.lazy.js.map +0 -1
@@ -2,7 +2,7 @@ import * as API from "@distilled.cloud/core/api";
2
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
3
3
  import * as S from "@distilled.cloud/core/schema-lite";
4
4
  import * as __L from "@distilled.cloud/core/schema-lite";
5
- import { SlackError, SlackRateLimited } from "../errors.ts";
5
+ import { SlackServiceErrors } from "../errors.ts";
6
6
  import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
7
7
  import * as Retry from "../retry.ts";
8
8
  import * as T from "../traits.ts";
@@ -115,6 +115,28 @@ export interface ListViewsRequest {
115
115
  /** ID of the code channel to list views for. */
116
116
  channel_id: string;
117
117
  }
118
+ export interface ListViewsResponseSessionViewsItem {
119
+ /** The encoded channel tab ID of the view. For the Code tab diff (a `diff` with no `view_key`) this is always `code`; a keyed diff has its own tab ID. For a `pull_request` view it is the tab's ID, or `pr-` followed by 16 hexadecimal characters. */
120
+ view_id: string;
121
+ /** The type of the view: `html`, `diff`, `block_kit`, `canvas`, `list`, or `pull_request`. */
122
+ type: string;
123
+ /** The agent-assigned stable key of the view. Absent for the Code tab diff, `canvas` views, and `list` views. */
124
+ view_key?: string | undefined;
125
+ /** The display label of the view tab, when one is stored. */
126
+ name?: string | undefined;
127
+ /** The encoded ID of the backing file, of the canvas itself for a `canvas` view, or of the list itself for a `list` view. Absent for `pull_request` views. */
128
+ file_id?: string | undefined;
129
+ /** For `pull_request` views, the stored pull request URL in canonical form. */
130
+ pr_url?: string | undefined;
131
+ /** The user ID of the agent bot that created the view, and the only one that can update it. It is also the only one that can remove it, except for `canvas` and `list` views, which any of the channel's agent bots can remove. Absent when any of the channel's agent bots can update the view, such as the Code tab diff. */
132
+ owner_bot_user_id?: string | undefined;
133
+ /** The current content version of the view. */
134
+ content_version: number;
135
+ /** Unix timestamp of when the view was first created, or `0` when unknown. */
136
+ date_added: number;
137
+ }
138
+ /** Every view attached to the channel, of every type (`html`, `diff`, `block_kit`, `canvas`, `list`, and `pull_request`), in creation order. Fields that don't apply to a view are absent. */
139
+ export type ListViewsResponseSessionViewsList = Array<ListViewsResponseSessionViewsItem>;
118
140
  export interface ListViewsResponseViewsItem {
119
141
  /** The encoded channel tab ID of the view. */
120
142
  view_id: string;
@@ -129,20 +151,22 @@ export interface ListViewsResponseViewsItem {
129
151
  /** Unix timestamp of when the view was first created. */
130
152
  date_added: number;
131
153
  }
132
- /** The agent views attached to the channel, in creation order. */
154
+ /** Legacy list of the channel's `html` views only, in creation order. Use `session_views` instead. */
133
155
  export type ListViewsResponseViewsList = Array<ListViewsResponseViewsItem>;
134
156
  export interface ListViewsResponse {
135
157
  /** Always `true` (a failed call raises a typed error instead). */
136
158
  ok: boolean;
137
- /** The agent views attached to the channel, in creation order. */
159
+ /** Every view attached to the channel, of every type (`html`, `diff`, `block_kit`, `canvas`, `list`, and `pull_request`), in creation order. Fields that don't apply to a view are absent. */
160
+ session_views: ListViewsResponseSessionViewsList;
161
+ /** Legacy list of the channel's `html` views only, in creation order. Use `session_views` instead. */
138
162
  views: ListViewsResponseViewsList;
139
163
  }
140
164
  export interface RemoveViewRequest {
141
165
  /** ID of the code channel to remove the view from. */
142
166
  channel_id: string;
143
- /** Agent-assigned key of the view to remove. Provide exactly one of view_key or view_id. */
167
+ /** Agent-assigned key of the view to remove. For a `canvas` or `list` view, pass the canvas or list ID. The Code tab diff has no `view_key`, so this never removes it. Provide exactly one of view_key or view_id. */
144
168
  view_key?: string | undefined;
145
- /** Encoded channel tab ID of the view to remove. Provide exactly one of view_key or view_id. */
169
+ /** Encoded channel tab ID of the view to remove, as returned by `agents.conversations.setView` or `agents.conversations.listViews`. The Code tab diff's ID is always `code`; a keyed diff's ID is its tab's ID. Provide exactly one of view_key or view_id. */
146
170
  view_id?: string | undefined;
147
171
  }
148
172
  export interface RemoveViewResponse {
@@ -203,6 +227,14 @@ export interface SetCommandsResponse {
203
227
  }
204
228
  /** New status for the agent session. */
205
229
  export type SetPropertiesRequestStatus = "active" | "processing" | "suspended" | "closed";
230
+ /** The PR status of the channel as a whole, a rollup of all of its pull requests. Your app sets it; Slack never changes it. One of: `open`, when a pull request is ready for review; `draft`, when the open pull requests are drafts; `blocked`, when an open pull request needs the user, for example because a reviewer requested changes, checks are failing, or it has merge conflicts; `merged`, once the work has merged and no pull request is still open; or `closed`, when every pull request was closed without merging. An empty string clears the status. To show a pull request itself, add a `pull_request` view with the `agents.conversations.setView` API method. */
231
+ export type SetPropertiesRequestCodeChannelPrStatus =
232
+ | "open"
233
+ | "draft"
234
+ | "merged"
235
+ | "closed"
236
+ | "blocked"
237
+ | "";
206
238
  /** List of file paths relevant to this session. */
207
239
  export type SetPropertiesRequestCodeChannelFilePathsList = Array<string>;
208
240
  /** 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. */
@@ -226,18 +258,8 @@ export interface SetPropertiesRequestCodeChannel {
226
258
  base_branch?: string | undefined;
227
259
  /** Current commit SHA. */
228
260
  commit_sha?: string | undefined;
229
- /** Pull request number. */
230
- pr_number?: number | undefined;
231
- /** URL of the pull request. */
232
- pr_url?: string | undefined;
233
- /** Title of the pull request. */
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;
237
- /** URL to the CI pipeline run. */
238
- ci_url?: string | undefined;
239
- /** State of the CI pipeline (e.g. pending, success, failure). */
240
- ci_state?: string | undefined;
261
+ /** The PR status of the channel as a whole, a rollup of all of its pull requests. Your app sets it; Slack never changes it. One of: `open`, when a pull request is ready for review; `draft`, when the open pull requests are drafts; `blocked`, when an open pull request needs the user, for example because a reviewer requested changes, checks are failing, or it has merge conflicts; `merged`, once the work has merged and no pull request is still open; or `closed`, when every pull request was closed without merging. An empty string clears the status. To show a pull request itself, add a `pull_request` view with the `agents.conversations.setView` API method. */
262
+ pr_status?: SetPropertiesRequestCodeChannelPrStatus | (string & {}) | undefined;
241
263
  /** List of file paths relevant to this session. */
242
264
  file_paths?: SetPropertiesRequestCodeChannelFilePathsList | undefined;
243
265
  /** Primary programming language. */
@@ -320,27 +342,33 @@ export interface SetViewRequestCsp {
320
342
  export interface SetViewRequest {
321
343
  /** ID of the code channel to render the view in. */
322
344
  channel_id: string;
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`. */
345
+ /** The kind of view to create or update: `html`, `diff`, `block_kit`, `canvas`, `list`, or `pull_request`. Defaults to `html`. Determines which other arguments are required: `html` requires exactly one of `content` or `file_id`, `diff` requires `content`, `block_kit` requires `blocks`, `canvas` requires `canvas_id`, `list` requires `list_id`, and `pull_request` requires `pr_url` and `view_key`. */
324
346
  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). */
347
+ /** Agent-assigned stable identity for the view (for example, the source file path on the agent's machine, or `owner/repo#number` for a pull request). Used as the upsert key: calls with the same `view_key` and `type` update the same view. Required for `html`, `block_kit`, and `pull_request` views. Optional for `diff`: omit it to write the channel's Code tab diff, or pass one to create or update a keyed diff with its own tab. Ignored for `canvas` and `list` (the canvas or list identifies the view). */
326
348
  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`. */
349
+ /** 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 `diff`. For `html`, pass exactly one of `content` or `file_id`. */
328
350
  content?: string | undefined;
351
+ /** For `html` views: ID of an HTML file your bot uploaded, attached as the view instead of `content`. Subject to the same 1,000,000 byte cap as `content`, and can't be combined with `csp`. Your app owns the file: to change the view, upload a new file and call again with the same `view_key`. Ignored for other view types. */
352
+ file_id?: string | undefined;
329
353
  /** Block Kit blocks to render in the view tab. Required when `type` is `block_kit`; ignored otherwise. */
330
354
  blocks?: unknown | undefined;
331
355
  /** Encoded ID of the canvas to attach as the view. Required when `type` is `canvas`; ignored otherwise. */
332
356
  canvas_id?: string | undefined;
357
+ /** Encoded ID of the Slack List to attach as the view. Required when `type` is `list`; ignored otherwise. The list must be one the calling agent created or one already shared in the channel. If the list already has a tab in the channel, that tab is reused and keeps its access level. */
358
+ list_id?: string | undefined;
359
+ /** For `pull_request` views: URL of the pull request to show, such as `https://github.com/borant/billing/pull/42`. Must be a pull request on `github.com`. Slack stores it in canonical form. Required when `type` is `pull_request`; ignored otherwise. */
360
+ pr_url?: string | undefined;
333
361
  /** 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
362
  access_level?: SetViewRequestAccessLevel | (string & {}) | undefined;
335
363
  /** 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
364
  agent_content_hash?: string | undefined;
337
- /** For `diff` views: base branch name for display purposes. */
365
+ /** For `diff` views: base branch name for display purposes. With no `view_key`, it is the channel's base branch; with a `view_key`, it is stored on that diff only. If omitted, a keyed diff keeps its stored branch, or shows the channel's. An empty string clears a keyed diff's stored branch, so it shows the channel's. */
338
366
  base_branch?: string | undefined;
339
- /** For `diff` views: head branch name for display purposes. */
367
+ /** For `diff` views: head branch name for display purposes. With no `view_key`, it is the channel's head branch; with a `view_key`, it is stored on that diff only. If omitted, a keyed diff keeps its stored branch, or shows the channel's. An empty string clears a keyed diff's stored branch, so it shows the channel's. */
340
368
  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. */
369
+ /** Display label for the view tab. Preferred over the legacy `label` argument (`name` wins if both are supplied). For `html`, `block_kit`, and `pull_request` views, defaults to the last path segment of `view_key`, stripped of any `.html` or `.htm` extension; a keyed diff defaults to `Diff`. For `canvas` and `list` views there is no default: without a `name`, the tab shows the canvas or list's own title. Ignored for the Code tab diff (a `diff` with no `view_key`). */
342
370
  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. */
371
+ /** 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; a keyed diff defaults to `Diff`. */
344
372
  label?: string | undefined;
345
373
  /** Content-Security-Policy domain declarations for the view. Domains are validated server-side (`https://` only, no private or internal hosts) and persisted. */
346
374
  csp?: SetViewRequestCsp | undefined;
@@ -350,16 +378,20 @@ export interface SetViewResponse {
350
378
  ok: boolean;
351
379
  /** The encoded ID of the code channel the view belongs to. */
352
380
  channel_id: string;
353
- /** The encoded channel tab ID of the view. */
381
+ /** The encoded channel tab ID of the view. For the Code tab diff (a `diff` with no `view_key`) this is always `code`; a keyed diff gets its own tab ID. For `pull_request` views it is the tab's ID, or `pr-` followed by 16 hexadecimal characters. */
354
382
  view_id: string;
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`). */
383
+ /** The encoded ID of the backing file for the view. For `html` and `block_kit` views this is the agent-owned content file (for an `html` view attached by `file_id`, that 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`); for `list` views it is the list's file ID (same value as `list_id`). For `pull_request` views, which have no backing file, it is an empty string. */
356
384
  file_id: string;
385
+ /** For `pull_request` views, the stored pull request URL in canonical form. Absent for other view types. */
386
+ pr_url?: string | undefined;
357
387
  /** Server-assigned content version, monotonically increasing per view. */
358
388
  content_version: number;
359
389
  /** The type of the view that was created or updated. */
360
390
  type?: unknown | undefined;
361
391
  /** For `canvas` views, the encoded ID of the attached canvas. Absent for other view types. */
362
392
  canvas_id?: string | undefined;
393
+ /** For `list` views, the encoded ID of the attached Slack List. Absent for other view types. */
394
+ list_id?: string | undefined;
363
395
  }
364
396
  export type ArchiveConversationError = SlackOpError;
365
397
  /** 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 */
@@ -371,7 +403,8 @@ export const archiveConversation: API.OperationMethod<
371
403
  > = /*@__PURE__*/ API.make(() => ({
372
404
  input: __S(0, __c0, 0) as any as S.Schema<ArchiveConversationRequest>,
373
405
  output: __S(1, __c0, 1) as any as S.Schema<ArchiveConversationResponse>,
374
- errors: [SlackError, SlackRateLimited],
406
+ errors: [],
407
+ serviceErrors: SlackServiceErrors,
375
408
  protocol: SlackProtocol,
376
409
  retry: Retry.Retry,
377
410
  telemetry: TELEMETRY,
@@ -388,7 +421,8 @@ export const createConversation: API.OperationMethod<
388
421
  > = /*@__PURE__*/ API.make(() => ({
389
422
  input: __S(8, __c1, 0) as any as S.Schema<CreateConversationRequest>,
390
423
  output: __S(16, __c2, 0) as any as S.Schema<CreateConversationResponse>,
391
- errors: [SlackError, SlackRateLimited],
424
+ errors: [],
425
+ serviceErrors: SlackServiceErrors,
392
426
  protocol: SlackProtocol,
393
427
  retry: Retry.Retry,
394
428
  telemetry: TELEMETRY,
@@ -405,7 +439,8 @@ export const getCanvas: API.OperationMethod<
405
439
  > = /*@__PURE__*/ API.make(() => ({
406
440
  input: __S(32, __c4, 0) as any as S.Schema<GetCanvasRequest>,
407
441
  output: __S(37, __c4, 5) as any as S.Schema<GetCanvasResponse>,
408
- errors: [SlackError, SlackRateLimited],
442
+ errors: [],
443
+ serviceErrors: SlackServiceErrors,
409
444
  protocol: SlackProtocol,
410
445
  retry: Retry.Retry,
411
446
  telemetry: TELEMETRY,
@@ -421,8 +456,9 @@ export const listViews: API.OperationMethod<
421
456
  SlackOpContext
422
457
  > = /*@__PURE__*/ API.make(() => ({
423
458
  input: __S(40, __c5, 0) as any as S.Schema<ListViewsRequest>,
424
- output: __S(43, __c5, 3) as any as S.Schema<ListViewsResponse>,
425
- errors: [SlackError, SlackRateLimited],
459
+ output: __S(45, __c5, 5) as any as S.Schema<ListViewsResponse>,
460
+ errors: [],
461
+ serviceErrors: SlackServiceErrors,
426
462
  protocol: SlackProtocol,
427
463
  retry: Retry.Retry,
428
464
  telemetry: TELEMETRY,
@@ -430,7 +466,7 @@ export const listViews: API.OperationMethod<
430
466
  }));
431
467
 
432
468
  export type RemoveViewError = SlackOpError;
433
- /** Remove a view from 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. - `view_not_found` -- No agent view matches the supplied view_key or view_id in this channel. - `not_view_owner` -- The view was created by a different agent bot; only its owner may remove it. - `invalid_arguments` -- Exactly one of view_key or view_id must be provided. - `view_remove_failed` -- The view's tab or channel properties could not be updated. Safe to retry. See https://docs.slack.dev/reference/methods/agents.conversations.removeView */
469
+ /** Remove a view from 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. - `view_not_found` -- No agent view matches the supplied view_key or view_id in this channel. - `not_view_owner` -- The view was created by a different agent bot; only its owner may remove it. Any of the channel's agent bots can remove the Code tab diff, a `canvas` or `list` view, or a view with no recorded owner. - `invalid_arguments` -- Exactly one of view_key or view_id must be provided. - `ambiguous_view_key` -- More than one view in the channel has this `view_key` (keys are unique only within a view type). Nothing was removed. Pass the view's `view_id` instead. - `view_remove_failed` -- The view's tab or channel properties could not be updated. Safe to retry. See https://docs.slack.dev/reference/methods/agents.conversations.removeView */
434
470
  export const removeView: API.OperationMethod<
435
471
  RemoveViewRequest,
436
472
  RemoveViewResponse,
@@ -439,7 +475,8 @@ export const removeView: API.OperationMethod<
439
475
  > = /*@__PURE__*/ API.make(() => ({
440
476
  input: __S(48, __c6, 0) as any as S.Schema<RemoveViewRequest>,
441
477
  output: __S(49, __c6, 1) as any as S.Schema<RemoveViewResponse>,
442
- errors: [SlackError, SlackRateLimited],
478
+ errors: [],
479
+ serviceErrors: SlackServiceErrors,
443
480
  protocol: SlackProtocol,
444
481
  retry: Retry.Retry,
445
482
  telemetry: TELEMETRY,
@@ -456,7 +493,8 @@ export const renameSession: API.OperationMethod<
456
493
  > = /*@__PURE__*/ API.make(() => ({
457
494
  input: __S(56, __c7, 0) as any as S.Schema<RenameSessionRequest>,
458
495
  output: __S(57, __c7, 1) as any as S.Schema<RenameSessionResponse>,
459
- errors: [SlackError, SlackRateLimited],
496
+ errors: [],
497
+ serviceErrors: SlackServiceErrors,
460
498
  protocol: SlackProtocol,
461
499
  retry: Retry.Retry,
462
500
  telemetry: TELEMETRY,
@@ -473,7 +511,8 @@ export const setCanvasContent: API.OperationMethod<
473
511
  > = /*@__PURE__*/ API.make(() => ({
474
512
  input: __S(64, __c8, 0) as any as S.Schema<SetCanvasContentRequest>,
475
513
  output: __S(65, __c8, 1) as any as S.Schema<SetCanvasContentResponse>,
476
- errors: [SlackError, SlackRateLimited],
514
+ errors: [],
515
+ serviceErrors: SlackServiceErrors,
477
516
  protocol: SlackProtocol,
478
517
  retry: Retry.Retry,
479
518
  telemetry: TELEMETRY,
@@ -490,7 +529,8 @@ export const setCommands: API.OperationMethod<
490
529
  > = /*@__PURE__*/ API.make(() => ({
491
530
  input: __S(72, __c9, 0) as any as S.Schema<SetCommandsRequest>,
492
531
  output: __S(73, __c9, 1) as any as S.Schema<SetCommandsResponse>,
493
- errors: [SlackError, SlackRateLimited],
532
+ errors: [],
533
+ serviceErrors: SlackServiceErrors,
494
534
  protocol: SlackProtocol,
495
535
  retry: Retry.Retry,
496
536
  telemetry: TELEMETRY,
@@ -498,7 +538,7 @@ export const setCommands: API.OperationMethod<
498
538
  }));
499
539
 
500
540
  export type SetPropertiesError = SlackOpError;
501
- /** Set properties on 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. - `invalid_status` -- Value passed for `status` was not a valid agent session status. - `invalid_title` -- Value passed for `title` was invalid. - `no_properties_provided` -- At least one property field must be provided. See https://docs.slack.dev/reference/methods/agents.conversations.setProperties */
541
+ /** Set properties on 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. - `invalid_status` -- Value passed for `status` was not a valid agent session status. - `invalid_title` -- Value passed for `title` was invalid. - `no_properties_provided` -- At least one property field must be provided. - `invalid_pr_status` -- Value passed for `code_channel.pr_status` was not one of `open`, `draft`, `merged`, `closed`, `blocked`, or an empty string. Nothing in the call was saved. - `invalid_arguments` -- The call included a field that isn't accepted, such as `code_channel.pr_url`, `pr_number`, `pr_title`, `ci_url`, or `ci_state`. To show a pull request, add a `pull_request` view with the `agents.conversations.setView` API method. - `pr_link_failed` -- The properties were saved, but Slack couldn't update the channel's links to its pull requests, which route their GitHub activity to the channel. Nothing is rolled back; repeat the same call. See https://docs.slack.dev/reference/methods/agents.conversations.setProperties */
502
542
  export const setProperties: API.OperationMethod<
503
543
  SetPropertiesRequest,
504
544
  SetPropertiesResponse,
@@ -507,7 +547,8 @@ export const setProperties: API.OperationMethod<
507
547
  > = /*@__PURE__*/ API.make(() => ({
508
548
  input: __S(91, __c11, 3) as any as S.Schema<SetPropertiesRequest>,
509
549
  output: __S(16, __c2, 0) as any as S.Schema<SetPropertiesResponse>,
510
- errors: [SlackError, SlackRateLimited],
550
+ errors: [],
551
+ serviceErrors: SlackServiceErrors,
511
552
  protocol: SlackProtocol,
512
553
  retry: Retry.Retry,
513
554
  telemetry: TELEMETRY,
@@ -524,7 +565,8 @@ export const setStatus: API.OperationMethod<
524
565
  > = /*@__PURE__*/ API.make(() => ({
525
566
  input: __S(104, __c13, 0) as any as S.Schema<SetStatusRequest>,
526
567
  output: __S(105, __c13, 1) as any as S.Schema<SetStatusResponse>,
527
- errors: [SlackError, SlackRateLimited],
568
+ errors: [],
569
+ serviceErrors: SlackServiceErrors,
528
570
  protocol: SlackProtocol,
529
571
  retry: Retry.Retry,
530
572
  telemetry: TELEMETRY,
@@ -532,7 +574,7 @@ export const setStatus: API.OperationMethod<
532
574
  }));
533
575
 
534
576
  export type SetViewError = SlackOpError;
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 */
577
+ /** 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, from `content` or the bytes of the `file_id` file, exceeds the maximum allowed size (1 MB). - `too_many_views` -- The channel already has the maximum number of views other than `pull_request` views (10), counting the Code tab diff and keyed diffs, or is in a workspace on a free plan and already has an `html` view (at most 1 is allowed). - `too_many_pull_request_views` -- The channel already has the maximum number of `pull_request` views (10). Remove one with the `agents.conversations.removeView` API method before adding another. - `invalid_pr_url` -- The supplied `pr_url` is not a pull request URL. - `unsupported_pr_host` -- The supplied `pr_url` is not on a supported host. Only `github.com` pull requests are supported. - `pr_link_failed` -- The view was saved, but Slack couldn't update the channel's link to the pull request, which routes its GitHub activity to the channel. Nothing is rolled back; repeat the same call. A repeated call that writes nothing still updates the link, so it can also return this error. - `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, or `pull_request` views aren't available in the workspace yet. - `missing_required_arg` -- A required argument for the supplied view type is missing (`content` or `file_id` for `html`, `content` for `diff`, `blocks` for `block_kit`, `canvas_id` for `canvas`, `list_id` for `list`, `pr_url` or `view_key` for `pull_request`). Blank `content` also returns this error when it would create a keyed diff. - `content_file_id_conflict` -- Both `content` and `file_id` were supplied for an `html` view. Pass exactly one of them. - `file_not_found` -- The `file_id` does not correspond to a live file on this team that the calling bot uploaded, or the file is quarantined (tombstoned or restricted). - `file_not_ready` -- The `file_id` file's upload is still processing, or is held for DLP review on an org that scans every upload. Retry the call shortly; it's safe to repeat. A file that DLP blocks keeps returning this error, so cap your retries. - `file_sharing_blocked` -- The `file_id` file can't be shared to this channel, for example because of the file's sharing restrictions or the channel's Slack Connect file policy. - `invalid_file_type` -- The `file_id` file is not an HTML file the calling bot uploaded, or is another view's backing file. Upload the document with an `.html` filename or a `text/html` type. - `file_already_attached` -- The `file_id` file is already attached to a view or tab in this channel under another `view_key`. Upload a separate file for each view. - `view_source_conflict` -- The `view_key` names a view created the other way: `content` was passed for a view attached by `file_id`, or `file_id` for a view created with `content`. Remove the view first, or use another `view_key`. - `csp_file_id_conflict` -- `csp` was supplied with `file_id`. A view attached by reference renders with the default Content-Security-Policy. - `invalid_file_encoding` -- The `file_id` file's contents are not valid UTF-8. - `file_empty` -- The `file_id` file has no contents. Upload a non-empty HTML document. - `file_content_fetch_failed` -- The `file_id` file's contents couldn't be read. Retry the call; it's safe to repeat. - `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. - `list_not_found` -- The specified `list_id` does not correspond to a Slack List you can access, or the list is not one this agent created or one already shared in the channel. - `file_editing_disabled` -- The org has disabled file editing, so `html`, `diff`, and `block_kit` views can't be created or updated. `canvas` and `list` views are unaffected. - `not_view_owner` -- The view already exists and was created by a different agent bot; only its owner may update it. A keyed diff has an owner too. Any of the channel's agent bots can update the Code tab diff (a `diff` with no `view_key`). - `view_creation_failed` -- The view could not be created as a channel tab, for example because the channel already has the maximum number of tabs (15). The tabs of `html`, `block_kit`, `list`, and keyed diff views count toward that limit, along with tabs people add. - `properties_update_failed` -- The `diff` couldn't be saved because other writes to the channel kept conflicting with it. Safe to retry. - `canvas_tab_creation_failed` -- The canvas could not be added as a channel tab, for example because the channel already has the maximum number of tabs (15). - `free_team_canvas_tab_already_exists` -- The channel is in a workspace on a free plan and already has a canvas tab (at most 1 is allowed). See https://docs.slack.dev/reference/methods/agents.conversations.setView */
536
578
  export const setView: API.OperationMethod<
537
579
  SetViewRequest,
538
580
  SetViewResponse,
@@ -541,7 +583,8 @@ export const setView: API.OperationMethod<
541
583
  > = /*@__PURE__*/ API.make(() => ({
542
584
  input: __S(25, __c3, 1) as any as S.Schema<SetViewRequest>,
543
585
  output: __S(26, __c3, 2) as any as S.Schema<SetViewResponse>,
544
- errors: [SlackError, SlackRateLimited],
586
+ errors: [],
587
+ serviceErrors: SlackServiceErrors,
545
588
  protocol: SlackProtocol,
546
589
  retry: Retry.Retry,
547
590
  telemetry: TELEMETRY,
@@ -607,8 +650,11 @@ function __c3(j: number): any {
607
650
  type: S.optional(S.Unknown),
608
651
  view_key: S.optional(S.String),
609
652
  content: S.optional(S.String),
653
+ file_id: S.optional(S.String),
610
654
  blocks: S.optional(S.Unknown),
611
655
  canvas_id: S.optional(S.String),
656
+ list_id: S.optional(S.String),
657
+ pr_url: S.optional(S.String),
612
658
  access_level: S.optional(S.String),
613
659
  agent_content_hash: S.optional(S.String),
614
660
  base_branch: S.optional(S.String),
@@ -625,9 +671,11 @@ function __c3(j: number): any {
625
671
  channel_id: S.String,
626
672
  view_id: S.String,
627
673
  file_id: S.String,
674
+ pr_url: S.optional(S.String),
628
675
  content_version: S.Number,
629
676
  type: S.optional(S.Unknown),
630
677
  canvas_id: S.optional(S.String),
678
+ list_id: S.optional(S.String),
631
679
  }),
632
680
  ).annotate({ identifier: "SetViewResponse" });
633
681
  }
@@ -690,6 +738,22 @@ function __c5(j: number): any {
690
738
  }).pipe(T.Http({ method: "POST", uri: "/agents.conversations.listViews", code: 200 })),
691
739
  ).annotate({ identifier: "ListViewsRequest" });
692
740
  case 1:
741
+ return S.suspend(() =>
742
+ S.Struct({
743
+ view_id: S.String,
744
+ type: S.String,
745
+ view_key: S.optional(S.String),
746
+ name: S.optional(S.String),
747
+ file_id: S.optional(S.String),
748
+ pr_url: S.optional(S.String),
749
+ owner_bot_user_id: S.optional(S.String),
750
+ content_version: S.Number,
751
+ date_added: S.Number,
752
+ }),
753
+ ).annotate({ identifier: "ListViewsResponseSessionViewsItem" });
754
+ case 2:
755
+ return S.Array(__S(41, __c5, 1));
756
+ case 3:
693
757
  return S.suspend(() =>
694
758
  S.Struct({
695
759
  view_id: S.String,
@@ -700,13 +764,14 @@ function __c5(j: number): any {
700
764
  date_added: S.Number,
701
765
  }),
702
766
  ).annotate({ identifier: "ListViewsResponseViewsItem" });
703
- case 2:
704
- return S.Array(__S(41, __c5, 1));
705
- case 3:
767
+ case 4:
768
+ return S.Array(__S(43, __c5, 3));
769
+ case 5:
706
770
  return S.suspend(() =>
707
771
  S.Struct({
708
772
  ok: S.Boolean,
709
- views: __S(42, __c5, 2),
773
+ session_views: __S(42, __c5, 2),
774
+ views: __S(44, __c5, 4),
710
775
  }),
711
776
  ).annotate({ identifier: "ListViewsResponse" });
712
777
  }
@@ -815,12 +880,7 @@ function __c11(j: number): any {
815
880
  branch: S.optional(S.String),
816
881
  base_branch: S.optional(S.String),
817
882
  commit_sha: S.optional(S.String),
818
- pr_number: S.optional(S.Number),
819
- pr_url: S.optional(S.String),
820
- pr_title: S.optional(S.String),
821
883
  pr_status: S.optional(S.String),
822
- ci_url: S.optional(S.String),
823
- ci_state: S.optional(S.String),
824
884
  file_paths: S.optional(__S(96, __c12, 0)),
825
885
  language: S.optional(S.String),
826
886
  upstream_url: S.optional(S.String),
@@ -2,7 +2,7 @@ import * as API from "@distilled.cloud/core/api";
2
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
3
3
  import * as S from "@distilled.cloud/core/schema-lite";
4
4
  import * as __L from "@distilled.cloud/core/schema-lite";
5
- import { SlackError, SlackRateLimited } from "../errors.ts";
5
+ import { SlackServiceErrors } from "../errors.ts";
6
6
  import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
7
7
  import * as Retry from "../retry.ts";
8
8
  import * as T from "../traits.ts";
@@ -44,7 +44,8 @@ export const testApi: API.OperationMethod<
44
44
  > = /*@__PURE__*/ API.make(() => ({
45
45
  input: __S(0, __c0, 0) as any as S.Schema<TestApiRequest>,
46
46
  output: __S(2, __c0, 2) as any as S.Schema<TestApiResponse>,
47
- errors: [SlackError, SlackRateLimited],
47
+ errors: [],
48
+ serviceErrors: SlackServiceErrors,
48
49
  protocol: SlackProtocol,
49
50
  retry: Retry.Retry,
50
51
  telemetry: TELEMETRY,