@cursor/july 0.1.95 → 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.
Files changed (220) hide show
  1. package/AGENTS.md +3 -4
  2. package/dist/channels/deployments/types.d.ts +1 -1
  3. package/dist/channels/deployments/types.d.ts.map +1 -1
  4. package/dist/channels/deployments/types.js +1 -0
  5. package/dist/channels/origin/api.d.ts +59 -13
  6. package/dist/channels/origin/api.d.ts.map +1 -1
  7. package/dist/channels/origin/api.js +168 -27
  8. package/dist/channels/origin/binding.d.ts +2 -2
  9. package/dist/channels/origin/checks.d.ts +6 -6
  10. package/dist/channels/origin/checks.js +6 -6
  11. package/dist/channels/origin/cursor-account.d.ts +5 -3
  12. package/dist/channels/origin/cursor-account.d.ts.map +1 -1
  13. package/dist/channels/origin/cursor-account.js +5 -3
  14. package/dist/channels/slack/api.d.ts +9 -0
  15. package/dist/channels/slack/api.d.ts.map +1 -1
  16. package/dist/channels/slack/api.js +36 -5
  17. package/dist/channels/slack/defaults.d.ts.map +1 -1
  18. package/dist/channels/slack/defaults.js +17 -46
  19. package/dist/channels/slack/dispatch.d.ts +7 -1
  20. package/dist/channels/slack/dispatch.d.ts.map +1 -1
  21. package/dist/channels/slack/dispatch.js +47 -23
  22. package/dist/channels/slack/inbound.d.ts +8 -0
  23. package/dist/channels/slack/inbound.d.ts.map +1 -1
  24. package/dist/channels/slack/inbound.js +32 -0
  25. package/dist/channels/slack/live-delivery.d.ts +26 -29
  26. package/dist/channels/slack/live-delivery.d.ts.map +1 -1
  27. package/dist/channels/slack/live-delivery.js +172 -73
  28. package/dist/channels/slack/manifest.d.ts.map +1 -1
  29. package/dist/channels/slack/manifest.js +5 -1
  30. package/dist/channels/slack/nudge-carrier.d.ts +2 -0
  31. package/dist/channels/slack/nudge-carrier.d.ts.map +1 -1
  32. package/dist/channels/slack/nudge-carrier.js +48 -1
  33. package/dist/channels/slack/slack-channel.d.ts.map +1 -1
  34. package/dist/channels/slack/slack-channel.js +2 -2
  35. package/dist/docs/404.html +2 -2
  36. package/dist/docs/ab.html +4 -4
  37. package/dist/docs/assets/{app.BBj0klBO.js → app.jXleCmOc.js} +1 -1
  38. package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
  39. package/dist/docs/assets/chunks/{VPLocalSearchBox.CUEXpL78.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
  40. package/dist/docs/assets/chunks/{theme.DabmQnia.js → theme.9ged-pr2.js} +2 -2
  41. package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
  42. package/dist/docs/assets/{index.md.BoHaMdeZ.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
  43. package/dist/docs/assets/{reference_cli.md.BsMOxDvh.js → reference_cli.md.CCnG-nJx.js} +2 -1
  44. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.js +2 -0
  45. package/dist/docs/assets/templates_code-wiki.md.CDYZIBFN.lean.js +1 -0
  46. package/dist/docs/building-with-agents.html +4 -4
  47. package/dist/docs/concepts.html +4 -4
  48. package/dist/docs/deployment.html +4 -4
  49. package/dist/docs/evals.html +4 -4
  50. package/dist/docs/guides/agent-to-agent.html +4 -4
  51. package/dist/docs/guides/cloud-runtime.html +4 -4
  52. package/dist/docs/guides/convert-automation.html +4 -4
  53. package/dist/docs/guides/github.html +4 -4
  54. package/dist/docs/guides/human-in-the-loop.html +4 -4
  55. package/dist/docs/guides/mcp-oauth.html +4 -4
  56. package/dist/docs/guides/opentelemetry.html +4 -4
  57. package/dist/docs/guides/slack.html +4 -4
  58. package/dist/docs/guides/webhooks.html +4 -4
  59. package/dist/docs/hashmap.json +1 -1
  60. package/dist/docs/hillclimbing.html +4 -4
  61. package/dist/docs/index.html +6 -6
  62. package/dist/docs/index.md +3 -1
  63. package/dist/docs/llms-full.txt +102 -3
  64. package/dist/docs/llms.txt +1 -0
  65. package/dist/docs/quickstart.html +4 -4
  66. package/dist/docs/reference/agent-config.html +4 -4
  67. package/dist/docs/reference/artifacts.html +4 -4
  68. package/dist/docs/reference/channels.html +4 -4
  69. package/dist/docs/reference/cli.html +7 -6
  70. package/dist/docs/reference/cli.md +3 -2
  71. package/dist/docs/reference/connections.html +4 -4
  72. package/dist/docs/reference/hooks.html +4 -4
  73. package/dist/docs/reference/http-api.html +4 -4
  74. package/dist/docs/reference/instructions.html +4 -4
  75. package/dist/docs/reference/playground.html +4 -4
  76. package/dist/docs/reference/project-layout.html +4 -4
  77. package/dist/docs/reference/prompt.html +4 -4
  78. package/dist/docs/reference/schedules.html +4 -4
  79. package/dist/docs/reference/sessions.html +4 -4
  80. package/dist/docs/reference/skills.html +4 -4
  81. package/dist/docs/reference/subagents.html +4 -4
  82. package/dist/docs/reference/tools.html +4 -4
  83. package/dist/docs/scaffolding-agents.html +4 -4
  84. package/dist/docs/storage.html +4 -4
  85. package/dist/docs/templates/agentic-owners.html +4 -4
  86. package/dist/docs/templates/code-wiki.html +28 -0
  87. package/dist/docs/templates/code-wiki.md +91 -0
  88. package/dist/docs/templates/demo.html +5 -5
  89. package/dist/docs/templates/pr-autofixer.html +4 -4
  90. package/dist/docs/templates/security-help.html +4 -4
  91. package/dist/docs/templates/security-reviewer.html +5 -5
  92. package/dist/docs/templates/triage.html +4 -4
  93. package/dist/docs/troubleshooting.html +4 -4
  94. package/dist/files-backends/cursor-hosted.d.ts +26 -4
  95. package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
  96. package/dist/files-backends/cursor-hosted.js +32 -4
  97. package/dist/internal/advertise-tools.d.ts +2 -0
  98. package/dist/internal/advertise-tools.d.ts.map +1 -1
  99. package/dist/internal/advertise-tools.js +15 -1
  100. package/dist/internal/bounded.d.ts +7 -0
  101. package/dist/internal/bounded.d.ts.map +1 -0
  102. package/dist/internal/bounded.js +32 -0
  103. package/dist/internal/cli-deploy.d.ts.map +1 -1
  104. package/dist/internal/cli-deploy.js +7 -1
  105. package/dist/internal/conversation-mirror.d.ts +11 -8
  106. package/dist/internal/conversation-mirror.d.ts.map +1 -1
  107. package/dist/internal/conversation-mirror.js +116 -55
  108. package/dist/internal/cursor/backend-client.d.ts.map +1 -1
  109. package/dist/internal/cursor/backend-client.js +22 -48
  110. package/dist/internal/cursor/session-token.d.ts +45 -0
  111. package/dist/internal/cursor/session-token.d.ts.map +1 -0
  112. package/dist/internal/cursor/session-token.js +99 -0
  113. package/dist/internal/cursor-agent-template.d.ts +1 -1
  114. package/dist/internal/cursor-agent-template.d.ts.map +1 -1
  115. package/dist/internal/cursor-agent-template.js +1 -0
  116. package/dist/internal/framework-file-storage.d.ts +61 -0
  117. package/dist/internal/framework-file-storage.d.ts.map +1 -0
  118. package/dist/internal/framework-file-storage.js +204 -0
  119. package/dist/internal/framework-storage-selection.d.ts +11 -5
  120. package/dist/internal/framework-storage-selection.d.ts.map +1 -1
  121. package/dist/internal/framework-storage-selection.js +38 -11
  122. package/dist/internal/hosted-delivery.d.ts +7 -0
  123. package/dist/internal/hosted-delivery.d.ts.map +1 -1
  124. package/dist/internal/hosted-delivery.js +4 -0
  125. package/dist/internal/init-project.d.ts.map +1 -1
  126. package/dist/internal/init-project.js +2 -0
  127. package/dist/internal/install-cursor-skills.d.ts.map +1 -1
  128. package/dist/internal/install-cursor-skills.js +1 -3
  129. package/dist/internal/managed-delivery.d.ts +80 -0
  130. package/dist/internal/managed-delivery.d.ts.map +1 -0
  131. package/dist/internal/managed-delivery.js +86 -0
  132. package/dist/internal/runtime-dispatch-runner.d.ts +5 -1
  133. package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
  134. package/dist/internal/runtime-dispatch-runner.js +7 -0
  135. package/dist/internal/sdk-runner.d.ts +11 -0
  136. package/dist/internal/sdk-runner.d.ts.map +1 -1
  137. package/dist/internal/sdk-runner.js +39 -8
  138. package/dist/internal/server.js +1 -0
  139. package/dist/internal/session-engine.d.ts +13 -0
  140. package/dist/internal/session-engine.d.ts.map +1 -1
  141. package/dist/internal/session-engine.js +62 -3
  142. package/dist/internal/steering.d.ts +15 -0
  143. package/dist/internal/steering.d.ts.map +1 -0
  144. package/dist/internal/steering.js +18 -0
  145. package/dist/playground/assets/index-B1DDvBeC.css +1 -0
  146. package/dist/playground/assets/{index-CZA1uEWA.js → index-Cx9CclK_.js} +51 -51
  147. package/dist/playground/index.html +2 -2
  148. package/dist/storage-backends/cursor-hosted.d.ts +8 -5
  149. package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
  150. package/dist/storage-backends/cursor-hosted.js +4 -3
  151. package/dist/types.d.ts +2 -1
  152. package/dist/types.d.ts.map +1 -1
  153. package/docs/README.md +3 -1
  154. package/docs/reference/cli.md +3 -2
  155. package/docs/templates/code-wiki.md +96 -0
  156. package/package.json +2 -2
  157. package/skills/ab/SKILL.md +13 -97
  158. package/skills/create-agent/SKILL.md +123 -223
  159. package/skills/debug/SKILL.md +34 -68
  160. package/skills/evals/SKILL.md +55 -180
  161. package/skills/framework-map/SKILL.md +83 -145
  162. package/skills/github/SKILL.md +53 -111
  163. package/skills/hillclimb/SKILL.md +40 -163
  164. package/skills/mcp-auth/SKILL.md +48 -107
  165. package/skills/otel/SKILL.md +22 -68
  166. package/skills/setup-slack/SKILL.md +77 -208
  167. package/src/channels/deployments/types.ts +1 -0
  168. package/src/channels/origin/api.ts +242 -30
  169. package/src/channels/origin/binding.ts +2 -2
  170. package/src/channels/origin/checks.ts +6 -6
  171. package/src/channels/origin/cursor-account.ts +5 -3
  172. package/src/channels/slack/api.ts +41 -5
  173. package/src/channels/slack/defaults.ts +15 -49
  174. package/src/channels/slack/dispatch.ts +56 -22
  175. package/src/channels/slack/inbound.ts +43 -0
  176. package/src/channels/slack/live-delivery.ts +235 -114
  177. package/src/channels/slack/manifest.ts +5 -1
  178. package/src/channels/slack/nudge-carrier.ts +48 -1
  179. package/src/channels/slack/slack-channel.ts +2 -0
  180. package/src/files-backends/cursor-hosted.ts +40 -7
  181. package/src/internal/advertise-tools.ts +18 -2
  182. package/src/internal/bounded.ts +28 -0
  183. package/src/internal/cli-deploy.ts +12 -0
  184. package/src/internal/conversation-mirror.ts +145 -69
  185. package/src/internal/cursor/backend-client.ts +34 -58
  186. package/src/internal/cursor/session-token.ts +115 -0
  187. package/src/internal/cursor-agent-template.ts +1 -0
  188. package/src/internal/framework-file-storage.ts +222 -0
  189. package/src/internal/framework-storage-selection.ts +51 -11
  190. package/src/internal/hosted-delivery.ts +10 -0
  191. package/src/internal/init-project.ts +2 -0
  192. package/src/internal/install-cursor-skills.ts +1 -4
  193. package/src/internal/managed-delivery.ts +125 -0
  194. package/src/internal/runtime-dispatch-runner.ts +10 -0
  195. package/src/internal/sdk-runner.ts +56 -8
  196. package/src/internal/server.ts +2 -0
  197. package/src/internal/session-engine.ts +64 -4
  198. package/src/internal/steering.ts +17 -0
  199. package/src/storage-backends/cursor-hosted.ts +9 -7
  200. package/src/types.ts +2 -1
  201. package/templates/code-wiki/README.md +34 -0
  202. package/templates/code-wiki/agent/agent.ts +8 -0
  203. package/templates/code-wiki/agent/channels/github.ts +144 -0
  204. package/templates/code-wiki/agent/instructions.md +39 -0
  205. package/templates/code-wiki/agent/lib/repos.ts +5 -0
  206. package/templates/code-wiki/agent/lib/wiki.ts +22 -0
  207. package/templates/code-wiki/agent/tools/apply_wiki.ts +219 -0
  208. package/templates/code-wiki/evals/evals.config.ts +5 -0
  209. package/templates/code-wiki/evals/wiki.eval.ts +132 -0
  210. package/templates/code-wiki/init.json +25 -0
  211. package/templates/code-wiki/package.json +18 -0
  212. package/templates/code-wiki/tsconfig.json +12 -0
  213. package/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +0 -1
  214. package/dist/docs/assets/index.md.BoHaMdeZ.js +0 -5
  215. package/dist/internal/deployment-scm-event-stream.d.ts +0 -116
  216. package/dist/internal/deployment-scm-event-stream.d.ts.map +0 -1
  217. package/dist/internal/deployment-scm-event-stream.js +0 -474
  218. package/dist/playground/assets/index-CF7hUDnQ.css +0 -1
  219. package/src/internal/deployment-scm-event-stream.ts +0 -593
  220. /package/dist/docs/assets/{reference_cli.md.BsMOxDvh.lean.js → reference_cli.md.CCnG-nJx.lean.js} +0 -0
@@ -1,80 +1,48 @@
1
1
  ---
2
2
  name: agentsdk-otel
3
3
  description: >-
4
- Wire OpenTelemetry export for an Agent SDK agent (defineOtel, OTLP env,
5
- traces/metrics/logs, ctx.host.otel). Use when adding observability,
6
- Datadog/Grafana/OTLP export, session/turn/tool tracing, or custom metrics.
4
+ Wire OpenTelemetry export (defineOtel, OTLP env, traces/metrics/logs,
5
+ ctx.host.otel). Use when adding collector export or custom metrics.
7
6
  ---
8
7
 
9
8
  # Agent SDK OpenTelemetry (`defineOtel`)
10
9
 
11
- Public docs index: `node_modules/@cursor/july/dist/docs/llms.txt`. A running
12
- host serves the same index at `/docs/llms.txt`.
10
+ Push traces and metrics from the serve process to an OTLP
11
+ collector. Logs are off until you opt in.
13
12
 
14
- Push session, turn, tool, and subagent traces, plus token and cost
15
- metrics, from the serve process to an OTLP collector. Logs are off
16
- until you opt in.
17
-
18
- Read [OpenTelemetry](../../docs/guides/opentelemetry.md) for the full
19
- guide, including how this joins Cursor enterprise export.
13
+ Guide: `docs/guides/opentelemetry.md`.
20
14
 
21
15
  ## Enable
22
16
 
23
17
  Any one of:
24
18
 
25
- 1. **Env.** Set `OTEL_EXPORTER_OTLP_ENDPOINT` (and optional
19
+ 1. `OTEL_EXPORTER_OTLP_ENDPOINT` (optional
26
20
  `OTEL_SERVICE_NAME`, `OTEL_EXPORTER_OTLP_HEADERS`,
27
- `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf|http/json`).
28
- Per-signal URLs work when the base URL is unset:
29
- `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` / `_METRICS_ENDPOINT` /
30
- `_LOGS_ENDPOINT`.
31
- 2. **Authored.** `agent/otel.ts`:
21
+ `OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf|http/json`)
22
+ 2. `agent/otel.ts`:
32
23
 
33
24
  ```ts
34
25
  import { defineOtel } from "@cursor/july/otel";
35
26
 
36
27
  export default defineOtel({
37
28
  serviceName: "cursor",
38
- exporters: [
39
- {
40
- url: "https://otel.example.com",
41
- protocol: "http/protobuf",
42
- headers: { Authorization: "Bearer …" },
43
- },
44
- ],
29
+ exporters: [{ url: "https://otel.example.com", protocol: "http/protobuf" }],
45
30
  });
46
31
  ```
47
32
 
48
- 3. **Programmatic.** `serve(dir, { otel: { … } })`. Pass `otel: false`
49
- to disable even when env or `agent/otel.ts` are set.
50
-
51
- Multiple `exporters` fan out. Default protocol is `http/protobuf`.
52
- Use `http/json` only when the collector requires it. `grpc` is ignored.
53
-
54
- Precedence: `serve({ otel })` over `agent/otel.ts` over env.
55
-
56
- ## Signals
57
-
58
- | Signal | Default | What |
59
- | --- | --- | --- |
60
- | Traces | on | `agent_sdk.http` → `agent_sdk.session` → `agent_sdk.turn` → `agent_sdk.tool` / `agent_sdk.subagent` |
61
- | Metrics | on | `cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`, plus `agent_sdk.*` counts and HTTP duration |
62
- | Logs | off | Opt in with `logs: true`, `OTEL_LOGS_EXPORTER=otlp`, or `OTEL_LOG_USER_PROMPTS=1` / `OTEL_LOG_TOOL_CONTENT=1` |
33
+ 3. `serve(dir, { otel: { … } })`. `otel: false` disables env and
34
+ authored config.
63
35
 
64
- Prompt text, tool payloads, and failure text stay off the wire unless
65
- those flags are set.
36
+ | Signal | Default |
37
+ | --- | --- |
38
+ | Traces | on (`agent_sdk.http` → session → turn → tool / subagent) |
39
+ | Metrics | on (`cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`) |
40
+ | Logs | off (`logs: true` or `OTEL_LOGS_EXPORTER=otlp`) |
66
41
 
67
- ## Custom metrics (`ctx.host.otel`)
42
+ Prompt text and tool payloads stay off the wire unless you set
43
+ `OTEL_LOG_USER_PROMPTS` / `OTEL_LOG_TOOL_CONTENT`.
68
44
 
69
- Always present. `increment` / `record` no-op without a meter.
70
- `setAttributes` still tags the open session when a collector is
71
- attached. Prefix names with team or agent. No custom spans. Reserved
72
- metric names: `cursor.token.usage`, `cursor.tool.calls`,
73
- `cursor.cost.usage`, `agent_sdk.session.count`,
74
- `agent_sdk.turn.count`, `agent_sdk.subagent.count`,
75
- `agent_sdk.http.duration`. Reserved attributes:
76
- `cursor.conversation.id`, `agent_sdk.agent`, `agent_sdk.turn_id`,
77
- `agent_sdk.framework`.
45
+ ## Custom metrics
78
46
 
79
47
  ```ts
80
48
  ctx.host.otel.setAttributes({ "abc.ticket_id": "INC-123" });
@@ -82,20 +50,6 @@ ctx.host.otel.increment("abc.ticket.resolved");
82
50
  ctx.host.otel.record("abc.approval.duration_ms", 1420);
83
51
  ```
84
52
 
85
- ## Attributes worth joining on
86
-
87
- - `cursor.conversation.id` (session id)
88
- - `cursor.tool.name` / `cursor.tool.kind` / `cursor.tool.status`
89
- - `cursor.token.type`, `cursor.model.name`
90
- - `agent_sdk.agent`, `agent_sdk.turn_id`, `agent_sdk.call_id`, `agent_sdk.channel`
91
-
92
- Resource defaults: `service.name=cursor`, `cursor.entrypoint=sdk_ts`,
93
- `cursor.surface=unspecified`.
94
-
95
- Inbound HTTP extracts W3C `traceparent`, so a channel request parents
96
- the session span when the turn starts in that request.
97
-
98
- If another TracerProvider already owns the process (CLI / IDE), Agent
99
- SDK reuses it. Run `serve` as its own process when Agent SDK should
100
- own the destination. Conflicting `agent/otel.ts` files across mounts
101
- fail at serve start.
53
+ Prefix names with team or agent. No custom spans. Join on
54
+ `cursor.conversation.id` and `agent_sdk.agent`. Run `serve` as its
55
+ own process when Agent SDK should own the destination.
@@ -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 with
5
- slack create (dashboard wizard), then doctor and smoke. Use the manual
6
- manifest path only when the user owns the Slack app. Use when adding
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
- Public docs index: `node_modules/@cursor/july/dist/docs/llms.txt`. A running
13
- host serves the same index at `/docs/llms.txt`.
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
- Use this skill when a human asks to wire Slack to an Agent SDK agent.
15
+ Do not generate manifests or ask anyone to paste tokens unless
16
+ they asked for `slack init --manual`.
16
17
 
17
- `slackChannel()` is a dedicated Socket Mode Slack app: the agent's own
18
- bot user. `agent-sdk slack create` opens a signed-in Cursor dashboard
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
- Do not generate manifests or ask anyone to paste tokens unless they
23
- asked for a custom Slack app (`slack init --manual`).
21
+ Guide: `docs/guides/slack.md`.
24
22
 
25
- Existing bots that already have `<PREFIX>_SLACK_BOT_TOKEN` and
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
- That opens the signed-in Cursor dashboard. Sign in as the same Cursor
40
- account that ran the command. Click **Add Slack to this agent**, approve
41
- Slack's consent screen, pick the bot name, and continue. The CLI waits
42
- and writes `<PREFIX>_SLACK_BOT_TOKEN` / `<PREFIX>_SLACK_APP_TOKEN` into
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
- If Slack asks a workspace admin to approve the app, keep the CLI
50
- running. Open Slack's **Request approval** page (the CLI prints the
51
- link; the same URL is **Send a reminder** after you submit). Managed
52
- install does not file the request. After an admin approves, click
53
- **Retry** in the wizard.
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
- `create` scaffolds `agent/channels/slack.ts` when missing. Do not paste
56
- a manifest at api.slack.com for this path. `slack init` without
57
- `--manual` hard-errors; see the manual path below for a hand-imported
58
- app.
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
- Existing tokens in `.env.local` keep working. Skip the wizard for those
61
- agents unless you want a Cursor-managed app.
46
+ `create` scaffolds `agent/channels/slack.ts` when missing:
62
47
 
63
- Then:
64
-
65
- ```bash
66
- agent-sdk slack doctor --prefix MY_AGENT
67
- agent-sdk dev .
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
- Confirm log: `[agent-sdk/slack] Socket Mode connected`.
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
- 1. Invite the bot to a channel
78
- 2. `@mention` it (or DM)
79
- 3. Confirm Thinking… / Working… typing and a threaded reply
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
- The dashboard lists a first-run agent as **Not deployed yet**. Local
86
- serve does not need a hosted engine. The next `agent-sdk deploy` (or
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
- A second `slack create` for the same agent and env overwrites that Slack
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
- ## Manual Slack app (`slack init --manual`)
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
- Creates:
108
-
109
- - `agent/channels/slack.ts` with `envPrefix` from the directory name
110
- - `.agent-serve/slack/manifest.{dev,prod}.json`
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
- For each app:
78
+ Human gates, one at a time. Stop after each.
134
79
 
135
- 1. **Install to Workspace** copy Bot User OAuth Token (`xoxb-…`)
136
- 2. **Basic Information → App-Level Tokens** — Create Token with scope
137
- `connections:write` copy (`xapp-…`)
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
- ### Phase 3 Env (agent)
88
+ Repeat for prod with the prod manifest.
140
89
 
141
- Write into `.env.local` (dev app), using the keys from `env.example`:
90
+ ## 3. Doctor and smoke
142
91
 
143
92
  ```bash
144
- MY_AGENT_SLACK_BOT_TOKEN=xoxb-…
145
- MY_AGENT_SLACK_APP_TOKEN=xapp-…
93
+ agent-sdk slack doctor --prefix JENNY
94
+ agent-sdk serve --dir . --dev
146
95
  ```
147
96
 
148
- ```bash
149
- agent-sdk slack doctor --prefix MY_AGENT
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
- Human:
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
- 1. Invite the bot to a channel
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
- ## Features (defaults ON)
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: ["#issues-cursor-desktop"], // use ["*"] for every joined channel
198
- posts: "top-level", // default — thread replies never dispatch
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 `slack create` or `slack init --manual` so the
207
- app subscribes to `message.channels` / `message.groups`. Invite the bot to
208
- each watched channel. Posts mentioning the bot stay on the
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
- Tools with `needsApproval` park until a human approves or denies. To route
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
- credentials: { /* … */ },
132
+ envPrefix: "JENNY",
224
133
  toolApprovals: true,
225
134
  });
226
135
  ```
227
136
 
228
- Requirements and caveats:
229
-
230
- - The Slack app needs **interactivity** enabled. The wizard turns this
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.
@@ -7,6 +7,7 @@ export const DEPLOYMENTS_CHANNEL_KIND = "deployments";
7
7
  export const DEPLOYMENT_EVENT_TYPES = [
8
8
  "deployment.created",
9
9
  "deployment.succeeded",
10
+ "deployment.failed",
10
11
  ] as const;
11
12
  export type DeploymentEventType = (typeof DEPLOYMENT_EVENT_TYPES)[number];
12
13