@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.
- 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/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/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/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.BBj0klBO.js → app.jXleCmOc.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CUEXpL78.js → VPLocalSearchBox.8LhyglIT.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DabmQnia.js → theme.9ged-pr2.js} +2 -2
- package/dist/docs/assets/index.md.CI93Ltlb.js +5 -0
- package/dist/docs/assets/{index.md.BoHaMdeZ.lean.js → index.md.CI93Ltlb.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.BsMOxDvh.js → reference_cli.md.CCnG-nJx.js} +2 -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/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 +3 -1
- package/dist/docs/llms-full.txt +102 -3
- package/dist/docs/llms.txt +1 -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 +7 -6
- package/dist/docs/reference/cli.md +3 -2
- 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 +4 -4
- 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 +4 -4
- package/dist/docs/templates/code-wiki.html +28 -0
- package/dist/docs/templates/code-wiki.md +91 -0
- package/dist/docs/templates/demo.html +5 -5
- 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 +4 -4
- package/dist/files-backends/cursor-hosted.d.ts +26 -4
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +32 -4
- 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 +7 -1
- package/dist/internal/conversation-mirror.d.ts +11 -8
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +116 -55
- 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/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 +11 -5
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +38 -11
- package/dist/internal/hosted-delivery.d.ts +7 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +4 -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/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/sdk-runner.d.ts +11 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +39 -8
- package/dist/internal/server.js +1 -0
- 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 +62 -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-CZA1uEWA.js → index-Cx9CclK_.js} +51 -51
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +8 -5
- 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 +3 -1
- package/docs/reference/cli.md +3 -2
- package/docs/templates/code-wiki.md +96 -0
- 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/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/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/slack-channel.ts +2 -0
- package/src/files-backends/cursor-hosted.ts +40 -7
- package/src/internal/advertise-tools.ts +18 -2
- package/src/internal/bounded.ts +28 -0
- package/src/internal/cli-deploy.ts +12 -0
- package/src/internal/conversation-mirror.ts +145 -69
- 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/framework-file-storage.ts +222 -0
- package/src/internal/framework-storage-selection.ts +51 -11
- package/src/internal/hosted-delivery.ts +10 -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/runtime-dispatch-runner.ts +10 -0
- package/src/internal/sdk-runner.ts +56 -8
- package/src/internal/server.ts +2 -0
- package/src/internal/session-engine.ts +64 -4
- package/src/internal/steering.ts +17 -0
- package/src/storage-backends/cursor-hosted.ts +9 -7
- package/src/types.ts +2 -1
- 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/dist/docs/assets/chunks/@localSearchIndexroot.oqPawjiD.js +0 -1
- package/dist/docs/assets/index.md.BoHaMdeZ.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-CF7hUDnQ.css +0 -1
- package/src/internal/deployment-scm-event-stream.ts +0 -593
- /package/dist/docs/assets/{reference_cli.md.BsMOxDvh.lean.js → reference_cli.md.CCnG-nJx.lean.js} +0 -0
package/skills/otel/SKILL.md
CHANGED
|
@@ -1,80 +1,48 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentsdk-otel
|
|
3
3
|
description: >-
|
|
4
|
-
Wire OpenTelemetry export
|
|
5
|
-
|
|
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
|
-
|
|
12
|
-
|
|
10
|
+
Push traces and metrics from the serve process to an OTLP
|
|
11
|
+
collector. Logs are off until you opt in.
|
|
13
12
|
|
|
14
|
-
|
|
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.
|
|
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
|
-
|
|
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.
|
|
49
|
-
|
|
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
|
-
|
|
65
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
|
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.
|