@cursor/july 0.1.49 → 0.1.51
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 -3
- package/README.md +7 -14
- package/dist/bin/agent-serve.js +22 -8
- package/dist/channels/slack/init.d.ts +2 -3
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +8 -43
- package/dist/channels/slack/manifest.d.ts +3 -3
- package/dist/channels/slack/manifest.js +3 -3
- package/dist/channels/slack/setup.d.ts +2 -11
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +26 -94
- package/dist/channels/slack/types.d.ts +3 -4
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +3 -3
- package/dist/docs/assets/{app.BpWAgjaR.js → app.C51TX1Bw.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.D2DpXdZN.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CnAktZtG.js → VPLocalSearchBox.BB9HCJPq.js} +1 -1
- package/dist/docs/assets/chunks/{theme.B5IvUxOB.js → theme.Dp-0SZcu.js} +2 -2
- package/dist/docs/assets/{deployment.md.Cdp4rTE4.js → deployment.md.B8kW-h7P.js} +1 -1
- package/dist/docs/assets/{example-agents_benny.md.l7JTmm8X.js → example-agents_benny.md.B-LIDGja.js} +1 -1
- package/dist/docs/assets/{example-agents_oncall.md.ZE0n6ZFN.js → example-agents_oncall.md.CBmyuAKc.js} +2 -2
- package/dist/docs/assets/{guides_human-in-the-loop.md.BWvT7UqY.js → guides_human-in-the-loop.md.Cf8kIIqC.js} +2 -2
- package/dist/docs/assets/{guides_human-in-the-loop.md.BWvT7UqY.lean.js → guides_human-in-the-loop.md.Cf8kIIqC.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.zriQpU_9.js → guides_slack.md.D2nTRu9M.js} +7 -12
- package/dist/docs/assets/guides_slack.md.D2nTRu9M.lean.js +1 -0
- package/dist/docs/assets/{reference_cli.md.BDmjPPAm.js → reference_cli.md.CGKfz_Yj.js} +3 -7
- package/dist/docs/assets/{reference_cli.md.BDmjPPAm.lean.js → reference_cli.md.CGKfz_Yj.lean.js} +1 -1
- package/dist/docs/assets/{troubleshooting.md.CkgwmVI0.js → troubleshooting.md.C6n3wCr6.js} +1 -1
- package/dist/docs/building-with-agents.html +3 -3
- package/dist/docs/concepts.html +3 -3
- package/dist/docs/deployment.html +5 -5
- package/dist/docs/evals.html +3 -3
- package/dist/docs/example-agents/approval-buddy.html +3 -3
- package/dist/docs/example-agents/benny.html +5 -5
- package/dist/docs/example-agents/bugbot.html +3 -3
- package/dist/docs/example-agents/codebase-wiki.html +3 -3
- package/dist/docs/example-agents/codeowners-review.html +3 -3
- package/dist/docs/example-agents/concierge.html +3 -3
- package/dist/docs/example-agents/fsd.html +3 -3
- package/dist/docs/example-agents/index.html +3 -3
- package/dist/docs/example-agents/knowledge-base.html +3 -3
- package/dist/docs/example-agents/oncall.html +6 -6
- package/dist/docs/example-agents/security-reviewer.html +3 -3
- package/dist/docs/example-agents/slack-agent.html +3 -3
- package/dist/docs/example-agents/weather-agent.html +3 -3
- package/dist/docs/guides/agent-to-agent.html +3 -3
- package/dist/docs/guides/cloud-runtime.html +3 -3
- package/dist/docs/guides/github.html +3 -3
- package/dist/docs/guides/human-in-the-loop.html +5 -5
- package/dist/docs/guides/mcp-oauth.html +3 -3
- package/dist/docs/guides/opentelemetry.html +3 -3
- package/dist/docs/guides/slack.html +11 -16
- package/dist/docs/guides/webhooks.html +3 -3
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +3 -3
- package/dist/docs/index.html +3 -3
- package/dist/docs/quickstart.html +3 -3
- package/dist/docs/reference/agent-config.html +3 -3
- package/dist/docs/reference/artifacts.html +3 -3
- package/dist/docs/reference/channels.html +3 -3
- package/dist/docs/reference/cli.html +6 -10
- package/dist/docs/reference/connections.html +3 -3
- package/dist/docs/reference/hooks.html +3 -3
- package/dist/docs/reference/http-api.html +3 -3
- package/dist/docs/reference/instructions.html +3 -3
- package/dist/docs/reference/playground.html +3 -3
- package/dist/docs/reference/project-layout.html +3 -3
- package/dist/docs/reference/prompt.html +3 -3
- package/dist/docs/reference/schedules.html +3 -3
- package/dist/docs/reference/sessions.html +3 -3
- package/dist/docs/reference/skills.html +3 -3
- package/dist/docs/reference/subagents.html +3 -3
- package/dist/docs/reference/tools.html +3 -3
- package/dist/docs/scaffolding-agents.html +3 -3
- package/dist/docs/storage.html +3 -3
- package/dist/docs/templates/triage.html +3 -3
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/internal/cli-ax.js +3 -3
- package/dist/internal/cli-cursor.d.ts +18 -0
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +25 -0
- package/dist/internal/cli-slack.d.ts +3 -4
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +126 -322
- package/dist/internal/convert-automation/convert-workflow.js +2 -2
- package/dist/internal/slack-provision-client.d.ts +37 -2
- package/dist/internal/slack-provision-client.d.ts.map +1 -1
- package/dist/internal/slack-provision-client.js +46 -0
- package/dist/playground/assets/{index-Dq_HqyU-.js → index-BKMz70wx.js} +39 -39
- package/dist/playground/assets/index-BmMrulSc.css +1 -0
- package/dist/playground/index.html +2 -2
- package/docs/deployment.md +1 -1
- package/docs/example-agents/benny.md +2 -3
- package/docs/example-agents/oncall.md +4 -5
- package/docs/guides/human-in-the-loop.md +1 -1
- package/docs/guides/slack.md +51 -112
- package/docs/reference/cli.md +14 -37
- package/docs/troubleshooting.md +2 -2
- package/package.json +1 -1
- package/skills/create-agent/SKILL.md +4 -5
- package/skills/setup-slack/SKILL.md +73 -131
- package/src/bin/agent-serve.ts +26 -9
- package/src/channels/slack/init.ts +10 -71
- package/src/channels/slack/manifest.ts +3 -3
- package/src/channels/slack/setup.ts +25 -103
- package/src/channels/slack/types.ts +3 -4
- package/src/internal/cli-ax.ts +3 -3
- package/src/internal/cli-cursor.ts +34 -0
- package/src/internal/cli-slack.ts +136 -389
- package/src/internal/convert-automation/convert-workflow.ts +2 -2
- package/src/internal/slack-provision-client.ts +83 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.D00d772K.js +0 -1
- package/dist/docs/assets/guides_slack.md.zriQpU_9.lean.js +0 -1
- package/dist/playground/assets/index-Dox74yWJ.css +0 -1
- /package/dist/docs/assets/{deployment.md.Cdp4rTE4.lean.js → deployment.md.B8kW-h7P.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_benny.md.l7JTmm8X.lean.js → example-agents_benny.md.B-LIDGja.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_oncall.md.ZE0n6ZFN.lean.js → example-agents_oncall.md.CBmyuAKc.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.CkgwmVI0.lean.js → troubleshooting.md.C6n3wCr6.lean.js} +0 -0
|
@@ -1,111 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slack setup guide printed by `agent-serve slack setup`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* dedicated-app phases. {@link SLACK_SETUP_PHASES} stays the dedicated-app
|
|
7
|
-
* checklist — its ids key `.agent-serve/slack/setup-status.json`.
|
|
4
|
+
* Two products: Cursor-hosted (`cursorAccount`) vs a dedicated Socket
|
|
5
|
+
* Mode app via `slack create` (dashboard wizard).
|
|
8
6
|
*/
|
|
9
7
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
actor: "agent" | "human";
|
|
13
|
-
title: string;
|
|
14
|
-
steps: string[];
|
|
15
|
-
}
|
|
8
|
+
export function formatSlackSetupGuide(): string {
|
|
9
|
+
return `agent-serve — Slack setup
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
id: "generate",
|
|
20
|
-
actor: "agent",
|
|
21
|
-
title: "Generate channel + manifests",
|
|
22
|
-
steps: [
|
|
23
|
-
"agent-serve slack init --dir . --name My Agent",
|
|
24
|
-
"Manifests default to Socket Mode (no public Request URL).",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: "createApps",
|
|
29
|
-
actor: "human",
|
|
30
|
-
title: "Create two Slack apps from manifests",
|
|
31
|
-
steps: [
|
|
32
|
-
"Open https://api.slack.com/apps -> Create New App from a manifest",
|
|
33
|
-
"Paste .agent-serve/slack/manifest.dev.json -> create the *dev* app",
|
|
34
|
-
"Repeat with manifest.prod.json for the *prod* app",
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: "install",
|
|
39
|
-
actor: "human",
|
|
40
|
-
title: "Install + mint App-Level Token",
|
|
41
|
-
steps: [
|
|
42
|
-
"Install to Workspace; copy Bot User OAuth Token (xoxb-...)",
|
|
43
|
-
"App-Level Tokens: create token with connections:write; copy xapp-...",
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "env",
|
|
48
|
-
actor: "agent",
|
|
49
|
-
title: "Wire environment",
|
|
50
|
-
steps: [
|
|
51
|
-
"Write per-agent tokens into .env.local (see .agent-serve/slack/env.example)",
|
|
52
|
-
"Multi-agent: <PREFIX>_SLACK_BOT_TOKEN + <PREFIX>_SLACK_APP_TOKEN",
|
|
53
|
-
"Single agent: SLACK_BOT_TOKEN + SLACK_APP_TOKEN (--no-prefix)",
|
|
54
|
-
"agent-serve slack doctor --prefix <PREFIX>",
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: "serve",
|
|
59
|
-
actor: "agent",
|
|
60
|
-
title: "Serve",
|
|
61
|
-
steps: [
|
|
62
|
-
"agent-serve serve --dir . --dev",
|
|
63
|
-
"Confirm log: [agent-sdk/slack] Socket Mode connected",
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: "smoke",
|
|
68
|
-
actor: "human",
|
|
69
|
-
title: "Smoke test",
|
|
70
|
-
steps: [
|
|
71
|
-
"Invite the bot to a channel",
|
|
72
|
-
"@mention it or DM it",
|
|
73
|
-
"Confirm logs: inbound → session start → reply delivered",
|
|
74
|
-
"Confirm streaming reply and rotating status",
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
];
|
|
11
|
+
Two products. Pick one.
|
|
78
12
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
lines.push(`## Phase ${index} — ${phase.title} (${phase.actor})`);
|
|
100
|
-
for (const step of phase.steps) {
|
|
101
|
-
lines.push(` - ${step}`);
|
|
102
|
-
}
|
|
103
|
-
lines.push("");
|
|
104
|
-
}
|
|
105
|
-
lines.push("Status file: .agent-serve/slack/setup-status.json");
|
|
106
|
-
lines.push(
|
|
107
|
-
"Skill (Cursor): packages/agent-serve/skills/setup-slack/SKILL.md"
|
|
108
|
-
);
|
|
109
|
-
lines.push("");
|
|
110
|
-
return lines.join("\n");
|
|
13
|
+
A) Cursor-hosted (recommended default, zero Slack admin):
|
|
14
|
+
slackChannel({ cursorAccount: true, agentName: "MyAgent" })
|
|
15
|
+
Sign in (agent-serve login / CURSOR_API_KEY), serve, then mention
|
|
16
|
+
"@Cursor MyAgent ..." in the linked workspace. No app, no tokens.
|
|
17
|
+
|
|
18
|
+
B) Dedicated Slack app (Socket Mode):
|
|
19
|
+
agent-serve slack create --dir .
|
|
20
|
+
Opens the signed-in Cursor dashboard wizard. Finish Slack consent
|
|
21
|
+
and the bot name there. The CLI writes tokens into .env.local.
|
|
22
|
+
Use this when you need your own bot user, channel watching
|
|
23
|
+
(engagement.channelPosts), or approval buttons.
|
|
24
|
+
|
|
25
|
+
Do not paste a manifest at api.slack.com. \`slack init\` is removed.
|
|
26
|
+
|
|
27
|
+
Then:
|
|
28
|
+
- agent-serve serve --dir . --dev
|
|
29
|
+
- Invite the bot (Path B) or mention @Cursor <name> (Path A)
|
|
30
|
+
|
|
31
|
+
Skill: packages/agent-serve/skills/setup-slack/SKILL.md
|
|
32
|
+
`;
|
|
111
33
|
}
|
|
@@ -421,7 +421,7 @@ export interface SlackEngagementOptions {
|
|
|
421
421
|
/**
|
|
422
422
|
* Opt-in channel watch (see {@link SlackChannelPostsOptions}). Requires
|
|
423
423
|
* the Slack app to subscribe to `message.channels` / `message.groups`
|
|
424
|
-
* (`slack
|
|
424
|
+
* (`slack create --channel-posts`).
|
|
425
425
|
*/
|
|
426
426
|
channelPosts?: SlackChannelPostsOptions;
|
|
427
427
|
/**
|
|
@@ -650,9 +650,8 @@ export interface SlackManifestOptions {
|
|
|
650
650
|
suggestedPrompts?: Array<{ title: string; message: string }>;
|
|
651
651
|
/**
|
|
652
652
|
* Emit `settings.managed_app_settings`. Defaults to `true` — Cursor
|
|
653
|
-
* provisions these apps through its manager app. Pass `false`
|
|
654
|
-
*
|
|
655
|
-
* may set that block.
|
|
653
|
+
* provisions these apps through its manager app. Pass `false` when the
|
|
654
|
+
* caller is not a manager user token.
|
|
656
655
|
*/
|
|
657
656
|
managedByCursor?: boolean;
|
|
658
657
|
}
|
package/src/internal/cli-ax.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
import { serve } from "../index.js";
|
|
21
21
|
import type { AgentServeHandle } from "../types.js";
|
|
22
22
|
import { lookupSessionContinuation, runChat } from "./chat-client.js";
|
|
23
|
-
import {
|
|
23
|
+
import { ensureCursorLogin } from "./cli-cursor.js";
|
|
24
24
|
import { resolveDeployAuth } from "./cli-deploy.js";
|
|
25
25
|
import { resolveApiKey } from "./cursor/credentials.js";
|
|
26
26
|
import { CLI_COMMAND_NAME, PACKAGE_NAME } from "./distribution.js";
|
|
@@ -392,8 +392,8 @@ export async function cmdInit(options: AxCliOptions): Promise<number> {
|
|
|
392
392
|
|
|
393
393
|
let loginExit = 0;
|
|
394
394
|
if (!signedIn) {
|
|
395
|
-
|
|
396
|
-
loginExit = await
|
|
395
|
+
// init always offers the browser flow (the --json path above skipped it).
|
|
396
|
+
loginExit = await ensureCursorLogin({ interactive: true });
|
|
397
397
|
signedIn = loginExit === 0 && (await resolveApiKey()) !== undefined;
|
|
398
398
|
process.stdout.write("\n");
|
|
399
399
|
}
|
|
@@ -145,6 +145,40 @@ export async function cmdLogin(options: CursorCliOptions): Promise<number> {
|
|
|
145
145
|
return 0;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Gate for commands that need a Cursor credential before they can do useful
|
|
150
|
+
* work (`serve`, `dev`, interactive `init`). Already-signed-in hosts
|
|
151
|
+
* (`--api-key` / `CURSOR_API_KEY` / stored login) return immediately.
|
|
152
|
+
* Otherwise an interactive host runs {@link cmdLogin}; a non-interactive
|
|
153
|
+
* one (CI, Docker) fails fast with {@link SIGN_IN_HINT} instead of polling
|
|
154
|
+
* a browser that will never open.
|
|
155
|
+
*/
|
|
156
|
+
export async function ensureCursorLogin(
|
|
157
|
+
options: {
|
|
158
|
+
apiKey?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Run the browser login flow when unsigned. Defaults to stderr being a
|
|
161
|
+
* TTY.
|
|
162
|
+
*/
|
|
163
|
+
interactive?: boolean;
|
|
164
|
+
/** Test seam. */
|
|
165
|
+
login?: (options: CursorCliOptions) => Promise<number>;
|
|
166
|
+
} = {}
|
|
167
|
+
): Promise<number> {
|
|
168
|
+
const resolved = await resolveApiKey({ apiKey: options.apiKey });
|
|
169
|
+
if (resolved !== undefined) {
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
const interactive = options.interactive ?? process.stderr.isTTY === true;
|
|
173
|
+
if (!interactive) {
|
|
174
|
+
process.stderr.write(`Not signed in to Cursor. ${SIGN_IN_HINT}\n`);
|
|
175
|
+
return 1;
|
|
176
|
+
}
|
|
177
|
+
process.stdout.write("Signing you in to Cursor\n\n");
|
|
178
|
+
const login = options.login ?? cmdLogin;
|
|
179
|
+
return login({});
|
|
180
|
+
}
|
|
181
|
+
|
|
148
182
|
export async function cmdLogout(): Promise<number> {
|
|
149
183
|
const stored = await readStoredCredentials();
|
|
150
184
|
const removed = await clearStoredCredentials();
|