@cursor/july 0.1.94 → 0.1.96
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/AGENTS.md +3 -4
- package/dist/channels/deployments/types.d.ts +1 -1
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/deployments/types.js +1 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +14 -2
- package/dist/channels/github/types.d.ts +18 -3
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/origin/api.d.ts +59 -13
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +168 -27
- package/dist/channels/origin/binding.d.ts +2 -2
- package/dist/channels/origin/checks.d.ts +6 -6
- package/dist/channels/origin/checks.js +6 -6
- package/dist/channels/origin/cursor-account.d.ts +5 -3
- package/dist/channels/origin/cursor-account.d.ts.map +1 -1
- package/dist/channels/origin/cursor-account.js +5 -3
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +11 -3
- package/dist/channels/origin/origin-webhook.d.ts +11 -1
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -1
- package/dist/channels/origin/origin-webhook.js +23 -3
- package/dist/channels/origin/types.d.ts +8 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +9 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +36 -5
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +17 -46
- package/dist/channels/slack/dispatch.d.ts +7 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +47 -23
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +32 -0
- package/dist/channels/slack/live-delivery.d.ts +26 -29
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +172 -73
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +5 -1
- package/dist/channels/slack/nudge-carrier.d.ts +2 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
- package/dist/channels/slack/nudge-carrier.js +48 -1
- package/dist/channels/slack/pr-ref.d.ts +7 -1
- package/dist/channels/slack/pr-ref.d.ts.map +1 -1
- package/dist/channels/slack/pr-ref.js +42 -23
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +2 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.CFDEas4I.js → app.jXleCmOc.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.B1IIYpYS.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
- package/dist/docs/assets/chunks/{theme.Ct4NSiLm.js → theme.9ged-pr2.js} +2 -2
- package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
- package/dist/docs/assets/{index.md.DRakGHFe.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.js → reference_cli.md.CCnG-nJx.js} +4 -2
- package/dist/docs/assets/{reference_cli.md.Cw6_ICYG.lean.js → reference_cli.md.CCnG-nJx.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.8son6Hjm.js → reference_skills.md.BFW9retM.js} +3 -3
- package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.js → templates_agentic-owners.md.BZSH4N9z.js} +1 -1
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
- package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
- package/dist/docs/assets/{templates_demo.md.DhFcWN6j.js → templates_demo.md.BeQX9V3H.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.js → templates_pr-autofixer.md.x5zl6-GT.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.DU7dQpor.lean.js → templates_pr-autofixer.md.x5zl6-GT.lean.js} +1 -1
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.js +4 -0
- package/dist/docs/assets/templates_security-help.md.C3Ny_Qr2.lean.js +1 -0
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.js → templates_security-reviewer.md.lshxbCLK.js} +2 -2
- package/dist/docs/assets/{templates_security-reviewer.md.CTa7u_l1.lean.js → templates_security-reviewer.md.lshxbCLK.lean.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.js → templates_triage.md.Co4UNzkZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.CVlpctKS.lean.js → templates_triage.md.Co4UNzkZ.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -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 +4 -4
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +4 -4
- 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 -1
- package/dist/docs/llms-full.txt +189 -26
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +8 -6
- package/dist/docs/reference/cli.md +4 -1
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- 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 +4 -4
- package/dist/docs/reference/skills.html +7 -7
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +7 -7
- package/dist/docs/templates/agentic-owners.md +1 -1
- package/dist/docs/templates/code-wiki.html +28 -0
- package/dist/docs/templates/code-wiki.md +91 -0
- package/dist/docs/templates/demo.html +6 -6
- package/dist/docs/templates/demo.md +3 -2
- package/dist/docs/templates/pr-autofixer.html +6 -6
- package/dist/docs/templates/pr-autofixer.md +7 -13
- package/dist/docs/templates/security-help.html +30 -0
- package/dist/docs/templates/security-help.md +65 -0
- package/dist/docs/templates/security-reviewer.html +6 -6
- package/dist/docs/templates/security-reviewer.md +1 -2
- package/dist/docs/templates/triage.html +7 -7
- package/dist/docs/templates/triage.md +2 -6
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/files-backends/cursor-hosted.d.ts +26 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +32 -4
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +5 -0
- package/dist/internal/advertise-tools.d.ts +2 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -1
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +142 -7
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +312 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +22 -48
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +99 -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/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +13 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +11 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +11 -5
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +22 -2
- package/dist/internal/framework-file-storage.d.ts +61 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +204 -0
- package/dist/internal/framework-storage-selection.d.ts +38 -16
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +78 -17
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +5 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +33 -1
- package/dist/internal/hosted-delivery.d.ts +11 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +79 -35
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +58 -0
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +1 -3
- package/dist/internal/managed-delivery.d.ts +80 -0
- package/dist/internal/managed-delivery.d.ts.map +1 -0
- package/dist/internal/managed-delivery.js +86 -0
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +10 -98
- package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +7 -0
- package/dist/internal/scm/pr-url.d.ts +14 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +65 -0
- package/dist/internal/sdk-runner.d.ts +25 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +70 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -2
- package/dist/internal/session-engine.d.ts +13 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +71 -3
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/playground/assets/index-B1DDvBeC.css +1 -0
- package/dist/playground/assets/{index-B3JCyigB.js → index-Cx9CclK_.js} +47 -47
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +8 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +4 -3
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -1
- package/docs/reference/cli.md +4 -1
- package/docs/templates/agentic-owners.md +1 -1
- package/docs/templates/code-wiki.md +96 -0
- package/docs/templates/demo.md +3 -2
- package/docs/templates/pr-autofixer.md +7 -13
- package/docs/templates/security-help.md +70 -0
- package/docs/templates/security-reviewer.md +1 -2
- package/docs/templates/triage.md +2 -6
- package/package.json +2 -2
- package/skills/ab/SKILL.md +13 -97
- package/skills/create-agent/SKILL.md +123 -223
- package/skills/debug/SKILL.md +34 -68
- package/skills/evals/SKILL.md +55 -180
- package/skills/framework-map/SKILL.md +83 -145
- package/skills/github/SKILL.md +53 -111
- package/skills/hillclimb/SKILL.md +40 -163
- package/skills/mcp-auth/SKILL.md +48 -107
- package/skills/otel/SKILL.md +22 -68
- package/skills/setup-slack/SKILL.md +77 -208
- package/src/channels/deployments/types.ts +1 -0
- package/src/channels/github/github-channel.ts +23 -8
- package/src/channels/github/types.ts +19 -2
- package/src/channels/origin/api.ts +242 -30
- package/src/channels/origin/binding.ts +2 -2
- package/src/channels/origin/checks.ts +6 -6
- package/src/channels/origin/cursor-account.ts +5 -3
- package/src/channels/origin/origin-channel.ts +13 -1
- package/src/channels/origin/origin-webhook.ts +27 -3
- package/src/channels/origin/types.ts +8 -0
- package/src/channels/slack/api.ts +41 -5
- package/src/channels/slack/defaults.ts +15 -49
- package/src/channels/slack/dispatch.ts +56 -22
- package/src/channels/slack/inbound.ts +43 -0
- package/src/channels/slack/live-delivery.ts +235 -114
- package/src/channels/slack/manifest.ts +5 -1
- package/src/channels/slack/nudge-carrier.ts +48 -1
- package/src/channels/slack/pr-ref.ts +56 -25
- package/src/channels/slack/slack-channel.ts +2 -0
- package/src/files-backends/cursor-hosted.ts +41 -2
- package/src/files.ts +11 -0
- package/src/internal/advertise-tools.ts +18 -2
- package/src/internal/bounded.ts +28 -0
- package/src/internal/cli-deploy.ts +183 -7
- package/src/internal/conversation-mirror.ts +406 -0
- package/src/internal/cursor/backend-client.ts +34 -58
- package/src/internal/cursor/session-token.ts +115 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +24 -1
- package/src/internal/deploy-manifest.ts +10 -5
- package/src/internal/discovery.ts +25 -2
- package/src/internal/framework-file-storage.ts +222 -0
- package/src/internal/framework-storage-selection.ts +101 -19
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-delivery-protocol.ts +44 -1
- package/src/internal/hosted-delivery.ts +105 -40
- package/src/internal/hosted-managed-automation.ts +72 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/install-cursor-skills.ts +1 -4
- package/src/internal/managed-delivery.ts +125 -0
- package/src/internal/review-comments.ts +10 -113
- package/src/internal/runtime-dispatch-runner.ts +10 -0
- package/src/internal/scm/pr-url.ts +95 -0
- package/src/internal/sdk-runner.ts +103 -0
- package/src/internal/server.ts +12 -0
- package/src/internal/session-engine.ts +76 -4
- package/src/internal/steering.ts +17 -0
- package/src/storage-backends/cursor-hosted.ts +10 -1
- package/src/types.ts +2 -1
- package/templates/agentic-owners/README.md +1 -1
- package/templates/agentic-owners/agent/agent.ts +0 -10
- package/templates/agentic-owners/agent/channels/github.ts +5 -14
- package/templates/agentic-owners/agent/lib/config.ts +0 -8
- package/templates/agentic-owners/agent/lib/review.ts +2 -15
- package/templates/agentic-owners/agent/tools/record_review.ts +2 -4
- package/templates/code-wiki/README.md +34 -0
- package/templates/code-wiki/agent/agent.ts +8 -0
- package/templates/code-wiki/agent/channels/github.ts +144 -0
- package/templates/code-wiki/agent/instructions.md +39 -0
- package/templates/code-wiki/agent/lib/repos.ts +5 -0
- package/templates/code-wiki/agent/lib/wiki.ts +22 -0
- package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +132 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/agent/agent.ts +0 -10
- package/templates/pr-autofixer/README.md +0 -2
- package/templates/pr-autofixer/agent/agent.ts +0 -11
- package/templates/pr-autofixer/agent/channels/slack.ts +0 -7
- package/templates/pr-autofixer/agent/lib/pr-state.ts +5 -17
- package/templates/pr-autofixer/agent/lib/repos.ts +0 -1
- package/templates/security-help/README.md +2 -2
- package/templates/security-help/agent/agent.ts +1 -2
- package/templates/security-help/agent/channels/slack.ts +0 -3
- package/templates/security-help/agent/instructions.md +9 -10
- package/templates/security-help/agent/skills/access-request.md +1 -1
- package/templates/security-help/agent/skills/faq.md +31 -0
- package/templates/security-help/agent/skills/security-playbooks.md +1 -1
- package/templates/security-help/package.json +1 -2
- package/templates/security-reviewer/agent/agent.ts +0 -10
- package/templates/triage/agent/agent.ts +0 -10
- package/templates/triage/agent/channels/queue.ts +1 -1
- package/templates/triage/agent/channels/webhook.ts +1 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.DU3U2Ij2.js +0 -1
- package/dist/docs/assets/index.md.DRakGHFe.js +0 -5
- package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
- package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
- package/dist/internal/deployment-scm-event-stream.js +0 -474
- package/dist/playground/assets/index-D9N7-q97.css +0 -1
- package/src/internal/deployment-scm-event-stream.ts +0 -593
- package/templates/security-help/agent/knowledge/faq/approvals.md +0 -5
- package/templates/security-help/agent/knowledge/faq/channels.md +0 -6
- package/templates/security-help/agent/knowledge/faq/phishing.md +0 -10
- package/templates/security-help/agent/skills/security-first-pass.md +0 -15
- /package/dist/docs/assets/{reference_skills.md.8son6Hjm.lean.js → reference_skills.md.BFW9retM.lean.js} +0 -0
- /package/dist/docs/assets/{templates_agentic-owners.md.DqtPdm6f.lean.js → templates_agentic-owners.md.BZSH4N9z.lean.js} +0 -0
- /package/dist/docs/assets/{templates_demo.md.DhFcWN6j.lean.js → templates_demo.md.BeQX9V3H.lean.js} +0 -0
|
@@ -1,270 +1,139 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentsdk-setup-slack
|
|
3
3
|
description: >-
|
|
4
|
-
Wire Slack to an Agent SDK agent. Mint a dedicated Socket Mode app
|
|
5
|
-
slack create
|
|
6
|
-
|
|
7
|
-
Slack to an agent.
|
|
4
|
+
Wire Slack to an Agent SDK agent. Mint a dedicated Socket Mode app
|
|
5
|
+
with slack create, then doctor and smoke. Use slack init --manual
|
|
6
|
+
only when the user owns the Slack app. Use when adding Slack.
|
|
8
7
|
---
|
|
9
8
|
|
|
10
9
|
# Setup Slack for the Agent SDK
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Dedicated Socket Mode bot. `agent-sdk slack create` opens the
|
|
12
|
+
signed-in dashboard wizard. Tokens land in `.env.local` and as
|
|
13
|
+
deployment secrets. Never print token values.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Do not generate manifests or ask anyone to paste tokens unless
|
|
16
|
+
they asked for `slack init --manual`.
|
|
16
17
|
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
wizard; Slack consent and the bot name happen there. Tokens land in
|
|
20
|
-
`.env.local` and as deployment secrets.
|
|
18
|
+
Existing `<PREFIX>_SLACK_BOT_TOKEN` + `_SLACK_APP_TOKEN` in
|
|
19
|
+
`.env.local` keep working. Do not force those onto the wizard.
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
asked for a custom Slack app (`slack init --manual`).
|
|
21
|
+
Guide: `docs/guides/slack.md`.
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
`_SLACK_APP_TOKEN` in `.env.local` keep working. Do not force them onto
|
|
27
|
-
the wizard.
|
|
28
|
-
|
|
29
|
-
## Dedicated Slack app (Socket Mode)
|
|
30
|
-
|
|
31
|
-
Goal: one dedicated bot per agent, tokens in `.env.local`, local serve
|
|
32
|
-
without a cloud deploy. The dashboard wizard is the only first-run.
|
|
23
|
+
## 1. Wizard (default)
|
|
33
24
|
|
|
34
25
|
```bash
|
|
35
26
|
agent-sdk login
|
|
36
27
|
agent-sdk slack create --dir .
|
|
37
28
|
```
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`<dir>/.env.local`, then runs `doctor`. Token values never print.
|
|
44
|
-
|
|
45
|
-
`--prod` provisions the prod app (default is dev). `--name` / `--icon` /
|
|
46
|
-
`--channel-posts` prefill the wizard. `--prefix` / `--no-prefix` set the
|
|
47
|
-
env-var names.
|
|
30
|
+
Same Cursor account in the browser. **Add Slack to this agent**,
|
|
31
|
+
approve Slack, pick the bot name. CLI writes
|
|
32
|
+
`<PREFIX>_SLACK_BOT_TOKEN` / `<PREFIX>_SLACK_APP_TOKEN` and runs
|
|
33
|
+
`doctor`.
|
|
48
34
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
35
|
+
Prefix is the directory basename in upper snake (`jenny` →
|
|
36
|
+
`JENNY`, `pr-approver` → `PR_APPROVER` → `PR_APPROVER_SLACK_*`).
|
|
37
|
+
`--prefix` / `--no-prefix` override. Dev and prod are separate
|
|
38
|
+
apps; `--prod` is the prod app. `--name` / `--icon` /
|
|
39
|
+
`--channel-posts` / `--slack-team` prefill the wizard.
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
If Slack needs workspace-admin approval, keep the CLI running.
|
|
42
|
+
Open the **Request approval** link it prints. Managed install
|
|
43
|
+
does not file the request. After approval, **Retry** in the
|
|
44
|
+
wizard.
|
|
59
45
|
|
|
60
|
-
|
|
61
|
-
agents unless you want a Cursor-managed app.
|
|
46
|
+
`create` scaffolds `agent/channels/slack.ts` when missing:
|
|
62
47
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
48
|
+
```ts
|
|
49
|
+
export default slackChannel({
|
|
50
|
+
envPrefix: "JENNY",
|
|
51
|
+
suggestedPrompts: [{ title: "Help", message: "How can you help me?" }],
|
|
52
|
+
});
|
|
68
53
|
```
|
|
69
54
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
When tokens are missing the channel logs
|
|
73
|
-
`channel idle reason=missing credentials need=…` and `serve` continues.
|
|
74
|
-
|
|
75
|
-
Human:
|
|
55
|
+
Return from dispatch handlers. Do not await long work in the
|
|
56
|
+
handler.
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
4. Server logs should show correlated lines (`event_id`, `session`, `channel`, `thread_ts`):
|
|
81
|
-
- `inbound kind=app_mention …`
|
|
82
|
-
- `session start …`
|
|
83
|
-
- `reply delivered via postMessage|stream …`
|
|
58
|
+
A second `slack create` for the same agent and env overwrites the
|
|
59
|
+
app (same Slack app id, new manifest and tokens).
|
|
60
|
+
`agent-sdk slack destroy` deletes it.
|
|
84
61
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
dashboard **Deploy**) injects the stored secrets.
|
|
62
|
+
Local serve does not need a hosted engine. Next
|
|
63
|
+
`agent-sdk deploy` injects the stored secrets.
|
|
88
64
|
|
|
89
|
-
|
|
90
|
-
app. It keeps the Slack app id and replaces the manifest and tokens.
|
|
91
|
-
`agent-sdk slack destroy` deletes the provisioned app. Tokens left in
|
|
92
|
-
`.env.local` simply stop working.
|
|
65
|
+
## 2. Manual (`slack init --manual`)
|
|
93
66
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Use this when the user wants a Slack app they own at api.slack.com, not
|
|
97
|
-
a Cursor-managed app. Not the default. Do not offer it unless they
|
|
98
|
-
asked for a custom/unmanaged app or already have one. Update
|
|
99
|
-
`.agent-serve/slack/setup-status.json` as you complete phases.
|
|
100
|
-
|
|
101
|
-
### Phase 0 — Generate (agent)
|
|
67
|
+
Only when they own the app at api.slack.com.
|
|
102
68
|
|
|
103
69
|
```bash
|
|
104
70
|
agent-sdk slack init --manual --dir . --name "My Agent"
|
|
105
71
|
```
|
|
106
72
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
- `.agent-serve/slack/env.example` (`<PREFIX>_SLACK_BOT_TOKEN` / `_APP_TOKEN`)
|
|
112
|
-
- `.agent-serve/slack/setup-status.json`
|
|
113
|
-
|
|
114
|
-
Use `--no-prefix` for the shared `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN`
|
|
115
|
-
globals (single-agent only). Use `--prefix CUSTOM` to override the
|
|
116
|
-
default prefix. `--channel-posts` subscribes the manifests to
|
|
117
|
-
`message.channels` / `message.groups`.
|
|
118
|
-
|
|
119
|
-
These files omit `settings.managed_app_settings`. Slack accepts that
|
|
120
|
-
block only from a manager app's user token, so it belongs to
|
|
121
|
-
`slack create`, not to a manifest a human pastes in.
|
|
122
|
-
|
|
123
|
-
### Phase 1 — Create apps (human)
|
|
124
|
-
|
|
125
|
-
1. Open https://api.slack.com/apps → **Create New App** → **From a manifest**
|
|
126
|
-
2. Paste `manifest.dev.json` → create the *dev* app
|
|
127
|
-
3. Repeat with `manifest.prod.json` for prod
|
|
128
|
-
|
|
129
|
-
Stop and ask the human to complete this gate.
|
|
130
|
-
|
|
131
|
-
### Phase 2 — Install + tokens (human)
|
|
73
|
+
Writes `agent/channels/slack.ts` (`envPrefix` from the directory),
|
|
74
|
+
manifests under the project state directory, and `env.example`.
|
|
75
|
+
`--channel-posts` subscribes `message.channels` /
|
|
76
|
+
`message.groups`.
|
|
132
77
|
|
|
133
|
-
|
|
78
|
+
Human gates, one at a time. Stop after each.
|
|
134
79
|
|
|
135
|
-
1. **
|
|
136
|
-
|
|
137
|
-
|
|
80
|
+
1. **Create the app.** Create New App → From a manifest. Start
|
|
81
|
+
with `manifest.dev.json`.
|
|
82
|
+
2. **Install.** Install to Workspace. Copy the bot token
|
|
83
|
+
(`xoxb-...`).
|
|
84
|
+
3. **App token.** Create an app-level token with
|
|
85
|
+
`connections:write` (`xapp-...`).
|
|
86
|
+
4. **Write env.** Put both in `.env.local`. Then doctor.
|
|
138
87
|
|
|
139
|
-
|
|
88
|
+
Repeat for prod with the prod manifest.
|
|
140
89
|
|
|
141
|
-
|
|
90
|
+
## 3. Doctor and smoke
|
|
142
91
|
|
|
143
92
|
```bash
|
|
144
|
-
|
|
145
|
-
|
|
93
|
+
agent-sdk slack doctor --prefix JENNY
|
|
94
|
+
agent-sdk serve --dir . --dev
|
|
146
95
|
```
|
|
147
96
|
|
|
148
|
-
|
|
149
|
-
agent-sdk
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
Stop when `app_token`, `connections_open`, `bot_token`, and `auth_test`
|
|
153
|
-
are green.
|
|
154
|
-
|
|
155
|
-
### Phase 4 — Serve + smoke (agent + human)
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
agent-sdk dev .
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Confirm log: `[agent-sdk/slack] Socket Mode connected`.
|
|
162
|
-
|
|
163
|
-
When tokens are missing the channel logs
|
|
164
|
-
`channel idle reason=missing credentials need=…` and `serve` continues.
|
|
97
|
+
Green: `app_token`, `connections_open`, `bot_token`, `auth_test`.
|
|
98
|
+
Log: `[agent-sdk/slack] Socket Mode connected`. Missing tokens
|
|
99
|
+
idle the channel; `serve` continues.
|
|
165
100
|
|
|
166
|
-
|
|
101
|
+
1. Invite the bot
|
|
102
|
+
2. `@mention` or DM
|
|
103
|
+
3. Thinking / Working, then a threaded reply
|
|
104
|
+
4. Logs: `inbound kind=app_mention`, `session start`,
|
|
105
|
+
`reply delivered via postMessage|stream`
|
|
167
106
|
|
|
168
|
-
|
|
169
|
-
2. `@mention` it (or DM)
|
|
170
|
-
3. Confirm Thinking… / Working… typing and a threaded reply
|
|
171
|
-
4. Server logs should show correlated lines (`event_id`, `session`, `channel`, `thread_ts`):
|
|
172
|
-
- `inbound kind=app_mention …`
|
|
173
|
-
- `session start …`
|
|
174
|
-
- `reply delivered via postMessage|stream …`
|
|
107
|
+
## Watch channels (opt-in)
|
|
175
108
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- Chat streaming (`chat.startStream` / `appendStream` / `stopStream`) with postMessage fallback
|
|
179
|
-
- Thinking / task cards for tool calls
|
|
180
|
-
- `assistant.threads.setStatus` with rotating `loading_messages`
|
|
181
|
-
- Thread title + suggested prompts
|
|
182
|
-
- `markdown_text` when supported
|
|
183
|
-
- Handler `message` / `workspaceFiles` / `cloud` passthrough for PR demos
|
|
184
|
-
|
|
185
|
-
If a Slack API is unavailable (`method_not_found` / `missing_scope`), the pack falls back to postMessage + setStatus.
|
|
186
|
-
|
|
187
|
-
## Engagement: mentions by default, channel watch opt-in
|
|
188
|
-
|
|
189
|
-
The pack dispatches only on `app_mention` + DMs unless told otherwise:
|
|
190
|
-
summoned, never proactive. To watch channels (dispatch on new posts without
|
|
191
|
-
a mention), opt in explicitly:
|
|
109
|
+
Default is mentions + DMs only. To wake on new posts:
|
|
192
110
|
|
|
193
111
|
```ts
|
|
194
112
|
export default slackChannel({
|
|
113
|
+
envPrefix: "JENNY",
|
|
195
114
|
engagement: {
|
|
196
115
|
channelPosts: {
|
|
197
|
-
allow: ["#
|
|
198
|
-
posts: "top-level",
|
|
199
|
-
debounceMs: 15_000, // optional: edits settle, deletes cancel
|
|
116
|
+
allow: ["#alerts"], // ["*"] for every joined channel
|
|
117
|
+
posts: "top-level",
|
|
200
118
|
},
|
|
201
119
|
},
|
|
202
120
|
onChannelPost: async (ctx, message) => ({}), // null = skip
|
|
203
121
|
});
|
|
204
122
|
```
|
|
205
123
|
|
|
206
|
-
Pass `--channel-posts` on `
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
`app_mention` path; watch sessions reuse the thread-scoped principal with an
|
|
210
|
-
`engagement: "channel_post"` attribute, so a later mention continues the
|
|
211
|
-
thread. `engagement.mentions` / `engagement.directMessages` can be set to
|
|
212
|
-
`false` to turn those surfaces off.
|
|
213
|
-
|
|
214
|
-
## Tool approvals over Slack (opt-in HITL)
|
|
124
|
+
Pass `--channel-posts` on `create` / `init --manual`. Invite the
|
|
125
|
+
bot to each watched channel. Mentions stay on `app_mention`; a
|
|
126
|
+
later mention continues the watch thread.
|
|
215
127
|
|
|
216
|
-
|
|
217
|
-
that through Slack, set `toolApprovals: true` on `slackChannel`. It posts
|
|
218
|
-
Block Kit Approve/Deny cards and routes Socket Mode `interactive` clicks
|
|
219
|
-
back to the parked call:
|
|
128
|
+
## Approvals (opt-in)
|
|
220
129
|
|
|
221
130
|
```ts
|
|
222
131
|
export default slackChannel({
|
|
223
|
-
|
|
132
|
+
envPrefix: "JENNY",
|
|
224
133
|
toolApprovals: true,
|
|
225
134
|
});
|
|
226
135
|
```
|
|
227
136
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
on when `toolApprovals` is in play; `buildSlackManifest({ interactivity: true })`
|
|
232
|
-
is the same switch for existing apps.
|
|
233
|
-
- Composing by hand: spread `buildToolApprovalEvents({ credentials })` into
|
|
234
|
-
`events` **and** set `interactivity: true` on the channel.
|
|
235
|
-
- Cards show **redacted / truncated** args (Block Kit limits); execution
|
|
236
|
-
uses the full validated input. Review sensitive tools in the playground
|
|
237
|
-
when args may exceed the card.
|
|
238
|
-
- Approvals only exist for `execution: "server"` tools on the `local`
|
|
239
|
-
runtime, and parked calls do not survive a host restart.
|
|
240
|
-
- In `--dev` (loopback) or `--allow-anonymous` (trusted shared host), the
|
|
241
|
-
playground can also list Slack sessions and Approve/Deny
|
|
242
|
-
their parked tools (audit records the HTTP caller). Production and
|
|
243
|
-
bearer-auth hosts stay strict: Slack resolve must come from Slack
|
|
244
|
-
interactivity or a matching principal.
|
|
245
|
-
|
|
246
|
-
## Notes
|
|
247
|
-
|
|
248
|
-
- Dev and prod are **separate Slack apps** (separate tokens).
|
|
249
|
-
- Socket Mode is outbound only. No Events HTTP / Request URL path.
|
|
250
|
-
- Do not `await waitForCompletion()` inside Slack dispatch handlers. The pack uses `waitUntil`.
|
|
251
|
-
- Do not share one token pair across multiple agents in the same process.
|
|
252
|
-
|
|
253
|
-
## CLI reference
|
|
254
|
-
|
|
255
|
-
Wizard tooling is `create` / `destroy` / `icon` / `doctor`. Manual is
|
|
256
|
-
`init --manual` / `manifest` / `doctor`. `slack setup` prints this
|
|
257
|
-
guide. `slack init` hard-errors unless `--manual`.
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
agent-sdk slack setup
|
|
261
|
-
agent-sdk slack create --dir . # dashboard wizard (dev app)
|
|
262
|
-
agent-sdk slack create --dir . --prod # prod app
|
|
263
|
-
agent-sdk slack create --dir . --slack-team T0123ABCD
|
|
264
|
-
agent-sdk slack destroy --dir . [--prod] [--slack-team T0123ABCD]
|
|
265
|
-
agent-sdk slack init --manual --dir . --name "My Agent"
|
|
266
|
-
agent-sdk slack init --manual --dir . --no-prefix
|
|
267
|
-
agent-sdk slack init --manual --dir . --channel-posts
|
|
268
|
-
agent-sdk slack manifest --env both
|
|
269
|
-
agent-sdk slack doctor --prefix MY_AGENT
|
|
270
|
-
```
|
|
137
|
+
Wizard enables interactivity when this is set. Server tools on
|
|
138
|
+
`local` only. Parked calls die on host restart. Cards truncate
|
|
139
|
+
args; execution uses the full input.
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
continuationSource,
|
|
12
12
|
normalizeIdentity,
|
|
13
13
|
} from "../../internal/continuation-identity.js";
|
|
14
|
+
import { isDeferredChannelSession } from "../../internal/deferred-channel-session.js";
|
|
14
15
|
import { isDevMode } from "../../internal/dev-mode.js";
|
|
15
16
|
import { bindLocalIngressSend } from "../../internal/local-ingress.js";
|
|
16
17
|
import type {
|
|
@@ -1622,16 +1623,15 @@ async function startTurn(input: {
|
|
|
1622
1623
|
scheduleAfterAck(input.args, async () => {
|
|
1623
1624
|
await sendTurn();
|
|
1624
1625
|
});
|
|
1625
|
-
return
|
|
1626
|
-
Response.json(
|
|
1627
|
-
{ ok: true, dispatched: true, mode: "turn" },
|
|
1628
|
-
{ status: 202 }
|
|
1629
|
-
),
|
|
1630
|
-
"send"
|
|
1631
|
-
);
|
|
1626
|
+
return acknowledgeTurn();
|
|
1632
1627
|
}
|
|
1633
1628
|
|
|
1634
1629
|
const session = await sendTurn();
|
|
1630
|
+
if (isDeferredChannelSession(session)) {
|
|
1631
|
+
// Hosted admission captured the send; the control plane allocates the
|
|
1632
|
+
// session after acknowledgement, so there is nothing to report yet.
|
|
1633
|
+
return acknowledgeTurn();
|
|
1634
|
+
}
|
|
1635
1635
|
return withDispatchOutcome(
|
|
1636
1636
|
Response.json({
|
|
1637
1637
|
ok: true,
|
|
@@ -1677,12 +1677,27 @@ function scheduleAfterAck(
|
|
|
1677
1677
|
);
|
|
1678
1678
|
}
|
|
1679
1679
|
|
|
1680
|
+
/** 202 ack for a turn whose send completes after the response flushes. */
|
|
1681
|
+
function acknowledgeTurn(): Response {
|
|
1682
|
+
return withDispatchOutcome(
|
|
1683
|
+
Response.json(
|
|
1684
|
+
{ ok: true, dispatched: true, mode: "turn" },
|
|
1685
|
+
{ status: 202 }
|
|
1686
|
+
),
|
|
1687
|
+
"send"
|
|
1688
|
+
);
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1680
1691
|
function acknowledgeTask(
|
|
1681
1692
|
args: ChannelHandlerArgs,
|
|
1682
1693
|
dispatch: GitHubTaskDispatch,
|
|
1683
1694
|
extra: Record<string, unknown>
|
|
1684
1695
|
): Response {
|
|
1685
|
-
|
|
1696
|
+
// Hand the task the per-delivery send/waitUntil so hosted admission can
|
|
1697
|
+
// capture task-initiated sends; startup-captured sends bypass capture.
|
|
1698
|
+
scheduleAfterAck(args, () =>
|
|
1699
|
+
dispatch.task({ send: args.send, waitUntil: args.waitUntil })
|
|
1700
|
+
);
|
|
1686
1701
|
return withDispatchOutcome(
|
|
1687
1702
|
Response.json(
|
|
1688
1703
|
{ ok: true, dispatched: true, mode: "task", ...extra },
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ChannelEventHandlers,
|
|
8
8
|
ChannelStartArgs,
|
|
9
9
|
HostContext,
|
|
10
|
+
SendMessageFn,
|
|
10
11
|
SendMessageOptions,
|
|
11
12
|
} from "../../types.js";
|
|
12
13
|
import type { GitHubApiOptions } from "./api.js";
|
|
@@ -370,13 +371,29 @@ export interface GitHubTurnDispatch {
|
|
|
370
371
|
| Promise<GitHubWorkspaceFiles | undefined>);
|
|
371
372
|
}
|
|
372
373
|
|
|
374
|
+
/** Bound per-delivery helpers passed to a {@link GitHubTaskDispatch.task}. */
|
|
375
|
+
export interface GitHubTaskArgs {
|
|
376
|
+
/**
|
|
377
|
+
* Start (or resume) a session for this delivery. Locally this runs a real
|
|
378
|
+
* turn and returns the live session. In hosted admission it captures the
|
|
379
|
+
* send for the control plane to execute after `ses_…` is allocated and
|
|
380
|
+
* returns an inert deferred handle, so the task body keeps running.
|
|
381
|
+
* Always use this over a send captured at `onStart` — a startup-captured
|
|
382
|
+
* send bypasses hosted capture and is rejected during hosted admission.
|
|
383
|
+
*/
|
|
384
|
+
send: SendMessageFn;
|
|
385
|
+
/** Extend the delivery's background window past the task promise. */
|
|
386
|
+
waitUntil: (promise: Promise<unknown>) => void;
|
|
387
|
+
}
|
|
388
|
+
|
|
373
389
|
/**
|
|
374
390
|
* Run a host-side handler for the event instead of a model turn. The task
|
|
375
391
|
* runs in the background (`waitUntil`) after the webhook is acknowledged
|
|
376
|
-
* with a 202, so it can outlive GitHub's ~10s delivery timeout.
|
|
392
|
+
* with a 202, so it can outlive GitHub's ~10s delivery timeout. The callback
|
|
393
|
+
* receives {@link GitHubTaskArgs}; zero-argument tasks remain valid.
|
|
377
394
|
*/
|
|
378
395
|
export interface GitHubTaskDispatch {
|
|
379
|
-
task: () => void | Promise<void>;
|
|
396
|
+
task: (args: GitHubTaskArgs) => void | Promise<void>;
|
|
380
397
|
}
|
|
381
398
|
|
|
382
399
|
export type GitHubDispatchResult =
|