Skip to content

Commit 5eb251a

Browse files
Merge branch 'main' into update-maintainers-guide-for-release
2 parents 56bc42b + f8d2bce commit 5eb251a

File tree

71 files changed

+2647
-2133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2647
-2133
lines changed

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@ updates:
1414
groups:
1515
docusaurus:
1616
patterns:
17-
- "@docusaurus/*"
17+
- "@docusaurus/*"
18+
react:
19+
patterns:
20+
- "react"
21+
- "react-dom"

.github/workflows/docs-deploy.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,26 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docs/**'
8+
- "docs/**"
99
push:
1010
branches:
1111
- main
1212
paths:
13-
- 'docs/**'
13+
- "docs/**"
1414
workflow_dispatch:
1515

1616
jobs:
1717
build:
1818
name: Build Docusaurus
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
steps:
21-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2224
with:
2325
fetch-depth: 0
24-
- uses: actions/setup-node@v4
26+
persist-credentials: false
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2528
with:
2629
node-version: 20
2730
cache: npm
@@ -82,7 +85,7 @@ jobs:
8285
working-directory: ./docs
8386

8487
- name: Upload Build Artifact
85-
uses: actions/upload-pages-artifact@v3
88+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
8689
with:
8790
path: ./docs/build
8891

@@ -105,4 +108,4 @@ jobs:
105108
steps:
106109
- name: Deploy to GitHub Pages
107110
id: deployment
108-
uses: actions/deploy-pages@v4
111+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/triage-issues.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
name: Close stale issues and PRs
66

7-
on:
7+
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: '0 0 * * 1'
11-
12-
permissions:
13-
issues: write
14-
pull-requests: write
10+
- cron: "0 0 * * 1"
1511

1612
jobs:
1713
stale:
1814
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1918
steps:
20-
- uses: actions/[email protected]
19+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2120
with:
2221
days-before-issue-stale: 30
2322
days-before-issue-close: 10
@@ -31,4 +30,3 @@ jobs:
3130
remove-stale-when-updated: true
3231
enable-statistics: true
3332
operations-per-run: 60
34-

.github/workflows/unit-tests-jdk-14.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 14 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,21 +12,24 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['14']
15-
15+
java-version: ["14"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
./scripts/run_no_prep_tests.sh -ci
26-
env:
27-
SKIP_UNSTABLE_TESTS: 1
28-
- name: Upload coverage to Codecov
29-
uses: codecov/codecov-action@v5
30-
with:
31-
token: ${{ secrets.CODECOV_TOKEN }}
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
./scripts/run_no_prep_tests.sh -ci
30+
env:
31+
SKIP_UNSTABLE_TESTS: 1
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/unit-tests-jdk-17.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 17 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,17 +12,20 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['17']
15-
15+
java-version: ["17"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
./scripts/run_no_prep_tests.sh -ci
26-
env:
27-
SKIP_UNSTABLE_TESTS: 1
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
./scripts/run_no_prep_tests.sh -ci
30+
env:
31+
SKIP_UNSTABLE_TESTS: 1

.github/workflows/unit-tests-jdk-8.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: JDK 1.8 Build & Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -11,20 +12,23 @@ jobs:
1112
timeout-minutes: 12
1213
strategy:
1314
matrix:
14-
java-version: ['8']
15-
15+
java-version: ["8"]
16+
permissions:
17+
contents: read
1618
steps:
17-
- uses: actions/checkout@v4
18-
- name: Install JDK
19-
uses: actions/setup-java@v4
20-
with:
21-
java-version: ${{ matrix.java-version }}
22-
distribution: 'adopt'
23-
- name: Run all tests
24-
run: |
25-
if [ ${{ matrix.java-version }} == "8" ]; then
26-
export TRAVIS_JDK=openjdk8
27-
fi
28-
./scripts/run_no_prep_tests.sh -ci
29-
env:
30-
SKIP_UNSTABLE_TESTS: 1
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
- name: Install JDK
23+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
24+
with:
25+
java-version: ${{ matrix.java-version }}
26+
distribution: "adopt"
27+
- name: Run all tests
28+
run: |
29+
if [ ${{ matrix.java-version }} == "8" ]; then
30+
export TRAVIS_JDK=openjdk8
31+
fi
32+
./scripts/run_no_prep_tests.sh -ci
33+
env:
34+
SKIP_UNSTABLE_TESTS: 1

docs/content/guides/ai-apps.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ If you don't have a paid workspace for development, you can join the [Developer
99

1010
:::
1111

12-
AI apps comprise a new messaging experience for Slack. If you're unfamiliar with using AI apps within Slack, you'll want to read the [API documentation on the subject](https://api.slack.com/docs/apps/ai). Then come back here to implement them with Bolt!
12+
AI apps comprise a new messaging experience for Slack. If you're unfamiliar with using AI apps within Slack, you'll want to read the [API documentation on the subject](https://docs.slack.dev/ai/). Then come back here to implement them with Bolt!
1313

1414
## Configuring your app to support AI apps features {#configuring-your-app}
1515

1616
1. Within [App Settings](https://api.slack.com/apps), enable the **Agents & AI Apps** feature.
1717

1818
2. Within the App Settings **OAuth & Permissions** page, add the following scopes:
19-
* [`assistant:write`](https://api.slack.com/scopes/assistant:write)
20-
* [`chat:write`](https://api.slack.com/scopes/chat:write)
21-
* [`im:history`](https://api.slack.com/scopes/im:history)
19+
* [`assistant:write`](https://docs.slack.dev/reference/scopes/assistant.write)
20+
* [`chat:write`](https://docs.slack.dev/reference/scopes/chat.write)
21+
* [`im:history`](https://docs.slack.dev/reference/scopes/im.history)
2222

2323
3. Within the App Settings **Event Subscriptions** page, subscribe to the following events:
24-
* [`assistant_thread_started`](https://api.slack.com/events/assistant_thread_started)
25-
* [`assistant_thread_context_changed`](https://api.slack.com/events/assistant_thread_context_changed)
26-
* [`message.im`](https://api.slack.com/events/message.im)
24+
* [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started)
25+
* [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed)
26+
* [`message.im`](https://docs.slack.dev/reference/events/message.im)
2727

2828
## The `Assistant` class instance {#assistant-class}
2929

3030
The [`Assistant`](/reference#the-assistantconfig-configuration-object) class can be used to handle the incoming events expected from a user interacting with an AI app in Slack. A typical flow would look like:
3131

32-
1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](https://api.slack.com/events/assistant_thread_started) event.
33-
2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](https://api.slack.com/events/assistant_thread_context_changed) events. The class also provides a default `context` store to keep track of thread context changes as the user moves through Slack.
34-
3. [The user responds](#handling-user-response). The `Assistant` class handles the incoming [`message.im`](https://api.slack.com/events/message.im) event.
32+
1. [The user starts a thread](#handling-a-new-thread). The `Assistant` class handles the incoming [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event.
33+
2. [The thread context may change at any point](#handling-thread-context-changes). The `Assistant` class can handle any incoming [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) events. The class also provides a default `context` store to keep track of thread context changes as the user moves through Slack.
34+
3. [The user responds](#handling-user-response). The `Assistant` class handles the incoming [`message.im`](https://docs.slack.dev/reference/events/message.im) event.
3535

3636
```java
3737
App app = new App();
@@ -71,7 +71,7 @@ assistant.userMessage((req, ctx) -> {
7171
app.assistant(assistant);
7272
```
7373

74-
While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextService` property — but it also provides a `DefaultAssistantThreadContextService` instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](https://api.slack.com/metadata/using) as the user interacts with the app.
74+
While the `assistant_thread_started` and `assistant_thread_context_changed` events do provide Slack-client thread context information, the `message.im` event does not. Any subsequent user message events won't contain thread context data. For that reason, Bolt not only provides a way to store thread context — the `threadContextService` property — but it also provides a `DefaultAssistantThreadContextService` instance that is utilized by default. This implementation relies on storing and retrieving [message metadata](https://docs.slack.dev/messaging/message-metadata/) as the user interacts with the app.
7575

7676
If you do provide your own `threadContextService` property, it must feature `get` and `save` methods.
7777

@@ -81,15 +81,15 @@ Be sure to give the [AI apps reference docs](/reference#agents--assistants) a lo
8181

8282
## Handling a new thread {#handling-a-new-thread}
8383

84-
When the user opens a new thread with your AI app, the [`assistant_thread_started`](https://api.slack.com/events/assistant_thread_started) event will be sent to your app.
84+
When the user opens a new thread with your AI app, the [`assistant_thread_started`](https://docs.slack.dev/reference/events/assistant_thread_started) event will be sent to your app.
8585

8686
:::tip
8787
When a user opens a thread with your app while in a channel, the channel info is stored as the thread's `AssistantThreadContext` data. You can grab that info by using the `context.getThreadContext()` utility, as subsequent user message event payloads won't include the channel info.
8888
:::
8989

9090
### Block Kit interactions in the AI app thread {#block-kit-interactions}
9191

92-
For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](https://api.slack.com/metadata) to trigger subsequent interactions with the user.
92+
For advanced use cases, Block Kit buttons may be used instead of suggested prompts, as well as the sending of messages with structured [metadata](https://docs.slack.dev/messaging/message-metadata/) to trigger subsequent interactions with the user.
9393

9494
For example, an app can display a button like "Summarize the referring channel" in the initial reply. When the user clicks the button and submits detailed information (such as the number of messages, days to check, the purpose of the summary, etc.), the app can handle that information and post a message that describes the request with structured metadata.
9595

@@ -175,9 +175,9 @@ app.assistant(assistant);
175175

176176
## Handling thread context changes {#handling-thread-context-changes}
177177

178-
When the user switches channels, the [`assistant_thread_context_changed`](https://api.slack.com/events/assistant_thread_context_changed) event will be sent to your app.
178+
When the user switches channels, the [`assistant_thread_context_changed`](https://docs.slack.dev/reference/events/assistant_thread_context_changed) event will be sent to your app.
179179

180-
If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](https://api.slack.com/metadata/using) of the first reply from the assistant bot.
180+
If you use the built-in `Assistant` middleware without any custom configuration, the updated context data is automatically saved as [message metadata](https://docs.slack.dev/messaging/message-metadata/) of the first reply from the assistant bot.
181181

182182
As long as you use the built-in approach, you don't need to store the context data within a datastore. The downside of this default behavior is the overhead of additional calls to the Slack API. These calls include those to `conversations.history`, which are used to look up the stored message metadata that contains the thread context (via `context.getThreadContextService().findCurrentContext(channelId, threadTs)`).
183183

@@ -189,9 +189,9 @@ Assistant assistant = new Assistant(new YourOwnAssistantThreadContextService());
189189

190190
## Handling the user response {#handling-user-response}
191191

192-
When the user messages your app, the [`message.im`](https://api.slack.com/events/message.im) event will be sent to your app.
192+
When the user messages your app, the [`message.im`](https://docs.slack.dev/reference/events/message.im) event will be sent to your app.
193193

194-
Messages sent to the app do not contain a [subtype](https://api.slack.com/events/message#subtypes) and must be deduced based on their shape and any provided [message metadata](https://api.slack.com/metadata/using).
194+
Messages sent to the app do not contain a [subtype](https://docs.slack.dev/reference/events/message) and must be deduced based on their shape and any provided [message metadata](https://docs.slack.dev/messaging/message-metadata/).
195195

196196
There are three utilities that are particularly useful in curating the user experience:
197197
* [`say`](https://tools.slack.dev/bolt-python/api-docs/slack_bolt/#slack_bolt.Say)

0 commit comments

Comments
 (0)