@cursor/july 0.1.96 → 0.1.97
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.
- package/README.md +3 -2
- package/dist/bin/agent-serve.js +14 -3
- package/dist/channels/origin/api.d.ts +15 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +19 -3
- package/dist/channels/origin/binding.d.ts +11 -0
- package/dist/channels/origin/binding.d.ts.map +1 -1
- package/dist/channels/origin/binding.js +41 -25
- package/dist/channels/origin/index.d.ts +1 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +1 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +3 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +67 -0
- package/dist/channels/origin/types.d.ts +11 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/approvals.d.ts +16 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -1
- package/dist/channels/slack/approvals.js +86 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +234 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +97 -39
- package/dist/channels/slack/init.d.ts +3 -2
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +5 -5
- package/dist/channels/slack/interactive.d.ts +2 -1
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +15 -4
- package/dist/channels/slack/manifest.d.ts +1 -1
- package/dist/channels/slack/manifest.js +1 -1
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +10 -6
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +1 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
- package/dist/channels/slack/tool-approval-events.js +91 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.jXleCmOc.js → app.B3rWNYE1.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BU9nHdnQ.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.C1lhqJJR.js} +1 -1
- package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.B40_SXuv.js} +2 -2
- package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
- package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.RyZf5OTE.js} +9 -6
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.RyZf5OTE.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
- package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.5zOAbV86.js} +1 -1
- package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.B84gw9Ii.js} +1 -1
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +7 -7
- package/dist/docs/deployment.md +5 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +8 -8
- package/dist/docs/guides/mcp-oauth.md +26 -8
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +17 -33
- package/dist/docs/guides/slack.md +92 -201
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -3
- package/dist/docs/llms-full.txt +299 -653
- package/dist/docs/llms.txt +2 -2
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +6 -6
- package/dist/docs/reference/agent-config.md +2 -2
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +13 -10
- package/dist/docs/reference/cli.md +38 -16
- package/dist/docs/reference/connections.html +9 -8
- package/dist/docs/reference/connections.md +6 -3
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +2 -1
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +4 -2
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +9 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +28 -0
- package/dist/docs/templates/agents-md.md +105 -0
- package/dist/docs/templates/code-wiki.html +5 -5
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +5 -5
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/evals/run-facts.d.ts.map +1 -1
- package/dist/evals/run-facts.js +27 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -9
- package/dist/internal/approval-gate.d.ts +12 -13
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +16 -21
- package/dist/internal/chat-client.js +10 -0
- package/dist/internal/cli-deploy.d.ts +5 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +50 -17
- package/dist/internal/cli-mcp-oauth.js +8 -18
- package/dist/internal/cli-slack-manual.d.ts +24 -2
- package/dist/internal/cli-slack-manual.d.ts.map +1 -1
- package/dist/internal/cli-slack-manual.js +251 -20
- package/dist/internal/cli-slack.d.ts +9 -2
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +29 -82
- package/dist/internal/cursor/account-mcp.d.ts +1 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +17 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/deploy-client.d.ts +17 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +31 -10
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/framework-file-storage.d.ts +1 -1
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +7 -0
- package/dist/internal/hosted-delivery.d.ts +6 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +63 -22
- package/dist/internal/hosted-execution-diag.d.ts +48 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +150 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +81 -1
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/logs-client.d.ts +5 -0
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +5 -0
- package/dist/internal/mcp-endpoint.js +2 -3
- package/dist/internal/mcp-host.d.ts +10 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +57 -8
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +92 -0
- package/dist/internal/mcp-oauth.d.ts +1 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +10 -2
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +22 -9
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +49 -22
- package/dist/internal/session-engine.d.ts +88 -3
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +515 -43
- package/dist/internal/sessions-client.d.ts +9 -7
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +3 -1
- package/dist/internal/storage-coordinator.d.ts +7 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +28 -5
- package/dist/internal/storage-roles.d.ts +5 -0
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/stream-progress.d.ts.map +1 -1
- package/dist/internal/stream-progress.js +10 -0
- package/dist/internal/tool-policy.d.ts +9 -1
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +13 -0
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +10 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/playground/assets/{index-Cx9CclK_.js → index-DrkI6y5O.js} +45 -45
- package/dist/playground/assets/index-DzNGwm7q.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +1 -1
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +12 -0
- package/dist/storage.d.ts +8 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/types.d.ts +63 -7
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -3
- package/docs/deployment.md +5 -4
- package/docs/guides/mcp-oauth.md +26 -8
- package/docs/guides/slack.md +93 -202
- package/docs/reference/agent-config.md +2 -2
- package/docs/reference/cli.md +38 -16
- package/docs/reference/connections.md +6 -3
- package/docs/reference/http-api.md +2 -1
- package/docs/reference/sessions.md +4 -2
- package/docs/reference/tools.md +9 -2
- package/docs/templates/agents-md.md +110 -0
- package/docs/troubleshooting.md +2 -2
- package/package.json +1 -1
- package/skills/create-agent/SKILL.md +2 -1
- package/skills/mcp-auth/SKILL.md +6 -3
- package/skills/setup-slack/SKILL.md +23 -13
- package/src/bin/agent-serve.ts +13 -1
- package/src/channels/origin/api.ts +24 -5
- package/src/channels/origin/binding.ts +55 -26
- package/src/channels/origin/index.ts +1 -0
- package/src/channels/origin/origin-channel.ts +4 -0
- package/src/channels/origin/reactions.ts +82 -0
- package/src/channels/origin/types.ts +11 -0
- package/src/channels/slack/approvals.ts +105 -0
- package/src/channels/slack/cli-project.ts +267 -0
- package/src/channels/slack/defaults.ts +109 -46
- package/src/channels/slack/init.ts +10 -5
- package/src/channels/slack/interactive.ts +35 -9
- package/src/channels/slack/manifest.ts +1 -1
- package/src/channels/slack/setup.ts +10 -6
- package/src/channels/slack/slack-channel.ts +1 -0
- package/src/channels/slack/tool-approval-events.ts +93 -0
- package/src/evals/run-facts.ts +32 -0
- package/src/internal/advertise-tools.ts +31 -10
- package/src/internal/approval-gate.ts +20 -29
- package/src/internal/chat-client.ts +19 -0
- package/src/internal/cli-deploy.ts +79 -9
- package/src/internal/cli-mcp-oauth.ts +7 -21
- package/src/internal/cli-slack-manual.ts +350 -18
- package/src/internal/cli-slack.ts +40 -84
- package/src/internal/cursor/account-mcp.ts +21 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/deploy-client.ts +43 -0
- package/src/internal/env-file.ts +84 -0
- package/src/internal/framework-file-storage.ts +7 -1
- package/src/internal/hosted-delivery-protocol.ts +7 -0
- package/src/internal/hosted-delivery.ts +100 -27
- package/src/internal/hosted-execution-diag.ts +207 -0
- package/src/internal/http-channel.ts +99 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/logs-client.ts +5 -0
- package/src/internal/mcp-endpoint.ts +13 -4
- package/src/internal/mcp-host.ts +77 -11
- package/src/internal/mcp-oauth-on-demand.ts +352 -0
- package/src/internal/mcp-oauth-persist.ts +127 -0
- package/src/internal/mcp-oauth.ts +17 -1
- package/src/internal/otel/collector.ts +30 -0
- package/src/internal/server.ts +59 -9
- package/src/internal/session-engine.ts +659 -56
- package/src/internal/sessions-client.ts +17 -8
- package/src/internal/storage-coordinator.ts +38 -8
- package/src/internal/storage-roles.ts +7 -0
- package/src/internal/stream-progress.ts +19 -0
- package/src/internal/tool-policy.ts +18 -0
- package/src/internal/trajectory.ts +10 -0
- package/src/internal/turn-outbox.ts +85 -0
- package/src/storage-backends/cursor-hosted.ts +13 -1
- package/src/storage.ts +12 -0
- package/src/types.ts +68 -8
- package/templates/agents-md/README.md +39 -0
- package/templates/agents-md/agent/agent.ts +8 -0
- package/templates/agents-md/agent/channels/github.ts +10 -0
- package/templates/agents-md/agent/channels/queue.ts +28 -0
- package/templates/agents-md/agent/channels/slack.ts +9 -0
- package/templates/agents-md/agent/instructions.md +39 -0
- package/templates/agents-md/agent/lib/collect.ts +439 -0
- package/templates/agents-md/agent/lib/config.ts +8 -0
- package/templates/agents-md/agent/lib/paths.ts +51 -0
- package/templates/agents-md/agent/schedules/weekly.ts +17 -0
- package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
- package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
- package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
- package/dist/docs/design/agsh.md +0 -406
- package/dist/playground/assets/index-B1DDvBeC.css +0 -1
- package/docs/design/agsh.md +0 -406
- /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.5zOAbV86.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.B84gw9Ii.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# Slack agents
|
|
2
2
|
|
|
3
|
-
The Slack channel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`agent-sdk slack init --manual` and paste the manifests at
|
|
7
|
-
[api.slack.com](https://api.slack.com/apps). Socket Mode has no
|
|
8
|
-
public Request URL. Replies stream in threads, with tool "thinking" steps,
|
|
9
|
-
suggested prompts, and opt-in approval buttons.
|
|
3
|
+
The Slack channel is a Socket Mode bot. The app connects out, so you
|
|
4
|
+
don't need a public Request URL. Mentions and DMs start a thread.
|
|
5
|
+
Replies stream there, with thinking steps and suggested prompts.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
Use `agent-sdk slack create` when Cursor should own the Slack app. Use
|
|
8
|
+
`agent-sdk slack init --manual` when you own it. Commands and flags live
|
|
9
|
+
in the [CLI reference](/docs/reference/cli.md#slack). Coding agents should
|
|
10
|
+
follow [`skills/setup-slack/SKILL.md`](https://github.com/cursor/cursor/blob/main/packages/agent-serve/skills/setup-slack/SKILL.md).
|
|
13
11
|
|
|
14
12
|
## Define the channel
|
|
15
13
|
|
|
@@ -19,35 +17,23 @@ Author `agent/channels/slack.ts` with `slackChannel()` from
|
|
|
19
17
|
```ts
|
|
20
18
|
import { slackChannel } from "@cursor/july/channels/slack";
|
|
21
19
|
|
|
22
|
-
// Single agent: reads SLACK_BOT_TOKEN + SLACK_APP_TOKEN
|
|
23
20
|
export default slackChannel();
|
|
24
|
-
|
|
25
|
-
// Multi-agent serve: one Slack app (and token pair) per agent
|
|
26
|
-
export default slackChannel({ envPrefix: "WEATHER_AGENT" });
|
|
27
|
-
// → WEATHER_AGENT_SLACK_BOT_TOKEN + WEATHER_AGENT_SLACK_APP_TOKEN
|
|
28
21
|
```
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
one
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`missing_scope`), the pack degrades to `postMessage` instead of failing.
|
|
40
|
-
|
|
41
|
-
Missing tokens leave the channel idle (`channel idle … missing
|
|
42
|
-
credentials`) rather than failing `serve`. That's useful when you mount
|
|
43
|
-
many agents and only some have Slack apps.
|
|
23
|
+
`slackChannel()` reads `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN`. Pass
|
|
24
|
+
`envPrefix: "WEATHER_AGENT"` to read `WEATHER_AGENT_SLACK_BOT_TOKEN`
|
|
25
|
+
and `WEATHER_AGENT_SLACK_APP_TOKEN` instead. Use a prefix when one
|
|
26
|
+
host serves several Slack bots.
|
|
27
|
+
|
|
28
|
+
A thread is one conversation. The bot answers mentions and DMs. It
|
|
29
|
+
refuses Slack Connect users, guests, and people from other workspaces.
|
|
30
|
+
Missing tokens leave this channel idle. The rest of `serve` still
|
|
31
|
+
starts.
|
|
44
32
|
|
|
45
33
|
## Control who can message the agent
|
|
46
34
|
|
|
47
|
-
External senders are blocked
|
|
48
|
-
people
|
|
49
|
-
handler. Set `blockExternals: false` only when the agent should serve
|
|
50
|
-
people outside your org:
|
|
35
|
+
External senders are blocked. Set `blockExternals: false` only when
|
|
36
|
+
people outside your org should reach the agent:
|
|
51
37
|
|
|
52
38
|
```ts
|
|
53
39
|
export default slackChannel({
|
|
@@ -55,9 +41,8 @@ export default slackChannel({
|
|
|
55
41
|
});
|
|
56
42
|
```
|
|
57
43
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`respondTo: "author"`:
|
|
44
|
+
Anyone in the thread can continue it. Restrict follow-ups to the person
|
|
45
|
+
who started the session with `respondTo: "author"`:
|
|
61
46
|
|
|
62
47
|
```ts
|
|
63
48
|
export default slackChannel({
|
|
@@ -67,234 +52,140 @@ export default slackChannel({
|
|
|
67
52
|
|
|
68
53
|
## Set it up
|
|
69
54
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
a manifest at [api.slack.com](https://api.slack.com/apps) unless you
|
|
75
|
-
are on the [manual setup](#manual-setup) path.
|
|
76
|
-
|
|
77
|
-
Bots that already have tokens in `.env.local` keep working. Skip the
|
|
78
|
-
wizard unless you want a Cursor-managed app.
|
|
55
|
+
`slack create` opens the Cursor dashboard wizard. Finish Slack consent
|
|
56
|
+
and the bot name there. The CLI writes tokens to `.env.local` and never
|
|
57
|
+
prints them. Skip the wizard if those tokens are already set, unless
|
|
58
|
+
you want a Cursor-managed app.
|
|
79
59
|
|
|
80
60
|
### Provision with the CLI
|
|
81
61
|
|
|
82
62
|
```bash
|
|
83
|
-
agent-sdk slack create --dir .
|
|
84
|
-
agent-sdk slack create --dir . --prod
|
|
63
|
+
agent-sdk slack create --dir .
|
|
64
|
+
agent-sdk slack create --dir . --prod
|
|
85
65
|
```
|
|
86
66
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
67
|
+
Sign in first (`agent-sdk login` or `CURSOR_API_KEY`). Finish **Add
|
|
68
|
+
Slack to this agent** as the same Cursor account. Then run
|
|
69
|
+
`agent-sdk slack doctor --prefix MY_AGENT` and serve:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
agent-sdk serve --dir . --dev
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Invite the bot and mention it, or DM it. Expect a Thinking status,
|
|
76
|
+
then a threaded streaming reply.
|
|
77
|
+
|
|
78
|
+
If Slack needs a workspace admin, keep the CLI running. Open the
|
|
79
|
+
**Request approval** link it prints. After an admin approves, click
|
|
99
80
|
**Retry** in the wizard.
|
|
100
81
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
that Slack app. It keeps the Slack app id and replaces the manifest and
|
|
105
|
-
tokens. `agent-sdk slack destroy` deletes the provisioned app.
|
|
106
|
-
`agent-sdk slack icon <source>` updates the icon later.
|
|
82
|
+
`slack destroy` deletes the Cursor-managed app. `slack icon` updates
|
|
83
|
+
its icon. A second `slack create` for the same agent and environment
|
|
84
|
+
replaces that app's manifest and tokens.
|
|
107
85
|
|
|
108
86
|
### Provision from the dashboard
|
|
109
87
|
|
|
110
88
|
The same wizard is on [Deployed Agents](https://cursor.com/dashboard).
|
|
111
|
-
Open **Integrations**
|
|
112
|
-
or follow the URL `slack create` printed.
|
|
89
|
+
Open **Integrations** and click **Add Slack to this agent**.
|
|
113
90
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
**Deploy** injects the stored secrets; there is no Slack-only Redeploy.
|
|
91
|
+
Local `agent-sdk serve` reads `.env.local`. The next deploy injects the
|
|
92
|
+
stored secrets.
|
|
117
93
|
|
|
118
|
-
If Slack needs admin approval,
|
|
119
|
-
|
|
120
|
-
reminder). After an admin approves, click **Retry**.
|
|
94
|
+
If Slack needs admin approval, click **Request approval**, then
|
|
95
|
+
**Retry** after an admin approves.
|
|
121
96
|
|
|
122
|
-
The app row's menu covers
|
|
123
|
-
|
|
97
|
+
The app row's menu covers rename, icon, token rotation, removal, and
|
|
98
|
+
workspace disconnect.
|
|
124
99
|
|
|
125
|
-
###
|
|
100
|
+
### Create your own Slack app
|
|
126
101
|
|
|
127
|
-
`
|
|
128
|
-
|
|
129
|
-
|
|
102
|
+
`slack init --manual` is for an app you own. It writes the channel file
|
|
103
|
+
and Slack manifests. When Slack CLI (`~/.slack/bin/slack`) is logged
|
|
104
|
+
in, it installs the app. When it isn't, install the app yourself.
|
|
130
105
|
|
|
131
106
|
```bash
|
|
132
|
-
agent-sdk slack
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Proceed when `app_token`, `connections_open`, `bot_token`, and
|
|
136
|
-
`auth_test` are all green. Then serve and smoke it:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
agent-sdk serve --dir . --dev
|
|
140
|
-
# expect: [agent-sdk/slack] Socket Mode connected
|
|
107
|
+
agent-sdk slack init --manual --dir . --name "My Agent"
|
|
141
108
|
```
|
|
142
109
|
|
|
143
|
-
|
|
144
|
-
Thinking… status, then a threaded streaming reply, with correlated
|
|
145
|
-
server logs (`inbound kind=app_mention`, `session start`,
|
|
146
|
-
`reply delivered via stream|postMessage`).
|
|
147
|
-
|
|
148
|
-
### Manual setup
|
|
149
|
-
|
|
150
|
-
`slack init --manual` is for a Slack app you own at api.slack.com. You
|
|
151
|
-
paste the generated manifests and mint tokens yourself. Use this when
|
|
152
|
-
you want an unmanaged app, or when the dashboard wizard is not an
|
|
153
|
-
option.
|
|
110
|
+
Install Slack CLI if you need it:
|
|
154
111
|
|
|
155
112
|
```bash
|
|
156
|
-
|
|
113
|
+
curl -fsSL https://downloads.slack-edge.com/slack-cli/install.sh | bash
|
|
157
114
|
```
|
|
158
115
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
events.
|
|
116
|
+
Log in with `slack login --no-prompt`. In Slack, send
|
|
117
|
+
`/slackauthticket <ticket>`, then
|
|
118
|
+
`slack login --ticket <ticket> --challenge <code>`. Install the
|
|
119
|
+
workspace app with `slack app install`. Create a separate production
|
|
120
|
+
app the same way.
|
|
165
121
|
|
|
166
|
-
|
|
167
|
-
|
|
122
|
+
Or paste `.slack/manifest.dev.json` at
|
|
123
|
+
[api.slack.com/apps](https://api.slack.com/apps) (**Create New App** →
|
|
124
|
+
**From a manifest**). Repeat with `.slack/manifest.prod.json`. Dev and
|
|
125
|
+
prod are separate Slack apps.
|
|
168
126
|
|
|
169
|
-
|
|
127
|
+
Then put a bot token (`xoxb-...`) and an app-level token with
|
|
128
|
+
`connections:write` (`xapp-...`) in `.env.local`. Use the names
|
|
129
|
+
`slack init --manual` printed. Run `slack doctor` and serve as above.
|
|
170
130
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
1. Open [api.slack.com/apps](https://api.slack.com/apps) → **Create New
|
|
174
|
-
App** → **From a manifest**.
|
|
175
|
-
2. Paste `manifest.dev.json` and create the dev app.
|
|
176
|
-
3. Repeat with `manifest.prod.json`. Dev and prod are separate Slack
|
|
177
|
-
apps with separate tokens.
|
|
178
|
-
|
|
179
|
-
#### Install and mint tokens
|
|
180
|
-
|
|
181
|
-
For each app: **Install to Workspace** and copy the Bot User OAuth Token
|
|
182
|
-
(`xoxb-…`). Then under **Basic Information → App-Level Tokens** create a
|
|
183
|
-
token with scope `connections:write` and copy it (`xapp-…`).
|
|
184
|
-
|
|
185
|
-
Put the pair in `.env.local` using the names from `env.example`, then
|
|
186
|
-
run `slack doctor` and serve as [above](#wire-the-env-and-verify).
|
|
131
|
+
Serve this app with Agent SDK. Do not run `slack deploy`.
|
|
187
132
|
|
|
188
133
|
## Choose when the agent engages
|
|
189
134
|
|
|
190
|
-
Mentions and DMs are on
|
|
191
|
-
|
|
135
|
+
Mentions and DMs are on. Watching channel posts without a mention is
|
|
136
|
+
opt-in:
|
|
192
137
|
|
|
193
138
|
```ts
|
|
194
139
|
export default slackChannel({
|
|
195
140
|
envPrefix: "TRIAGE",
|
|
196
141
|
engagement: {
|
|
197
|
-
// mentions / directMessages default to true
|
|
198
142
|
channelPosts: {
|
|
199
|
-
allow: ["#triage-alerts"],
|
|
200
|
-
posts: "top-level",
|
|
201
|
-
debounceMs: 15_000,
|
|
202
|
-
includeBotPosts: false, // default: bot-authored posts never dispatch
|
|
143
|
+
allow: ["#triage-alerts"],
|
|
144
|
+
posts: "top-level",
|
|
145
|
+
debounceMs: 15_000,
|
|
203
146
|
},
|
|
204
147
|
},
|
|
205
|
-
onChannelPost: async (
|
|
206
|
-
// same contract as onAppMention: return null to skip
|
|
148
|
+
onChannelPost: async (_ctx, message) => {
|
|
207
149
|
return message.markdown.length > 20 ? {} : null;
|
|
208
150
|
},
|
|
209
151
|
});
|
|
210
152
|
```
|
|
211
153
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
`
|
|
215
|
-
channel.
|
|
216
|
-
|
|
217
|
-
Set `allow: ["*"]` to watch every channel the bot has joined.
|
|
154
|
+
Pass `--channel-posts` on `slack create` or `slack init --manual` so
|
|
155
|
+
the Slack app receives those events. The bot must be in each watched
|
|
156
|
+
channel. `allow: ["*"]` watches every joined channel.
|
|
218
157
|
|
|
219
|
-
Set `includeBotPosts: true`
|
|
220
|
-
|
|
221
|
-
watching app's own posts stay dropped either way, matched by the `bot_id`
|
|
222
|
-
and bot user id from `auth.test`, so an agent can never dispatch on its
|
|
223
|
-
own replies. Use this for a bot-fed alerts channel.
|
|
158
|
+
Set `includeBotPosts: true` for alert feeds and other bots. This app
|
|
159
|
+
never wakes on its own posts.
|
|
224
160
|
|
|
225
161
|
## Prepare work on the host
|
|
226
162
|
|
|
227
163
|
Mention and DM handlers may return a prepared `message`,
|
|
228
|
-
`workspaceFiles`, or `cloud` block.
|
|
164
|
+
`workspaceFiles`, or `cloud` block. Use the same host-prep pattern as
|
|
229
165
|
[custom channels](/docs/guides/webhooks.md#prepare-on-the-host-then-hand-off).
|
|
230
|
-
PR agents use it: extract a PR URL from the mention text and run the
|
|
231
|
-
same host path as the HTTP channel.
|
|
232
166
|
|
|
233
|
-
Slack file uploads
|
|
167
|
+
Slack file uploads attach automatically. Images become vision input.
|
|
234
168
|
Supported documents become workspace files for the turn.
|
|
235
169
|
|
|
236
170
|
## Add approval buttons
|
|
237
171
|
|
|
238
|
-
Tools with `needsApproval` park until a person decides.
|
|
239
|
-
|
|
172
|
+
Tools with `needsApproval` park until a person decides. Post those
|
|
173
|
+
decisions in Slack with one flag:
|
|
240
174
|
|
|
241
175
|
```ts
|
|
242
176
|
export default slackChannel({
|
|
243
|
-
toolApprovals: true,
|
|
177
|
+
toolApprovals: true,
|
|
244
178
|
});
|
|
245
179
|
```
|
|
246
180
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
Cards show redacted, truncated arguments (Block Kit size limits);
|
|
253
|
-
execution still uses the full validated input, so review sensitive tools
|
|
254
|
-
in the playground when the arguments may exceed the card. Approvals
|
|
255
|
-
exist for `execution: "server"` tools on the local runtime only, and
|
|
256
|
-
parked calls do not survive a host restart. The full lifecycle is in
|
|
181
|
+
The Slack app needs interactivity. Recreate it with `slack create` if
|
|
182
|
+
clicks do nothing. Cards show redacted, truncated arguments. Execution
|
|
183
|
+
still uses the full input, so review sensitive tools in the playground
|
|
184
|
+
when the card may hide fields. The lifecycle is in
|
|
257
185
|
[Human-in-the-loop](/docs/guides/human-in-the-loop.md).
|
|
258
186
|
|
|
259
187
|
## Run several agents on one host
|
|
260
188
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
with their Slack channel idle while everything else serves normally.
|
|
265
|
-
|
|
266
|
-
## Keep the channel healthy
|
|
267
|
-
|
|
268
|
-
Two habits matter most.
|
|
269
|
-
|
|
270
|
-
- Don't `await` long work inside Slack dispatch handlers. The pack
|
|
271
|
-
dispatches through `waitUntil` and streams as the turn progresses.
|
|
272
|
-
- In `--dev` (loopback) or `--allow-anonymous` (trusted shared host), the
|
|
273
|
-
playground can list and stream Slack sessions and resolve their parked
|
|
274
|
-
approvals (the audit trail records the HTTP caller). Bearer-auth hosts
|
|
275
|
-
stay strict: Slack approvals must come from Slack interactivity or a
|
|
276
|
-
matching principal.
|
|
277
|
-
|
|
278
|
-
## CLI reference
|
|
279
|
-
|
|
280
|
-
The `slack` subcommands cover setup end to end.
|
|
281
|
-
|
|
282
|
-
```bash
|
|
283
|
-
agent-sdk slack setup # printed setup guide
|
|
284
|
-
agent-sdk slack create --dir . # dashboard wizard (dev app)
|
|
285
|
-
agent-sdk slack create --dir . --prod # prod app
|
|
286
|
-
agent-sdk slack destroy --dir . # delete the provisioned app
|
|
287
|
-
agent-sdk slack icon ./icon.png --dir . # set the provisioned app's icon
|
|
288
|
-
agent-sdk slack init --manual --dir . # manifests to paste at api.slack.com
|
|
289
|
-
agent-sdk slack manifest --env both # regenerate those JSON files
|
|
290
|
-
agent-sdk slack doctor --prefix MY_AGENT # token / connectivity checks
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## What's next
|
|
294
|
-
|
|
295
|
-
Continue with these pages:
|
|
296
|
-
|
|
297
|
-
- [Human-in-the-loop](/docs/guides/human-in-the-loop.md): the approval lifecycle
|
|
298
|
-
behind `toolApprovals`
|
|
299
|
-
- [Webhooks and custom channels](/docs/guides/webhooks.md): the mechanism this
|
|
300
|
-
pack is built on
|
|
189
|
+
Give each agent its own Slack app and token pair. Set `envPrefix` so
|
|
190
|
+
the names don't collide (`WEATHER_AGENT_SLACK_*`, `TRIAGE_SLACK_*`).
|
|
191
|
+
Agents without tokens stay idle. The others still serve.
|