@cursor/bdk 0.2.21 → 0.2.23
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/dist/channels/github/api.d.ts.map +1 -1
- package/dist/channels/github/api.js +47 -0
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +34 -1
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +10 -5
- package/dist/channels/slack/types.d.ts +7 -0
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.C0diulDR.js → app.AXQcJZaf.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.B3j7LFef.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.mlUwkfRQ.js → VPLocalSearchBox.hlZ2vmun.js} +1 -1
- package/dist/docs/assets/chunks/{arc.DM5RRfvb.js → arc.9KNWdH-l.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CNHCBbQl.js → architectureDiagram-Q4EWVU46.BfGzkBHI.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.25Udb_uV.js → baseUniq.Btk8-2Rs.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.Bg-f3-qN.js → blockDiagram-DXYQGD6D.BmHm9OH5.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.BywSQvK9.js → c4Diagram-AHTNJAMY.9POrbDHJ.js} +1 -1
- package/dist/docs/assets/chunks/channel.RoCpi7X1.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.C3IdWWlO.js → chunk-4BX2VUAB.YWZVSM6S.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.D_t-pAXu.js → chunk-4TB4RGXK.Cxr_SFgw.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.DvlNSQE5.js → chunk-55IACEB6.DtiJyPlD.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.6LpTrDTf.js → chunk-EDXVE4YY.b5gNHJPH.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.BZxXsutI.js → chunk-FMBD7UC4.DmN9yA_M.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CrtynS_e.js → chunk-OYMX7WX6.Dfm3xgV5.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.CUOQY0pM.js → chunk-QZHKN3VN.sXNxDcJA.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.Dv3biZVN.js → chunk-YZCP3GAM.DgBnDUV7.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.oxdmwwqk.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.oxdmwwqk.js +1 -0
- package/dist/docs/assets/chunks/clone.BkguoIMm.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.DDzCqntx.js → cose-bilkent-S5V4N54A.D18MEcoN.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.DoiV-U_C.js → dagre-KV5264BT.CSf3tihh.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.LHX1aUDr.js → diagram-5BDNPKRD.cbfzAfoC.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.lTnkbDQp.js → diagram-G4DWMVQ6.6i6P3uu9.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.CclJPnEx.js → diagram-MMDJMWI5.B9HAIfN6.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.CLmB0KKs.js → diagram-TYMM5635.B9baAjUv.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.qKkkB7iQ.js → erDiagram-SMLLAGMA.DaBmX_GN.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.HIkXNLJ3.js → flowDiagram-DWJPFMVM.CJqQJjkb.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.YN9lDgHe.js → ganttDiagram-T4ZO3ILL.CIXBLQhC.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CL6gf7f9.js → gitGraphDiagram-UUTBAWPF.CDgentto.js} +1 -1
- package/dist/docs/assets/chunks/{graph.DMkP70rB.js → graph.BWHn6JBQ.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.CT98u6Zd.js → infoDiagram-42DDH7IO.d9VU_ts_.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.CF88w8YD.js → ishikawaDiagram-UXIWVN3A.BNO79Prj.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BoWKk6Rz.js → journeyDiagram-VCZTEJTY.CPgUTM1R.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CrmPv2sG.js → kanban-definition-6JOO6SKY.idl0Eoe1.js} +1 -1
- package/dist/docs/assets/chunks/{layout.CEiPTQln.js → layout.BY7DIMr6.js} +1 -1
- package/dist/docs/assets/chunks/{linear.gkXuWu8G.js → linear.DYaUDrHd.js} +1 -1
- package/dist/docs/assets/chunks/{min.C4EHK60v.js → min.V6MWb1UC.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.C-JqTP4s.js → mindmap-definition-QFDTVHPH.BRlJXuFS.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.t2HgQOCt.js → pieDiagram-DEJITSTG.BIhkDLcB.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.D1k-BEKc.js → quadrantDiagram-34T5L4WZ.Bw-_VEL3.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CUu9VVrt.js → requirementDiagram-MS252O5E.DolEGwxw.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.HroiBrt1.js → sankeyDiagram-XADWPNL6.hMM-8BhN.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.CeJapdwH.js → sequenceDiagram-FGHM5R23.Bg_CRVDy.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.CLj6JnXZ.js → stateDiagram-FHFEXIEX.DNWdl34_.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.7W-btjJ2.js +1 -0
- package/dist/docs/assets/chunks/{theme.B9ZHHvCq.js → theme.CBW1oolh.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.BzKGPAdN.js → timeline-definition-GMOUNBTQ.Cr1wJ1mB.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DtBNkpF9.js → vennDiagram-DHZGUBPP.BltDV9j7.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.D_iarxve.js → wardley-RL74JXVD.BWPaUhOs.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.rOXEXIA9.js → wardleyDiagram-NUSXRM2D.nsADqCCo.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.BrM71_SA.js → xychartDiagram-5P7HB3ND.CCwbO3dK.js} +1 -1
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +7 -0
- package/dist/docs/assets/{guides_migrate.md.DZBL7dqT.lean.js → guides_migrate.md.CQlGaBKX.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Bkrsce22.js → reference_cli.md.DB7Llw3T.js} +3 -3
- package/dist/docs/assets/{reference_cli.md.Bkrsce22.lean.js → reference_cli.md.DB7Llw3T.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.js → reference_schedules.md.BqWnJES4.js} +3 -3
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/export-grokbot.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/migrate.html +38 -38
- package/dist/docs/guides/migrate.md +46 -4
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +35 -35
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +62 -9
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +39 -39
- package/dist/docs/reference/cli.md +16 -5
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/memory.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +38 -38
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/grokbot-agents.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/files-backends/cursor-hosted.js +4 -1
- package/dist/internal/cli-deploy.d.ts +3 -3
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +63 -21
- package/dist/internal/cli-migrate.d.ts.map +1 -1
- package/dist/internal/cli-migrate.js +227 -12
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +56 -3
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-deployment-secrets.js +22 -6
- package/dist/internal/deploy-client.d.ts +7 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +15 -1
- package/dist/internal/filesystem/scratch.d.ts +7 -6
- package/dist/internal/filesystem/scratch.d.ts.map +1 -1
- package/dist/internal/filesystem/scratch.js +13 -7
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +10 -0
- package/dist/internal/hosted-eval-cases.js +1 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +6 -2
- package/dist/internal/slack-provision-client.d.ts +1 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -1
- package/dist/playground/assets/index-BtsbIqV9.css +1 -0
- package/dist/playground/assets/index-CD8VRa25.js +71 -0
- package/dist/playground/index.html +2 -2
- package/docs/guides/migrate.md +46 -4
- package/docs/reference/cli.md +16 -5
- package/package.json +8 -3
- package/skills/migrate-v2/SKILL.md +140 -11
- package/templates/agentic-owners/bot/lib/owners/matching.ts +4 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot._fglLrPa.js +0 -1
- package/dist/docs/assets/chunks/channel.C4s-x2x3.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.h-fLya-M.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.h-fLya-M.js +0 -1
- package/dist/docs/assets/chunks/clone.BM9yCOiZ.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CLFLHNN0.js +0 -1
- package/dist/docs/assets/guides_migrate.md.DZBL7dqT.js +0 -7
- package/dist/playground/assets/index-BfePgvWh.css +0 -1
- package/dist/playground/assets/index-DAlf9lxD.js +0 -71
- /package/dist/docs/assets/{reference_schedules.md.03Ryy9ca.lean.js → reference_schedules.md.BqWnJES4.lean.js} +0 -0
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
/>
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
10
|
<title>agent-serve playground</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-CD8VRa25.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./assets/index-BtsbIqV9.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
package/docs/guides/migrate.md
CHANGED
|
@@ -24,6 +24,15 @@ Migrate when at least one of these signals is present:
|
|
|
24
24
|
Stop when none of these is true. An existing `agent/` project root can remain
|
|
25
25
|
in place; BDK still loads it even though current examples use `bot/`.
|
|
26
26
|
|
|
27
|
+
`bdk migrate` prints `Nothing to migrate.` and exits 0 only when `--dir` shows
|
|
28
|
+
no migration work. The check looks for an `@cursor/july` dependency,
|
|
29
|
+
`architecture: "v1"`, `bot/storage.ts` or `agent/storage.ts`,
|
|
30
|
+
`runtime: "grokbot"`, a literal SCM credential, a `/v1` continuation selector,
|
|
31
|
+
an anonymous reminder, and a `*_MCP_URL` peer connection. When any of those is
|
|
32
|
+
present, or a project file cannot be read, the command starts the agent. It
|
|
33
|
+
does not read the hosted deployment. Run `bdk deployment <slug>` when you still
|
|
34
|
+
need to see whether that copy is on v1.
|
|
35
|
+
|
|
27
36
|
## Start the migration
|
|
28
37
|
|
|
29
38
|
Commit and push the source you want to migrate. `bdk migrate` reads that
|
|
@@ -83,6 +92,14 @@ Before merging, confirm the pull request:
|
|
|
83
92
|
removed. The [GitHub guide](./github.md#other-hosts) explains the named
|
|
84
93
|
form.
|
|
85
94
|
|
|
95
|
+
- Rewrites each peer call that took its URL from a secret or environment
|
|
96
|
+
variable, such as `BUILDER_MCP_URL`, to
|
|
97
|
+
`defineConnection({ agent: "<slug>" })` under `bot/mcp-connections/`
|
|
98
|
+
(or `agent/mcp-connections/` when the project root is `agent/`).
|
|
99
|
+
Confirm the slug before you merge. The pull request lists each secret the
|
|
100
|
+
rewrite left unused, and it leaves a TODO where it could not determine
|
|
101
|
+
the slug.
|
|
102
|
+
|
|
86
103
|
- Calls out unsupported behavior and any follow-up needed for reminders,
|
|
87
104
|
schedules, Slack, or MCP connections.
|
|
88
105
|
|
|
@@ -113,10 +130,33 @@ bdk validate --dir .
|
|
|
113
130
|
bdk deploy --dir . --slug <existing-or-new-slug>
|
|
114
131
|
```
|
|
115
132
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
133
|
+
When the folder contains more than one agent, deploy each agent folder
|
|
134
|
+
alone. Run `bdk deploy --dir <agent folder>` one time for each agent. One
|
|
135
|
+
`bdk deploy` on the parent folder prints those commands and does not deploy.
|
|
136
|
+
Do not use `bdk deploy --all`. Repeat `bdk slack create --prod` for each
|
|
137
|
+
agent folder. The Slack app slug is the folder name.
|
|
138
|
+
|
|
139
|
+
When the pull request calls another agent with
|
|
140
|
+
`defineConnection({ agent: "<slug>" })`, deploy the caller and that peer
|
|
141
|
+
on `@cursor/bdk` 0.2.18 or newer. Both deployments must belong to the
|
|
142
|
+
same team, and the caller reaches the peer once the peer deployment is
|
|
143
|
+
running. The connection file is already in the merged source, so unset
|
|
144
|
+
each URL secret the pull request lists after both deploys:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
bdk secrets unset <slug> NAME
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`bdk migrate` prints the steps that follow the first deploy: one deploy per
|
|
151
|
+
agent folder, `bdk slack create --prod --dir <agent-folder>` for each Slack
|
|
152
|
+
agent, `bdk secrets unset` for peer URL secrets the pull request lists, and
|
|
153
|
+
`bdk secrets list` / `bdk secrets set` when the slug is new. Slack setup
|
|
154
|
+
redeploys the deployment by itself. `bdk secrets set` takes effect on the
|
|
155
|
+
next request. Neither step needs another deploy.
|
|
156
|
+
|
|
157
|
+
After the deployment starts, follow that checklist for Slack, webhook callers,
|
|
158
|
+
peer connections, and secrets, then verify a hosted turn. The
|
|
159
|
+
[deployment guide](../deployment.md) covers the managed hosting workflow.
|
|
120
160
|
|
|
121
161
|
## Related
|
|
122
162
|
|
|
@@ -124,4 +164,6 @@ hosting workflow.
|
|
|
124
164
|
exit status
|
|
125
165
|
- [`bdk-migrate-v2` skill](../../skills/migrate-v2/SKILL.md): the coding
|
|
126
166
|
procedure and complete capability matrix
|
|
167
|
+
- [Peer agents](./agent-to-agent.md): how a deployed caller reaches another
|
|
168
|
+
agent by slug
|
|
127
169
|
- [Deployment](../deployment.md): deploy and verify the reviewed project
|
package/docs/reference/cli.md
CHANGED
|
@@ -533,7 +533,18 @@ bdk migrate [--dir <path>] [--repo <https-url>] [--ref <git-ref>]
|
|
|
533
533
|
early alpha. It reads a pushed Git ref, starts a Cursor cloud agent with the
|
|
534
534
|
bundled `bdk-migrate-v2` skill, and opens a pull request with the source
|
|
535
535
|
changes. The command waits for the pull request by default and never deploys
|
|
536
|
-
the project or changes deployment secrets.
|
|
536
|
+
the project or changes deployment secrets. When it starts an agent, it prints
|
|
537
|
+
a checklist for the steps after the first deploy: deploy each agent folder,
|
|
538
|
+
create the prod Slack app, unset peer URL secrets, and set secrets a new slug
|
|
539
|
+
still needs.
|
|
540
|
+
|
|
541
|
+
The command prints `Nothing to migrate.` and exits 0 only when `--dir` shows
|
|
542
|
+
no migration work. That check looks for an `@cursor/july` dependency,
|
|
543
|
+
`architecture: "v1"`, `bot/storage.ts` or `agent/storage.ts`,
|
|
544
|
+
`runtime: "grokbot"`, a literal SCM credential, a `/v1` continuation selector,
|
|
545
|
+
an anonymous reminder, and a `*_MCP_URL` peer connection. When any of those is
|
|
546
|
+
present, or a project file cannot be read, the command starts the agent. It
|
|
547
|
+
does not read the hosted deployment.
|
|
537
548
|
|
|
538
549
|
| Option | Contract |
|
|
539
550
|
| --- | --- |
|
|
@@ -542,7 +553,7 @@ the project or changes deployment secrets.
|
|
|
542
553
|
| `--ref <git-ref>` | Select the pushed ref for the cloud agent. The CLI infers the current branch when possible. |
|
|
543
554
|
| `--path <agent-path>` | Select the project path relative to the repository root. The CLI infers it from `--dir` when possible. |
|
|
544
555
|
| `--no-wait` | Print the cloud agent URL and return after the agent starts. |
|
|
545
|
-
| `--json` | Print a report with `ok`, `status`, `agentId`, and the cloud agent `url`. A completed migration adds `prUrl
|
|
556
|
+
| `--json` | Print a report with `ok`, `status`, `agentId`, and the cloud agent `url`. A completed migration adds `prUrl` and `checklist`. A run with nothing to migrate uses `status: "current"` and `message` (no agent started) or `summary` (the agent reported it). A blocked or failed migration adds its explanation. |
|
|
546
557
|
| `--api-key <key>` | Override the Cursor credential. |
|
|
547
558
|
|
|
548
559
|
Credential resolution follows the normal order: `--api-key`,
|
|
@@ -659,8 +670,8 @@ service-account API key with agent access can deploy.
|
|
|
659
670
|
|
|
660
671
|
| Option | Contract |
|
|
661
672
|
| --- | --- |
|
|
662
|
-
| `--slug <slug>` | Select one project and set its deployment slug. |
|
|
663
|
-
| `--all` | Deploy every child
|
|
673
|
+
| `--slug <slug>` | Select one project and set its deployment slug. Under a folder of several agents, this deploys that one agent. |
|
|
674
|
+
| `--all` | Deploy every child under a folder of several agents. For a folder of v2 agents, print one deploy command for each agent. |
|
|
664
675
|
| `--team <id>` | Select the Cursor team. |
|
|
665
676
|
| `--repo <https-url>` | Set the source repository. The CLI infers it from the current checkout when possible. HTTPS is required. |
|
|
666
677
|
| `--ref <git-ref>` | Set the source Git ref. The CLI infers the current branch when possible. |
|
|
@@ -1052,7 +1063,7 @@ Credential resolution follows this order: `--api-key`, `CURSOR_API_KEY`,
|
|
|
1052
1063
|
| `chat`, `session` | Exit `2` for documented option conflicts or missing required input. |
|
|
1053
1064
|
| `validate` | Exit `1` when any project diagnostic has error severity. |
|
|
1054
1065
|
| `convert-automation` | Exit `1` for invalid input, authentication, export, or file-write failure. Warnings and dependency-install failure don't change a successful conversion exit. |
|
|
1055
|
-
| `migrate` | Exit `0` after starting with `--no-wait
|
|
1066
|
+
| `migrate` | Exit `0` when nothing needs a migration, after starting with `--no-wait`, or after the agent opens a pull request. Exit `1` for invalid input, authentication or agent failure, or a completed run without a pull request. |
|
|
1056
1067
|
| Other commands | Exit nonzero when validation, authentication, a request, or the requested operation fails. |
|
|
1057
1068
|
|
|
1058
1069
|
## Related
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cursor/bdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "Build, test, and deploy BDK bots and agents as code on Cursor's agent harness.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -335,6 +335,11 @@
|
|
|
335
335
|
},
|
|
336
336
|
"devDependencies": {
|
|
337
337
|
"@braintree/sanitize-url": "7.1.2",
|
|
338
|
+
"@cursor/sdk-darwin-arm64": "1.0.37",
|
|
339
|
+
"@cursor/sdk-darwin-x64": "1.0.37",
|
|
340
|
+
"@cursor/sdk-linux-arm64": "1.0.37",
|
|
341
|
+
"@cursor/sdk-linux-x64": "1.0.37",
|
|
342
|
+
"@cursor/sdk-win32-x64": "1.0.37",
|
|
338
343
|
"@stylexswc/rs-compiler": "^0.18.0",
|
|
339
344
|
"@tanstack/react-virtual": "3.13.23",
|
|
340
345
|
"@types/js-yaml": "4.0.9",
|
|
@@ -364,11 +369,11 @@
|
|
|
364
369
|
"vitest": "^4.0.18",
|
|
365
370
|
"yaml": "^2.4.2",
|
|
366
371
|
"zustand": "^5.0.9",
|
|
367
|
-
"@anysphere/agent-store-sync": "1.0.0",
|
|
368
372
|
"@anysphere/agent-exec": "1.0.0",
|
|
369
373
|
"@anysphere/proto": "1.0.0",
|
|
374
|
+
"@anysphere/context": "1.0.0",
|
|
370
375
|
"@anysphere/ui": "1.0.0",
|
|
371
|
-
"@anysphere/
|
|
376
|
+
"@anysphere/agent-store-sync": "1.0.0"
|
|
372
377
|
},
|
|
373
378
|
"scripts": {
|
|
374
379
|
"build": "tsc -p tsconfig.build.json && node scripts/bundle-publish-shims.mjs && node scripts/copy-extension-assets.mjs && pnpm run build:playground && pnpm run docs:build",
|
|
@@ -23,7 +23,21 @@ Migrate when any of these is true:
|
|
|
23
23
|
- `bdk deployment <slug>` for the hosted copy does not print
|
|
24
24
|
`architecture: v2`.
|
|
25
25
|
|
|
26
|
-
Stop when none is true.
|
|
26
|
+
Stop when none is true. Your final message must start with
|
|
27
|
+
`Nothing to migrate.` and must name the checks you ran. Open no pull
|
|
28
|
+
request.
|
|
29
|
+
|
|
30
|
+
`bdk migrate` checks `--dir` before it starts an agent. It starts an
|
|
31
|
+
agent when it finds any of these: an `@cursor/july` dependency or
|
|
32
|
+
import, `architecture: "v1"`, `bot/storage.ts` or `agent/storage.ts`,
|
|
33
|
+
`runtime: "grokbot"`, a literal or `() => process.env` SCM credential,
|
|
34
|
+
`continuation: ".../v1"`, an anonymous reminder `run` or function
|
|
35
|
+
`until`, or a `defineConnection` whose URL comes from a `*_MCP_URL`
|
|
36
|
+
secret. When none of those is present it prints `Nothing to migrate.`
|
|
37
|
+
and exits. When it cannot read a file, it starts the agent. It does
|
|
38
|
+
not run `bdk deployment`. A hosted copy can still be on v1 after the
|
|
39
|
+
source has moved. Check with `bdk deployment <slug>`, and deploy when
|
|
40
|
+
that output does not show `architecture: v2`.
|
|
27
41
|
|
|
28
42
|
## Know what changes
|
|
29
43
|
|
|
@@ -66,12 +80,14 @@ ends. That model changes code in three places:
|
|
|
66
80
|
| Slack tool-approval buttons on Cursor hosting | Not supported yet |
|
|
67
81
|
| `bdk mcp oauth --store` for host MCP OAuth | Not supported. Connect Cursor-account MCP servers from **Deployed Agents** in the dashboard. |
|
|
68
82
|
| Session, tool, and MCP APIs on the deployment URL | Not reachable |
|
|
83
|
+
| Another BDK agent reached through a deployment URL secret | Not supported. Declare `defineConnection({ agent: "<slug>" })`. Both agents must be team-owned and deployed on `@cursor/bdk` 0.2.18 or newer. |
|
|
69
84
|
| `--prod` with `chat`, `resume`, `call`, `skill`, `sessions`, `cost`, or `mcp` | Not supported. Use `run --prod`, `logs --prod`, `session --prod`, and `playground --prod`. |
|
|
70
85
|
| v1 sessions, KV, and files | Not carried over. v2 starts empty, and deleting v1 deletes them. |
|
|
71
86
|
|
|
72
87
|
The steps below rewrite `defineStorage`, inline reminders, SCM channel
|
|
73
|
-
credentials,
|
|
74
|
-
that depends on Slack tool-approval buttons,
|
|
88
|
+
credentials, secret reads, and peer calls that use a URL secret. Stop and
|
|
89
|
+
ask before migrating an agent that depends on Slack tool-approval buttons,
|
|
90
|
+
`mcp oauth --store`, or an
|
|
75
91
|
HTTP route whose caller reads the response body. Name the row and the
|
|
76
92
|
file that uses it.
|
|
77
93
|
|
|
@@ -177,9 +193,74 @@ still loads.
|
|
|
177
193
|
|
|
178
194
|
7. **Move secret reads.** Replace module-scope `process.env.NAME` reads
|
|
179
195
|
with reads inside the function that uses them. Give MCP connections a
|
|
180
|
-
`${NAME}` header or env template instead.
|
|
196
|
+
`${NAME}` header or env template instead. A URL that points at another
|
|
197
|
+
BDK agent's deployment is not one of those secrets. Step 8 replaces
|
|
198
|
+
that connection, including a URL you templated here.
|
|
199
|
+
|
|
200
|
+
8. **Rewrite peer calls that use a URL secret.** Do this in the migration
|
|
201
|
+
pull request. The deployment URL does not serve MCP, so a connection
|
|
202
|
+
left on that URL fails after deploy.
|
|
203
|
+
|
|
204
|
+
Treat the call as a peer when its URL comes from a `*_MCP_URL` secret
|
|
205
|
+
or a similar name, a `${NAME}` template, `process.env.NAME`, or a
|
|
206
|
+
string built from a deployment URL or slug, and the target is another
|
|
207
|
+
BDK agent. Leave a third-party MCP server as a URL connection and
|
|
208
|
+
apply step 7 to its secrets.
|
|
209
|
+
|
|
210
|
+
Use a slug only when the repo states it: the URL path, a `--slug`
|
|
211
|
+
value, a sibling directory that deploy would use as the slug, or a
|
|
212
|
+
comment that names the deployment. A secret name is a hint. Use
|
|
213
|
+
`BUILDER_MCP_URL` as `builder` only when something else in the repo
|
|
214
|
+
confirms that slug. When nothing confirms it, keep the URL connection
|
|
215
|
+
and add a TODO that names the secret and asks for the slug. Name that
|
|
216
|
+
TODO in the pull request body.
|
|
181
217
|
|
|
182
|
-
|
|
218
|
+
```ts
|
|
219
|
+
// before (v1), agent/mcp-connections/builder.ts
|
|
220
|
+
import { defineConnection } from "@cursor/bdk/connections";
|
|
221
|
+
|
|
222
|
+
export default defineConnection({
|
|
223
|
+
url: process.env.BUILDER_MCP_URL,
|
|
224
|
+
headers: { authorization: `Bearer ${process.env.BUILDER_TOKEN}` },
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// after (v2)
|
|
228
|
+
import { defineConnection } from "@cursor/bdk/connections";
|
|
229
|
+
|
|
230
|
+
export default defineConnection({
|
|
231
|
+
agent: "builder",
|
|
232
|
+
description: "Ask the builder agent to handle this work.",
|
|
233
|
+
});
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`agent` is the peer's lowercase deployment slug. Keep an existing
|
|
237
|
+
connection file in place. When the project has no connection file,
|
|
238
|
+
add `bot/mcp-connections/<name>.ts`, or
|
|
239
|
+
`agent/mcp-connections/<name>.ts` when the project root is `agent/`.
|
|
240
|
+
Use `host-connections/` only when host code calls the peer and the
|
|
241
|
+
model must not see it. The filename is the connection name.
|
|
242
|
+
|
|
243
|
+
Hosting authenticates the peer call. Remove the URL, its headers, and
|
|
244
|
+
any token this call was the only reader of. Point host code that
|
|
245
|
+
called the deployment URL at
|
|
246
|
+
`ctx.host.mcp.callTool("<name>", "ask", { message })`. The peer
|
|
247
|
+
project needs no matching file. Do not edit a peer that sits outside
|
|
248
|
+
this folder.
|
|
249
|
+
|
|
250
|
+
Remove the unused URL secret from code and from `hosting.secretNames`
|
|
251
|
+
on `defineAgent`, and from an extension `hosting` block that declares
|
|
252
|
+
it. Leave every secret something else still reads.
|
|
253
|
+
|
|
254
|
+
Do not change deployment secrets, and do not run `bdk secrets unset`.
|
|
255
|
+
In the pull request body, list each secret this step stopped using,
|
|
256
|
+
with the command `bdk secrets unset <slug> NAME`, so the user can
|
|
257
|
+
unset it after both agents are deployed.
|
|
258
|
+
|
|
259
|
+
Both agents must be team-owned and deployed with `@cursor/bdk` 0.2.18
|
|
260
|
+
or newer before the connection resolves. This pull request does not
|
|
261
|
+
deploy them.
|
|
262
|
+
|
|
263
|
+
9. **Stop answering from HTTP routes.** A custom route that returned
|
|
183
264
|
computed data must deliver it another way, such as a callback URL or a
|
|
184
265
|
tool the turn calls. Return `new Response(null, { status: 202 })` so
|
|
185
266
|
local runs match the hosted response.
|
|
@@ -206,14 +287,29 @@ Run the project's own typecheck and tests.
|
|
|
206
287
|
## Open the pull request
|
|
207
288
|
|
|
208
289
|
Describe each removed or changed behavior, each unsupported row the
|
|
209
|
-
agent touched, and the deploy steps.
|
|
210
|
-
|
|
290
|
+
agent touched, and the deploy steps. For each peer URL you rewrote, name
|
|
291
|
+
the slug and the connection file. List every secret name the rewrite
|
|
292
|
+
left unused, and the `bdk secrets unset <slug> NAME` command for it.
|
|
293
|
+
Name each TODO whose slug you could not determine. Do not deploy from
|
|
294
|
+
the pull request branch, and do not change deployment secrets.
|
|
295
|
+
|
|
296
|
+
Copy this post-merge checklist into the pull request body. One
|
|
297
|
+
`bdk deploy --dir <agent-folder>` per agent. Do not use `bdk deploy --all`.
|
|
298
|
+
Then `bdk slack create --prod --dir <agent-folder> [--team <team-id>]`
|
|
299
|
+
for each agent that uses Slack. Then `bdk secrets unset <slug> NAME` for
|
|
300
|
+
each unused peer URL secret, and `bdk secrets list <slug>` plus
|
|
301
|
+
`bdk secrets set <slug> NAME` when the slug is new. Do not tell the user
|
|
302
|
+
to deploy again after Slack setup or after `bdk secrets set`. The server
|
|
303
|
+
redeploys after Slack setup, and a secret is injected on the next
|
|
304
|
+
request.
|
|
211
305
|
|
|
212
306
|
## Deploy after merge
|
|
213
307
|
|
|
214
308
|
Deploy from a pushed ref. `bdk deploy` reads Git and never uploads the
|
|
215
309
|
working tree.
|
|
216
310
|
|
|
311
|
+
When the folder contains one agent:
|
|
312
|
+
|
|
217
313
|
```bash
|
|
218
314
|
bdk login
|
|
219
315
|
bdk validate --dir .
|
|
@@ -222,6 +318,31 @@ bdk deploy --dir . --slug <existing-slug> \
|
|
|
222
318
|
--allow-domain <domain>
|
|
223
319
|
```
|
|
224
320
|
|
|
321
|
+
When the folder contains more than one agent, deploy each agent alone.
|
|
322
|
+
Run the command one time for each agent folder. A `bdk deploy` on the
|
|
323
|
+
parent folder prints those commands and does not deploy. Do not run
|
|
324
|
+
`bdk deploy --all`. Repeat `bdk slack create --prod` for each agent
|
|
325
|
+
folder too.
|
|
326
|
+
The app slug is the folder name, so that name must match the deployed
|
|
327
|
+
slug.
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
bdk deploy --dir <agent-folder> --slug <that-agent-slug> \
|
|
331
|
+
--cursor-events-repo <owner/repo> \
|
|
332
|
+
--allow-domain <domain>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
When this migration declares `defineConnection({ agent: "<slug>" })`,
|
|
336
|
+
deploy the caller and the peer. Both deployments must be team-owned and
|
|
337
|
+
must run `@cursor/bdk` 0.2.18 or newer. The connection file is already
|
|
338
|
+
in the merged source. The caller reaches the peer after the peer
|
|
339
|
+
deployment is running. The peer needs no matching file. After both
|
|
340
|
+
deploys are running, unset each URL secret the pull request lists:
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
bdk secrets unset <slug> NAME
|
|
344
|
+
```
|
|
345
|
+
|
|
225
346
|
Pass every `--cursor-events-repo` and `--allow-domain` value the v1
|
|
226
347
|
deployment used. Domains already in `hosting.egressDomains` need no
|
|
227
348
|
flag. Print only those two fields, because the full output holds
|
|
@@ -252,10 +373,18 @@ After the deploy is running:
|
|
|
252
373
|
|
|
253
374
|
- Store the alias token the deploy prints. Point every webhook sender
|
|
254
375
|
and HTTP caller at the new alias URL.
|
|
255
|
-
- For Slack,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
376
|
+
- For Slack, log in as a person. A team service-account key cannot
|
|
377
|
+
create the app. Run `bdk slack create --prod --dir <agent-folder>`
|
|
378
|
+
once per agent (`--team <team-id>` selects the Cursor team that owns
|
|
379
|
+
the deployment). The server redeploys by itself. Do not deploy again
|
|
380
|
+
for Slack. The new app is a different bot. Uninstall the old Slack app
|
|
381
|
+
and invite the new bot to the channels the old one joined. The copied
|
|
382
|
+
v1 Slack secrets go unused.
|
|
383
|
+
- For secrets, a same-slug deploy copies the v1 secrets. A new slug
|
|
384
|
+
needs `bdk secrets set <slug> NAME`. Check with
|
|
385
|
+
`bdk secrets list <slug> [--team <team-id>]`. `deploy` warns when a
|
|
386
|
+
declared secret is unset. A secret is injected on the next request.
|
|
387
|
+
Do not deploy again after `bdk secrets set`.
|
|
259
388
|
- Reconnect Cursor-account MCP servers from **Deployed Agents** in the
|
|
260
389
|
dashboard.
|
|
261
390
|
- Start a turn with `bdk run --prod --slug <slug> --message "..."`. It
|
|
@@ -51,12 +51,15 @@ export function patternMatchesFile(
|
|
|
51
51
|
const literalPrefix = normalizedPattern.replace(/\*+$/, "");
|
|
52
52
|
if (normalizedPattern.endsWith("**") && !hasComplexGlob(literalPrefix)) {
|
|
53
53
|
const prefix = literalPrefix.replace(/\\(.)/g, "$1").replace(/\/+$/, "");
|
|
54
|
-
if (
|
|
54
|
+
if (prefix !== "" && normalizedPath.startsWith(`${prefix}/`)) {
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
if (literalPrefix === "" || literalPrefix.endsWith("/")) {
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
60
|
+
if (normalizedPath === prefix) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
60
63
|
if (patternIsRooted && !literalPrefix.includes("/") && normalizedPath.includes("/")) {
|
|
61
64
|
return false;
|
|
62
65
|
}
|