@cursor/bdk 0.2.17 → 0.2.20
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 +16 -6
- package/dist/bin/agent-serve.js +7 -0
- package/dist/channels/runs/index.d.ts +4 -0
- package/dist/channels/runs/index.d.ts.map +1 -0
- package/dist/channels/runs/index.js +2 -0
- package/dist/channels/runs/runs-channel.d.ts +5 -0
- package/dist/channels/runs/runs-channel.d.ts.map +1 -0
- package/dist/channels/runs/runs-channel.js +34 -0
- package/dist/channels/runs/types.d.ts +34 -0
- package/dist/channels/runs/types.d.ts.map +1 -0
- package/dist/channels/runs/types.js +1 -0
- package/dist/channels/slack/slack-channel.d.ts +3 -2
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +9 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.CUNuFTSm.js → app.BzgJFr_T.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.gGwBYU3d.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.Dez74k0W.js → VPLocalSearchBox.Bn5QyUDM.js} +1 -1
- package/dist/docs/assets/chunks/{arc.CJ3FhK7H.js → arc.D734Gm5d.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CfUdbHsa.js → architectureDiagram-Q4EWVU46.NX1jj-YX.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.D93LawU9.js → baseUniq.nd8dxdeO.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.Zvsd6UHP.js → blockDiagram-DXYQGD6D.DG8faTim.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.CGX5xZ9d.js → c4Diagram-AHTNJAMY.zD31AJ3b.js} +1 -1
- package/dist/docs/assets/chunks/channel.DQLJQMi3.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.CCIf0QCo.js → chunk-4BX2VUAB.BHQj6Rko.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.D_N1RPyi.js → chunk-4TB4RGXK.Cs38Yh16.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.B1oecjzx.js → chunk-55IACEB6.CFUR21JO.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.BzUNVPGX.js → chunk-EDXVE4YY.C80-Sneg.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DheI8WSO.js → chunk-FMBD7UC4.CdT1MGza.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Bg4iL0sM.js → chunk-OYMX7WX6.BctEzab0.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.CSQjDhAD.js → chunk-QZHKN3VN.DTneeX3k.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BDdxnPU4.js → chunk-YZCP3GAM.Cz47F_-o.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.j55aerUT.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.j55aerUT.js +1 -0
- package/dist/docs/assets/chunks/clone.XimRS84I.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.AT0weO8r.js → cose-bilkent-S5V4N54A.BPYgB-_O.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.CJ30TxV0.js → dagre-KV5264BT.Cu6hECod.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.KtE--1fW.js → diagram-5BDNPKRD.BMgp95Tz.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BFGygSUQ.js → diagram-G4DWMVQ6.towWdhDi.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.BLU-79eb.js → diagram-MMDJMWI5.D9IfOvE9.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.CdjfJdVG.js → diagram-TYMM5635.NTX57RPu.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.Dj1Iwypl.js → erDiagram-SMLLAGMA.DIQLqDqu.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BXqj_Su2.js → flowDiagram-DWJPFMVM.DhqpItRe.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.CNfgGSst.js → ganttDiagram-T4ZO3ILL.B998R3Ps.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.2tgvFDBr.js → gitGraphDiagram-UUTBAWPF.B45nTn8-.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CWHZMxx6.js → graph.DPseWzzM.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.DhLIK8m1.js → infoDiagram-42DDH7IO._GhhBBai.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.BIN11n1G.js → ishikawaDiagram-UXIWVN3A.CTUMcaMM.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BARmNJ0n.js → journeyDiagram-VCZTEJTY.DkJBUddC.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.BrTJYFyF.js → kanban-definition-6JOO6SKY.B5Q3uwhy.js} +1 -1
- package/dist/docs/assets/chunks/{layout.CPZIIywK.js → layout.CDY13IKh.js} +1 -1
- package/dist/docs/assets/chunks/{linear.DTpmzI5S.js → linear.BPd1ql9p.js} +1 -1
- package/dist/docs/assets/chunks/{min.BBLQmXwZ.js → min.dlGuqIBP.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.5qkWJvdl.js → mindmap-definition-QFDTVHPH.Cp7zCtmb.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.-4wufv_f.js → pieDiagram-DEJITSTG.CRH034nu.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.C0jrp1-8.js → quadrantDiagram-34T5L4WZ.BspgZ-pX.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DUDpANfe.js → requirementDiagram-MS252O5E.CQZqZ0nZ.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.74Lvg6Gu.js → sankeyDiagram-XADWPNL6.DllwFU3k.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BHDIH286.js → sequenceDiagram-FGHM5R23.B5fTXycf.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.Dr-HIuLb.js → stateDiagram-FHFEXIEX.12GQjmbD.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Ctv5WEMu.js +1 -0
- package/dist/docs/assets/chunks/{theme.H8zSBhlM.js → theme.BgocqONV.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.GtyCaSiL.js → timeline-definition-GMOUNBTQ.DXKUL5rH.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DLId0rxH.js → vennDiagram-DHZGUBPP.BrsjYCjp.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.DZDndEXQ.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.CI6mGYNG.js → wardleyDiagram-NUSXRM2D.C4oM69gv.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.CG1n865F.js → xychartDiagram-5P7HB3ND.qzHH9efW.js} +1 -1
- package/dist/docs/assets/{deployment.md.ajc3VM0m.js → deployment.md.D0uprX2p.js} +3 -3
- package/dist/docs/assets/{deployment.md.ajc3VM0m.lean.js → deployment.md.D0uprX2p.lean.js} +1 -1
- package/dist/docs/assets/{guides_agent-to-agent.md.Cps5NiCV.js → guides_agent-to-agent.md.CwL5cwuE.js} +6 -5
- package/dist/docs/assets/{guides_agent-to-agent.md.Cps5NiCV.lean.js → guides_agent-to-agent.md.CwL5cwuE.lean.js} +1 -1
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
- package/dist/docs/assets/{guides_opentelemetry.md.jcPNrQbH.js → guides_opentelemetry.md.BHPm32OR.js} +3 -3
- package/dist/docs/assets/{guides_opentelemetry.md.jcPNrQbH.lean.js → guides_opentelemetry.md.BHPm32OR.lean.js} +1 -1
- package/dist/docs/assets/{index.md.CHAFTf6m.js → index.md.CAnsLl8D.js} +2 -2
- package/dist/docs/assets/{index.md.CHAFTf6m.lean.js → index.md.CAnsLl8D.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.Bt3sAfat.js → reference_cli.md.Bkrsce22.js} +7 -4
- package/dist/docs/assets/{reference_cli.md.Bt3sAfat.lean.js → reference_cli.md.Bkrsce22.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.CxbLpaaP.js → reference_connections.md.BJE2Zllp.js} +4 -4
- package/dist/docs/assets/{reference_connections.md.CxbLpaaP.lean.js → reference_connections.md.BJE2Zllp.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.DbJC8mcZ.js → reference_hooks.md.CP3FENFJ.js} +1 -1
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
- package/dist/docs/assets/{reference_skills.md.Ckddg6KX.js → reference_skills.md.C2GWh7g8.js} +3 -3
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +38 -38
- package/dist/docs/deployment.md +17 -0
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +41 -40
- package/dist/docs/guides/agent-to-agent.md +34 -21
- 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 +114 -0
- package/dist/docs/guides/export-grokbot.md +239 -0
- 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 +36 -36
- package/dist/docs/guides/opentelemetry.html +37 -37
- package/dist/docs/guides/opentelemetry.md +19 -0
- 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 +37 -37
- package/dist/docs/index.md +3 -0
- package/dist/docs/llms-full.txt +493 -29
- package/dist/docs/llms.txt +2 -0
- 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 +41 -38
- package/dist/docs/reference/cli.md +39 -1
- package/dist/docs/reference/connections.html +38 -38
- package/dist/docs/reference/connections.md +16 -6
- package/dist/docs/reference/evals.html +36 -36
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +38 -38
- package/dist/docs/reference/hooks.md +2 -1
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/memory.html +63 -0
- package/dist/docs/reference/memory.md +114 -0
- 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 +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +38 -38
- 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/evals.d.ts +1 -1
- package/dist/evals.js +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +2 -2
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +8 -1
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +10 -1
- package/dist/internal/cli-ax.d.ts +7 -7
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +36 -15
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +0 -14
- package/dist/internal/cloud-turn-usage.d.ts +34 -0
- package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
- package/dist/internal/cloud-turn-usage.js +94 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +6 -0
- package/dist/internal/continuation-identity.d.ts +6 -3
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +43 -0
- package/dist/internal/estimate-cost.d.ts +55 -0
- package/dist/internal/estimate-cost.d.ts.map +1 -0
- package/dist/internal/{turn-cost.js → estimate-cost.js} +18 -26
- package/dist/internal/event-log.d.ts +2 -2
- package/dist/internal/event-log.js +2 -2
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +21 -2
- package/dist/internal/http-control-plane-session.d.ts +5 -2
- package/dist/internal/http-control-plane-session.d.ts.map +1 -1
- package/dist/internal/http-control-plane-session.js +38 -2
- package/dist/internal/init-scaffold.d.ts.map +1 -1
- package/dist/internal/init-scaffold.js +3 -4
- package/dist/internal/model-config.d.ts +7 -0
- package/dist/internal/model-config.d.ts.map +1 -0
- package/dist/internal/model-config.js +67 -0
- package/dist/internal/otel/collector.d.ts +3 -3
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +8 -21
- package/dist/internal/otel/computer-use-attrs.d.ts +13 -0
- package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
- package/dist/internal/otel/computer-use-attrs.js +29 -0
- package/dist/internal/peer-connections.d.ts +17 -8
- package/dist/internal/peer-connections.d.ts.map +1 -1
- package/dist/internal/peer-connections.js +41 -10
- package/dist/internal/request-error-status.d.ts.map +1 -1
- package/dist/internal/request-error-status.js +4 -1
- package/dist/internal/resolved-connections.d.ts +4 -1
- package/dist/internal/resolved-connections.d.ts.map +1 -1
- package/dist/internal/resolved-connections.js +9 -4
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +16 -14
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +2 -1
- package/dist/internal/session-cost.d.ts +21 -22
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +38 -46
- package/dist/internal/session-engine.d.ts +25 -41
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +130 -122
- package/dist/internal/sessions-client.d.ts +13 -1
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +24 -0
- package/dist/internal/storage-coordinator.d.ts +9 -9
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +116 -36
- package/dist/internal/testing/factory-resource-fixtures.d.ts +16 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -1
- package/dist/internal/testing/factory-resource-fixtures.js +14 -0
- package/dist/internal/trajectory.d.ts +5 -6
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +1 -13
- package/dist/memory.d.ts +5 -2
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +1 -1
- package/dist/playground/assets/cursor-icons-16-gwXtdAvu.woff2 +0 -0
- package/dist/playground/assets/index-C77_FdOx.css +1 -0
- package/dist/playground/assets/index-CvzI2lhj.js +71 -0
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +57 -22
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +3 -0
- package/docs/deployment.md +17 -0
- package/docs/guides/agent-to-agent.md +34 -21
- package/docs/guides/export-grokbot.md +244 -0
- package/docs/guides/opentelemetry.md +19 -0
- package/docs/reference/cli.md +39 -1
- package/docs/reference/connections.md +16 -6
- package/docs/reference/hooks.md +2 -1
- package/docs/reference/memory.md +119 -0
- package/package.json +13 -5
- package/templates/agentic-owners/bot/lib/owners/matching.ts +57 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.3c56VHUt.js +0 -1
- package/dist/docs/assets/chunks/channel.S8-FFjmE.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.BB98tFjZ.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.BB98tFjZ.js +0 -1
- package/dist/docs/assets/chunks/clone.B98w8OEv.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DW_lwpZY.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.CSlECTHi.js +0 -162
- package/dist/internal/cloud-turn-cost.d.ts +0 -42
- package/dist/internal/cloud-turn-cost.d.ts.map +0 -1
- package/dist/internal/cloud-turn-cost.js +0 -120
- package/dist/internal/turn-cost.d.ts +0 -41
- package/dist/internal/turn-cost.d.ts.map +0 -1
- package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
- package/dist/playground/assets/index-7fVUOA5l.css +0 -1
- package/dist/playground/assets/index-U3TRnwAP.js +0 -71
- /package/dist/docs/assets/{reference_hooks.md.DbJC8mcZ.lean.js → reference_hooks.md.CP3FENFJ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.Ckddg6KX.lean.js → reference_skills.md.C2GWh7g8.lean.js} +0 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Export a Grok Bot"
|
|
3
|
+
description: "Turn a Grok Bot recipe into a BDK project, preview what maps, and finish secrets and connector sign-ins."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Export a Grok Bot to a BDK project
|
|
7
|
+
|
|
8
|
+
`bdk init --from-grokbot` turns a Grok Bot recipe into a project you can
|
|
9
|
+
review, run locally, and keep in source control. It carries over the bot's
|
|
10
|
+
profile, selected skills and routines, memory, and connectors where BDK has a
|
|
11
|
+
matching project surface.
|
|
12
|
+
|
|
13
|
+
## Preview the export
|
|
14
|
+
|
|
15
|
+
Start with `--dry-run`. The command resolves the same defaults as a real
|
|
16
|
+
export and shows every planned file, warning, secret name, and follow-up
|
|
17
|
+
without creating the target directory or installing packages.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bdk init ./launch-desk \
|
|
21
|
+
--from-grokbot ./launch-desk.recipe.json \
|
|
22
|
+
--dry-run
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Selected lines from the example recipe's non-interactive preview look like
|
|
26
|
+
this:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Dry run: "Launch Desk" → ./launch-desk (nothing written)
|
|
30
|
+
|
|
31
|
+
bot/agent.ts profile
|
|
32
|
+
bot/channels/slack.ts routines/launch-questions, routines/blocker-watch, routines/ship-it
|
|
33
|
+
bot/instructions.md profile, gettingStarted, routines/launch-questions, routines/blocker-watch, routines/ship-it, memory
|
|
34
|
+
bot/mcp-connections/linear.ts plugins/linear
|
|
35
|
+
bot/schedules/morning-launch-brief.md routines/morning-launch-brief
|
|
36
|
+
bot/skills/release-checklist/SKILL.md skills/release-checklist
|
|
37
|
+
SECRETS.md answers
|
|
38
|
+
...
|
|
39
|
+
|
|
40
|
+
Defaulted without asking:
|
|
41
|
+
- name
|
|
42
|
+
- description
|
|
43
|
+
- model
|
|
44
|
+
...
|
|
45
|
+
|
|
46
|
+
Not carried over:
|
|
47
|
+
- profile.avatar: BDK agents have no avatar; kept in grokbot-export.json for the Slack app icon.
|
|
48
|
+
|
|
49
|
+
Secrets to set (names only; see SECRETS.md):
|
|
50
|
+
- LAUNCH_DESK_SLACK_APP_TOKEN
|
|
51
|
+
- LAUNCH_DESK_SLACK_BOT_TOKEN
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Each file row names the recipe parts that produced it. The remaining sections
|
|
55
|
+
list defaults, answers the recipe ignored, excluded items, unmapped behavior,
|
|
56
|
+
routine placeholders, fresh connector sign-ins, warnings, and setup steps.
|
|
57
|
+
|
|
58
|
+
Add `--json` when a script needs the preview:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bdk init ./launch-desk \
|
|
62
|
+
--from-grokbot ./launch-desk.recipe.json \
|
|
63
|
+
--dry-run \
|
|
64
|
+
--json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The core JSON shape is:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"ok": true,
|
|
72
|
+
"dryRun": true,
|
|
73
|
+
"directory": "/work/launch-desk",
|
|
74
|
+
"preview": {
|
|
75
|
+
"files": [],
|
|
76
|
+
"defaulted": [],
|
|
77
|
+
"ignored": [],
|
|
78
|
+
"excluded": [],
|
|
79
|
+
"unmapped": [],
|
|
80
|
+
"fillIns": [],
|
|
81
|
+
"secrets": { "names": [], "reauth": [] },
|
|
82
|
+
"warnings": [],
|
|
83
|
+
"setupSteps": []
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
See [`bdk init`](../reference/cli.md#init) for the complete preview fields and
|
|
89
|
+
flag behavior.
|
|
90
|
+
|
|
91
|
+
## Choose an answers file or the terminal interview
|
|
92
|
+
|
|
93
|
+
Run the command in a terminal when you want to review each choice once. Press
|
|
94
|
+
Enter to accept a default.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
bdk init ./launch-desk \
|
|
98
|
+
--from-grokbot ./launch-desk.recipe.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Use `--answers` for a repeatable export or a non-interactive environment. This
|
|
102
|
+
minimal file validates against the published schema and accepts every recipe
|
|
103
|
+
default:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"$schema": "./node_modules/@cursor/bdk/schemas/grokbot-answers.schema.json",
|
|
108
|
+
"version": 1
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Save it as `grokbot-answers.json`, then run:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bdk init ./launch-desk \
|
|
116
|
+
--from-grokbot ./launch-desk.recipe.json \
|
|
117
|
+
--answers ./grokbot-answers.json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The `$schema` property is an optional editor hint. Add only the choices you
|
|
121
|
+
want to override; any answer present in the file is not asked again. A
|
|
122
|
+
positional directory such as `./launch-desk` overrides `location` in the
|
|
123
|
+
answers file.
|
|
124
|
+
|
|
125
|
+
When stdin or stdout is not a TTY, the command never prompts. `--json` also
|
|
126
|
+
uses this non-interactive path. Missing fields take their defaults and appear
|
|
127
|
+
under **Defaulted without asking** or `preview.defaulted`. If a required
|
|
128
|
+
conditional answer has no default, such as the time for a scheduled decision,
|
|
129
|
+
the command stops and names the field to add to the answers file.
|
|
130
|
+
|
|
131
|
+
## Write and check the project
|
|
132
|
+
|
|
133
|
+
Remove `--dry-run` after the preview matches your intent. The command writes
|
|
134
|
+
the project, installs its npm dependencies, and prints the next commands.
|
|
135
|
+
Export into a fresh directory; a project previously created with
|
|
136
|
+
`bdk init --template` is rejected.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
bdk init ./launch-desk \
|
|
140
|
+
--from-grokbot ./launch-desk.recipe.json \
|
|
141
|
+
--answers ./grokbot-answers.json
|
|
142
|
+
|
|
143
|
+
cd ./launch-desk
|
|
144
|
+
bdk validate
|
|
145
|
+
bdk dev
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Open the playground from `bdk dev` and try the routines you plan to keep
|
|
149
|
+
before connecting live channels.
|
|
150
|
+
|
|
151
|
+
## Review what maps where
|
|
152
|
+
|
|
153
|
+
| Grok Bot recipe part | BDK project result |
|
|
154
|
+
| --- | --- |
|
|
155
|
+
| Profile or persona | The name and description become `bot/agent.ts` and the opening of `bot/instructions.md`. |
|
|
156
|
+
| Skills | Each selected skill becomes `bot/skills/<slug>/SKILL.md`. An enabled, valid skill schedule also becomes `bot/schedules/<slug>.md` when the schedule channel is on. |
|
|
157
|
+
| Getting-started skill | `bot/instructions.md` tells the agent to use this skill for a new conversation. |
|
|
158
|
+
| Cron routines | A selected routine with a valid, enabled cron trigger becomes `bot/schedules/<slug>.md` when the schedule channel is on. |
|
|
159
|
+
| Slack routines | When the Slack channel is on, the routine text becomes a section in `bot/instructions.md`; mentions, channel watches, keywords, and reactions are wired in `bot/channels/slack.ts`. Missing trigger values remain as warnings or TODOs. |
|
|
160
|
+
| GitHub or webhook routines | When the corresponding channel is on, the preview adds a setup step to wire the trigger. A routine with no other wired trigger also becomes an on-request skill. |
|
|
161
|
+
| Other routines | A routine without a wired trigger becomes an on-request skill. The preview explains which trigger still needs work. |
|
|
162
|
+
| Memory | The default is `bot/skills/knowledge/SKILL.md`. Choose `memory: "kv"` for `bot/lib/memory-seed.json`, or `memory: "drop"` to leave it out. |
|
|
163
|
+
| Plugins and connectors | Each selected plugin becomes `bot/mcp-connections/<slug>.ts` using Cursor-account auth, OAuth, or a named bearer-token secret. |
|
|
164
|
+
| Routine placeholders | Values under `fillIns.<routine-slug>` replace placeholders such as `{slack_channel}`. Unfilled placeholders remain visible and produce warnings. |
|
|
165
|
+
| Export decisions | Resolved answers and recipe metadata are recorded in `grokbot-export.json`. |
|
|
166
|
+
|
|
167
|
+
The generated project also includes the standard package, TypeScript, eval,
|
|
168
|
+
memory-hook, and ignore files needed to run it.
|
|
169
|
+
|
|
170
|
+
## Resolve what does not map
|
|
171
|
+
|
|
172
|
+
The preview separates choices you made from behavior the converter could not
|
|
173
|
+
carry over:
|
|
174
|
+
|
|
175
|
+
| Preview result | What it means | What to do |
|
|
176
|
+
| --- | --- | --- |
|
|
177
|
+
| **Left out** | An answer excluded a skill, routine, plugin, or memory. | Change the matching `include` or `exclude` answer, or change `memory` from `"drop"`, then rerun; otherwise leave the item behind. |
|
|
178
|
+
| `BDK agents have no avatar` | The profile avatar is not an agent setting. Its metadata remains in `grokbot-export.json`. | Set an icon separately if the destination needs one. |
|
|
179
|
+
| `Unknown recipe field; ignored.` | The recipe contains a field this BDK version does not map. | Inspect the field and add its behavior to the generated project when needed. |
|
|
180
|
+
| `Paused schedule ...` | A paused cron trigger does not produce a schedule file. | Leave it paused, or add a schedule under `bot/schedules/`. |
|
|
181
|
+
| `trigger dropped: the ... channel is off.` | The answers disabled the channel used by a trigger. | Enable the channel in the answers or add the trigger manually after export. |
|
|
182
|
+
| `trigger has no BDK channel.` | The trigger type has no direct BDK channel mapping. | Add a supported channel or custom wake; use the generated on-request skill when one is present. |
|
|
183
|
+
| `is not a five-field cron expression.` | The source cron cannot become a BDK schedule. | Correct the expression and add the schedule before enabling it. |
|
|
184
|
+
| `placeholders ... are unfilled` | A routine still contains values such as `{slack_channel}`. | Set `fillIns.<routine-slug>` in the answers or edit the generated text. |
|
|
185
|
+
| `BDK has no built-in KV seed` | `memory: "kv"` writes data but does not load it into hosted KV. | Add your own `ctx.host.kv` seeding code, or use `memory: "skill"`. |
|
|
186
|
+
|
|
187
|
+
Treat setup steps and warnings as the checklist for restoring the source
|
|
188
|
+
behavior. A generated project is ready for review, not automatically ready for
|
|
189
|
+
live traffic.
|
|
190
|
+
|
|
191
|
+
## Set secrets and reconnect OAuth
|
|
192
|
+
|
|
193
|
+
The export carries secret names only, never values. `SECRETS.md` lists each
|
|
194
|
+
name, where it is read, and every connector that needs a fresh sign-in.
|
|
195
|
+
|
|
196
|
+
Set local values in the environment where you run `bdk dev`. For a hosted
|
|
197
|
+
deployment, let `bdk` prompt for each value:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
bdk secrets set launch-desk LINEAR_API_KEY
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
OAuth tokens do not move with the recipe. Sign in to each OAuth connector
|
|
204
|
+
again:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
bdk mcp oauth notion
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Add `--store` when the sign-in is for a hosted deployment.
|
|
211
|
+
|
|
212
|
+
## Check cron schedules in UTC
|
|
213
|
+
|
|
214
|
+
BDK evaluates cron schedules in UTC. A recipe routine that asks for a
|
|
215
|
+
timezone produces a warning like:
|
|
216
|
+
|
|
217
|
+
```text
|
|
218
|
+
routines/morning-launch-brief: BDK runs `0 8 * * 1-5` in UTC, not America/Los_Angeles; adjust the cron in bot/schedules/morning-launch-brief.md if the time matters.
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The timezone answer documents the source intent; it does not rewrite the cron.
|
|
222
|
+
Check each generated file under `bot/schedules/` and translate local
|
|
223
|
+
wall-clock times to UTC. For locations that observe daylight saving time,
|
|
224
|
+
also decide how you will handle the offset change.
|
|
225
|
+
|
|
226
|
+
## Use the handoff files
|
|
227
|
+
|
|
228
|
+
| File | Purpose |
|
|
229
|
+
| --- | --- |
|
|
230
|
+
| `AGENTS.md` | Gives a coding agent the project commands and points it to the export handoff. |
|
|
231
|
+
| `SECRETS.md` | Lists secret names and connector sign-ins, without values. |
|
|
232
|
+
| `SLACK.md` | When Slack is selected, holds the Slack app setup notes. |
|
|
233
|
+
| `.cursor/skills/finish-grokbot-export/SKILL.md` | Guides a coding agent through the remaining setup, warnings, validation, and local test. |
|
|
234
|
+
| `.cursor/environment.json` | Tells a Cursor cloud agent to install the project with `npm install`. |
|
|
235
|
+
|
|
236
|
+
Server-side secret transfer, automatic moves of existing Slack apps, and
|
|
237
|
+
self-deploy are not shipped, so this guide does not cover those flows.
|
|
238
|
+
|
|
239
|
+
## Related
|
|
240
|
+
|
|
241
|
+
- [`bdk init`](../reference/cli.md#init): flags, JSON output, and failures
|
|
242
|
+
- [Project layout](../reference/project-layout.md): generated project files
|
|
243
|
+
- [Schedules and reminders](../reference/schedules.md): cron behavior
|
|
244
|
+
- [MCP connections](../reference/connections.md): connector auth choices
|
|
@@ -74,6 +74,25 @@ turn: agent_sdk.turn
|
|
|
74
74
|
A conversation can produce several turn traces, so use the session ID
|
|
75
75
|
as the join key instead of expecting one long-lived session span.
|
|
76
76
|
|
|
77
|
+
### Computer use
|
|
78
|
+
|
|
79
|
+
Each computer use batch is an `agent_sdk.tool` span with
|
|
80
|
+
`cursor.tool.name` set to `computerUse`. Batches that the computer use
|
|
81
|
+
subagent runs sit under its `agent_sdk.subagent` span. Four attributes
|
|
82
|
+
describe each batch without typed text, coordinates, or screenshots:
|
|
83
|
+
|
|
84
|
+
| Attribute | Value |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `agent_sdk.computer.actions` | Action types in order, such as `click,type,screenshot` |
|
|
87
|
+
| `agent_sdk.computer.action_count` | Number of actions the agent requested |
|
|
88
|
+
| `agent_sdk.computer.completed_action_count` | Number of actions that ran |
|
|
89
|
+
| `agent_sdk.computer.executor_duration_ms` | Time the executor spent on the batch |
|
|
90
|
+
|
|
91
|
+
To export the full actions, turn on tool content as shown in
|
|
92
|
+
[Control what leaves the process](#control-what-leaves-the-process).
|
|
93
|
+
Tool content includes the text the agent typed, which can contain
|
|
94
|
+
passwords.
|
|
95
|
+
|
|
77
96
|
## Add domain telemetry
|
|
78
97
|
|
|
79
98
|
Use `ctx.host.otel` when your dashboard should answer questions the
|
package/docs/reference/cli.md
CHANGED
|
@@ -136,6 +136,7 @@ bdk serve [--dir <path>] [--port <n>] [--host <host>]
|
|
|
136
136
|
[--allow-anonymous-cursor-account-mcp]
|
|
137
137
|
[--allow-anonymous-grokbot]
|
|
138
138
|
[--public-url <url>]
|
|
139
|
+
[--peers-url <url>]
|
|
139
140
|
[--no-schedules] [--no-playground] [--no-docs]
|
|
140
141
|
[--cursor-events --repo <owner/name>]...
|
|
141
142
|
```
|
|
@@ -145,7 +146,7 @@ bdk serve [--dir <path>] [--port <n>] [--host <host>]
|
|
|
145
146
|
| `--port <n>` | Listen on this port. The default is `3000`; `0` selects an available port. When an omitted default is occupied, the CLI selects the next port. An occupied explicit port fails with a next-port hint. |
|
|
146
147
|
| `--host <host>` | Bind this host. The default is loopback-only `127.0.0.1`. |
|
|
147
148
|
| `--mode multi` | Mount projects at `/<slug>/v1/*` and `/<slug>/playground`, with an index at `/`. This is the default. |
|
|
148
|
-
| `--mode single` | Mount one project at `/v1/*` and `/playground`. |
|
|
149
|
+
| `--mode single` | Mount one project at `/v1/*` and `/playground`. Declared peers are omitted with a warning unless `--peers-url` is set. |
|
|
149
150
|
| `--dev` | Disable automatic schedule and reminder firing, admit unsigned loopback GitHub deliveries, and enable local playground access. |
|
|
150
151
|
| `--state-root <path>` | Store local sessions, streams, workspaces, and channel state here. Keep durable state outside a repository whose rules shouldn't reach agent workspaces. |
|
|
151
152
|
| `--bearer-token <secret>` | Require this token on routes without authored authentication. Mutually exclusive with `--allow-anonymous`. |
|
|
@@ -154,6 +155,7 @@ bdk serve [--dir <path>] [--port <n>] [--host <host>]
|
|
|
154
155
|
| `--allow-anonymous-cursor-account-mcp` | Let anonymous callers use Cursor account MCP connections. Requires an authenticating proxy. |
|
|
155
156
|
| `--allow-anonymous-grokbot` | Let anonymous callers drive hosted Grok Bot runtime agents. Requires an authenticating proxy. |
|
|
156
157
|
| `--public-url <url>` | Set the externally reachable base URL that turns running off the serve host use for peer MCP and host bridges. It does not expose the server; configure the listener or proxy separately. Local-runtime peers use loopback. |
|
|
158
|
+
| `--peers-url <url>` | Resolve declared peers for a single-agent serve through a hosting-provided peer service. Cursor-managed hosting sets this option automatically; a multi-agent serve rejects it. |
|
|
157
159
|
| `--no-schedules` | Disable schedule firing outside dev mode. |
|
|
158
160
|
| `--no-playground` | Skip the playground. |
|
|
159
161
|
| `--no-docs` | Skip the documentation site at `/docs`. |
|
|
@@ -447,6 +449,8 @@ requires an ID. The `status` and `cancel` subcommands require `--url`.
|
|
|
447
449
|
|
|
448
450
|
```text
|
|
449
451
|
bdk init [directory] [--template <name>] [--var id=value]... [--json]
|
|
452
|
+
bdk init [directory] --from-grokbot <recipe.json>
|
|
453
|
+
[--answers <file>] [--dry-run] [--json]
|
|
450
454
|
```
|
|
451
455
|
|
|
452
456
|
Without a directory, `init` prints the setup guide and changes no files. With
|
|
@@ -463,6 +467,40 @@ On a TTY, templates with questions run their interview before writing files.
|
|
|
463
467
|
`init` also offers to refresh the bundled coding-agent skills and starts login
|
|
464
468
|
when the host has no Cursor credential.
|
|
465
469
|
|
|
470
|
+
#### Export a Grok Bot recipe
|
|
471
|
+
|
|
472
|
+
`--from-grokbot` reads a Grok Bot recipe and maps its profile, selected skills
|
|
473
|
+
and routines, memory, channels, and connectors into a BDK project. The target
|
|
474
|
+
directory defaults to the resolved `location` answer; a positional directory
|
|
475
|
+
overrides it. A target previously created with `bdk init --template` is
|
|
476
|
+
rejected; export into a fresh directory instead.
|
|
477
|
+
|
|
478
|
+
| Option | Contract |
|
|
479
|
+
| --- | --- |
|
|
480
|
+
| `--from-grokbot <recipe.json>` | Read the recipe to export. |
|
|
481
|
+
| `--answers <file>` | Read export decisions from a JSON object. Fields present in the file are not asked again. The published schema is `schemas/grokbot-answers.schema.json`. |
|
|
482
|
+
| `--dry-run` | Print the planned files, defaults, exclusions, unmapped behavior, placeholders, secret names, warnings, and setup steps without writing files or installing dependencies. |
|
|
483
|
+
| `--json` | Never prompt and print machine-readable output. Combine it with `--dry-run` for a machine-readable preview. |
|
|
484
|
+
|
|
485
|
+
On a TTY, the command asks for missing decisions and offers recipe-derived
|
|
486
|
+
defaults. Off a TTY, it never prompts, takes defaults where possible, and
|
|
487
|
+
lists the fields it defaulted.
|
|
488
|
+
|
|
489
|
+
`--dry-run --json` prints `{ ok, dryRun, directory, preview }`. The preview
|
|
490
|
+
contains `version`, `name`, resolved `answers`, `defaulted`, `ignored`, `files`
|
|
491
|
+
as `{ path, from }`, `excluded`, `unmapped` as `{ from, reason }`, `fillIns`,
|
|
492
|
+
`secrets` as `{ names, reauth }`, `warnings`, and `setupSteps`. A write with
|
|
493
|
+
`--json` also reports `files`, `installed`, and `installError`. A dependency
|
|
494
|
+
install failure leaves `ok: true`, sets `installed: false`, reports
|
|
495
|
+
`installError`, and exits `0`. Other errors print `{ ok: false, error }` and
|
|
496
|
+
exit nonzero.
|
|
497
|
+
|
|
498
|
+
`--answers` and `--dry-run` require `--from-grokbot`. This export mode does
|
|
499
|
+
not accept `--template` or `--var`.
|
|
500
|
+
|
|
501
|
+
See [Export a Grok Bot](../guides/export-grokbot.md) for the preview-first
|
|
502
|
+
workflow, mapping table, and post-export checklist.
|
|
503
|
+
|
|
466
504
|
### Convert an Automation {#convert-automation}
|
|
467
505
|
|
|
468
506
|
```text
|
|
@@ -9,8 +9,8 @@ An MCP connection gives the agent tools from an MCP server. Define one
|
|
|
9
9
|
file per server under `bot/mcp-connections/`; the filename becomes the
|
|
10
10
|
server name. Default-export `defineConnection` from
|
|
11
11
|
`@cursor/bdk/connections`. The transport is remote HTTP, local stdio,
|
|
12
|
-
the signed-in Cursor account's connectors, or a peer agent
|
|
13
|
-
|
|
12
|
+
the signed-in Cursor account's connectors, or a peer agent addressed by
|
|
13
|
+
slug.
|
|
14
14
|
|
|
15
15
|
Put a server in `bot/host-connections/` when only host tools should
|
|
16
16
|
call it. Host connections use the same `defineConnection` shape and
|
|
@@ -254,9 +254,14 @@ Use a `{ command }` connection for stdio servers.
|
|
|
254
254
|
|
|
255
255
|
## Peer MCP connection {#peer-mcp-connection}
|
|
256
256
|
|
|
257
|
-
`{ agent: "<slug>" }` addresses another agent
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
`{ agent: "<slug>" }` addresses another agent without configuring a URL,
|
|
258
|
+
headers, or secrets. On a local multi-agent serve, the target is another
|
|
259
|
+
mount slug. On Cursor-managed hosting, it is the lowercase deployment slug
|
|
260
|
+
of another agent on the same team.
|
|
261
|
+
|
|
262
|
+
On a local multi-agent serve, the model gets the peer's `ask` and `check`
|
|
263
|
+
tools, plus `call_tool` when the peer has server tools, and can delegate work
|
|
264
|
+
to it:
|
|
260
265
|
|
|
261
266
|
```ts
|
|
262
267
|
export default defineConnection({
|
|
@@ -265,7 +270,12 @@ export default defineConnection({
|
|
|
265
270
|
});
|
|
266
271
|
```
|
|
267
272
|
|
|
268
|
-
|
|
273
|
+
Declare the connection only on the caller. The specialist needs no matching
|
|
274
|
+
configuration.
|
|
275
|
+
|
|
276
|
+
In a local multi-agent serve, unknown slugs and self-references fail at
|
|
277
|
+
startup. A single-agent serve omits peers with a warning unless its hosting
|
|
278
|
+
platform sets `--peers-url`. Walkthrough:
|
|
269
279
|
[Peer agents](../guides/agent-to-agent.md#delegate-a-question-to-a-specialist).
|
|
270
280
|
|
|
271
281
|
## Call MCP from host code
|
package/docs/reference/hooks.md
CHANGED
|
@@ -58,7 +58,8 @@ reports all three. An extension mounts its hooks as `<ns>__<name>`, and
|
|
|
58
58
|
|
|
59
59
|
`bdk init` scaffolds `bot/hooks/memory.ts`, which exports
|
|
60
60
|
`memoryHook()` from `@cursor/bdk/memory` and journals every turn for
|
|
61
|
-
later sessions to read. Delete the file to opt out.
|
|
61
|
+
later sessions to read. Delete the file to opt out. See
|
|
62
|
+
[Memory](./memory.md).
|
|
62
63
|
|
|
63
64
|
## Events and payloads
|
|
64
65
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Memory"
|
|
3
|
+
description: "Journal every turn so later sessions can read what earlier ones did."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory
|
|
7
|
+
|
|
8
|
+
Memory lets an agent recall work from earlier sessions. A memory hook
|
|
9
|
+
appends one record per turn to a shared journal, and the model reads
|
|
10
|
+
that journal with its normal file tools when its instructions send it
|
|
11
|
+
there. Every session and every user of the agent shares one journal.
|
|
12
|
+
|
|
13
|
+
## Memory is on by default
|
|
14
|
+
|
|
15
|
+
`bdk init` scaffolds `bot/hooks/memory.ts`:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// bot/hooks/memory.ts
|
|
19
|
+
import { memoryHook } from "@cursor/bdk/memory";
|
|
20
|
+
|
|
21
|
+
export default memoryHook();
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
It also adds a `## Memory` section to `bot/instructions.md`. The model
|
|
25
|
+
has no recall tool, so that section is what sends it to the journal:
|
|
26
|
+
it says when to read `memory/`, and it tells the model to treat records
|
|
27
|
+
as untrusted history. To add memory to an existing project, create the
|
|
28
|
+
hook file and copy the `## Memory` section from a fresh `bdk init`
|
|
29
|
+
project into your instructions. To turn memory off, delete the hook
|
|
30
|
+
file and the `## Memory` section.
|
|
31
|
+
|
|
32
|
+
## Journal records
|
|
33
|
+
|
|
34
|
+
The hook appends one JSON line to `memory/journal.jsonl` after each
|
|
35
|
+
turn completes or fails:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{"at":"2026-10-01T16:42:09.118Z","sessionId":"5f0c2a9e-7d1b-4c43-9a6e-2b8f1e0d7c35","channelId":"slack","status":"completed","title":"Checkout flaky test","userMessage":"Why does acme/checkout fail on main?","result":"The cart test races the price service mock...","usage":{"inputTokens":18234,"outputTokens":912,"cacheReadTokens":15002,"cacheWriteTokens":0}}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Field | Contract |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `at` | ISO-8601 time the turn finished |
|
|
44
|
+
| `sessionId` | Session that ran the turn |
|
|
45
|
+
| `channelId` | Channel that started the session, such as `http` for the session API |
|
|
46
|
+
| `status` | `"completed"` or `"failed"` |
|
|
47
|
+
| `title` | Session title, when the channel set one |
|
|
48
|
+
| `userMessage` | The message that started the turn, truncated to `maxTextLength` |
|
|
49
|
+
| `result` | Final assistant text, or the failure message, truncated to `maxTextLength` |
|
|
50
|
+
| `usage` | Token usage for completed turns; see [Events and payloads](./hooks.md#events-and-payloads) |
|
|
51
|
+
|
|
52
|
+
As the journal grows, older records move to `journal-*.jsonl` files
|
|
53
|
+
beside it. Point the model at the whole `memory/` directory when it
|
|
54
|
+
needs history beyond the latest segment.
|
|
55
|
+
|
|
56
|
+
## Read memory
|
|
57
|
+
|
|
58
|
+
Local turns find the journal at `memory/` in the session workspace. On
|
|
59
|
+
a Cursor-hosted deployment, the first prompt of each session names the
|
|
60
|
+
journal's path on that machine. A session on a server you run yourself
|
|
61
|
+
can't reach the journal.
|
|
62
|
+
|
|
63
|
+
`memory` is a reserved workspace path. BDK rejects per-send
|
|
64
|
+
`workspaceFiles` and `sandbox/workspace/` seed files under `memory/`,
|
|
65
|
+
so callers can't write records through the workspace.
|
|
66
|
+
|
|
67
|
+
Local servers keep the journal in the project state directory. `bdk
|
|
68
|
+
run` and `bdk eval` start an ephemeral server with a fresh state
|
|
69
|
+
directory unless you pass `--state-root`, so each run starts with
|
|
70
|
+
empty memory. Use `bdk serve` or `bdk dev`, or pass the same
|
|
71
|
+
`--state-root`, to keep memory across runs. Hosted deployments keep
|
|
72
|
+
the journal across redeploys.
|
|
73
|
+
|
|
74
|
+
## Who sees memory
|
|
75
|
+
|
|
76
|
+
Records from every session and every user land in the same journal, so
|
|
77
|
+
one person's messages and the agent's replies to them can surface in
|
|
78
|
+
another person's session. Turn memory off for an agent whose users
|
|
79
|
+
shouldn't see each other's requests. Turning it off stops new records,
|
|
80
|
+
but the journal keeps the records it already has. On a local server,
|
|
81
|
+
delete the `memory/` directory in the project state directory to clear
|
|
82
|
+
them. On Cursor-managed hosting, the journal is deployment data, so
|
|
83
|
+
[Privacy Mode](../deployment.md#privacy-mode) applies to it.
|
|
84
|
+
|
|
85
|
+
Anyone who can message the agent can put text in the journal. The
|
|
86
|
+
scaffolded instructions tell the model never to follow instructions
|
|
87
|
+
found inside records; keep that rule if you write your own section.
|
|
88
|
+
|
|
89
|
+
## Memory and host state
|
|
90
|
+
|
|
91
|
+
Memory is advisory. A record can be dropped, and records written by
|
|
92
|
+
concurrent sessions can show up only in a later session. Keep state
|
|
93
|
+
your code depends on, such as dedupe records and cursors, in
|
|
94
|
+
`ctx.host.kv` or `ctx.host.files`; see
|
|
95
|
+
[Handler context](./hooks.md#handler-context).
|
|
96
|
+
|
|
97
|
+
## Options
|
|
98
|
+
|
|
99
|
+
`memoryHook(options?)` accepts:
|
|
100
|
+
|
|
101
|
+
| Option | Contract |
|
|
102
|
+
| --- | --- |
|
|
103
|
+
| `maxTextLength` | Truncation cap for `userMessage` and `result`. Default `2000` characters. |
|
|
104
|
+
| `backend` | A `MemoryBackend` that replaces the default journal |
|
|
105
|
+
|
|
106
|
+
A `MemoryBackend` has `appendTurn(record, { stateRoot, agentName })`,
|
|
107
|
+
which receives each record, and an optional
|
|
108
|
+
`prepareSession({ stateRoot, agentName })`, which runs when a session
|
|
109
|
+
starts. Records go only where `appendTurn` sends them, but the
|
|
110
|
+
`memory/` directory and the hosted first-prompt path still point at the
|
|
111
|
+
default journal. Give the model a tool or file to read your records,
|
|
112
|
+
and write instructions that send it there instead of `memory/`.
|
|
113
|
+
|
|
114
|
+
## Related
|
|
115
|
+
|
|
116
|
+
- [Hooks](./hooks.md)
|
|
117
|
+
- [Instructions](./instructions.md)
|
|
118
|
+
- [Sessions](./sessions.md)
|
|
119
|
+
- [Deployment](../deployment.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cursor/bdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
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": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"!templates/pr-autofixer/README.md",
|
|
36
36
|
"docs/**/*.md",
|
|
37
37
|
"!docs/.cursor/**",
|
|
38
|
+
"!docs/design/**",
|
|
38
39
|
"!docs/templates/pr-autofixer.md",
|
|
39
40
|
"scripts/install-cursor-skills.mjs",
|
|
40
41
|
"package.json",
|
|
@@ -152,6 +153,13 @@
|
|
|
152
153
|
"import": "./dist/channels/change-monitors/index.js",
|
|
153
154
|
"default": "./dist/channels/change-monitors/index.js"
|
|
154
155
|
},
|
|
156
|
+
"./channels/runs": {
|
|
157
|
+
"anysphere-source": "./src/channels/runs/index.ts",
|
|
158
|
+
"bun": "./dist/channels/runs/index.js",
|
|
159
|
+
"types": "./dist/channels/runs/index.d.ts",
|
|
160
|
+
"import": "./dist/channels/runs/index.js",
|
|
161
|
+
"default": "./dist/channels/runs/index.js"
|
|
162
|
+
},
|
|
155
163
|
"./channels/issues": {
|
|
156
164
|
"anysphere-source": "./src/channels/issues/index.ts",
|
|
157
165
|
"types": "./dist/channels/issues/index.d.ts",
|
|
@@ -292,7 +300,7 @@
|
|
|
292
300
|
},
|
|
293
301
|
"dependencies": {
|
|
294
302
|
"@bazel/runfiles": "6.5.0",
|
|
295
|
-
"@cursor/sdk": "1.0.
|
|
303
|
+
"@cursor/sdk": "1.0.36",
|
|
296
304
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
297
305
|
"@octokit/auth-app": "^7.2.0",
|
|
298
306
|
"@octokit/rest": "^21.1.1",
|
|
@@ -357,10 +365,10 @@
|
|
|
357
365
|
"yaml": "^2.4.2",
|
|
358
366
|
"zustand": "^5.0.9",
|
|
359
367
|
"@anysphere/agent-store-sync": "1.0.0",
|
|
360
|
-
"@anysphere/proto": "1.0.0",
|
|
361
368
|
"@anysphere/context": "1.0.0",
|
|
362
|
-
"@anysphere/
|
|
363
|
-
"@anysphere/
|
|
369
|
+
"@anysphere/agent-exec": "1.0.0",
|
|
370
|
+
"@anysphere/proto": "1.0.0",
|
|
371
|
+
"@anysphere/ui": "1.0.0"
|
|
364
372
|
},
|
|
365
373
|
"scripts": {
|
|
366
374
|
"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",
|
|
@@ -3,11 +3,43 @@
|
|
|
3
3
|
|
|
4
4
|
import { minimatch } from "minimatch";
|
|
5
5
|
|
|
6
|
+
export type PatternMatchOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* When true, a `dir/` pattern whose directory is a glob claims the files
|
|
9
|
+
* under every directory the glob matches, as gitignore does. A directory
|
|
10
|
+
* that starts with `!` stays literal either way.
|
|
11
|
+
*/
|
|
12
|
+
readonly globDirectoryPatterns?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const AO_GLOB_DIRECTORY_PATTERNS_ENV = "AO_GLOB_DIRECTORY_PATTERNS";
|
|
16
|
+
|
|
6
17
|
/**
|
|
7
|
-
*
|
|
18
|
+
* The glob-directory switch from `AO_GLOB_DIRECTORY_PATTERNS`: `1`, `true` or
|
|
19
|
+
* `yes` turns it on, and anything else, unset included, leaves it off. Turn it
|
|
20
|
+
* on only after the Origin shadow counter
|
|
21
|
+
* `origin.agentic_owners.glob_dir_shadow_mismatch` has run and its owner has
|
|
22
|
+
* reviewed the repos, files and patterns it reports.
|
|
23
|
+
*/
|
|
24
|
+
export function globDirectoryPatternsFromEnv(
|
|
25
|
+
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
26
|
+
): PatternMatchOptions {
|
|
27
|
+
const value = env[AO_GLOB_DIRECTORY_PATTERNS_ENV]?.trim().toLowerCase();
|
|
28
|
+
return { globDirectoryPatterns: value === "1" || value === "true" || value === "yes" };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* CODEOWNERS-style path matching. While the glob-directory switch is off, a
|
|
33
|
+
* `dir/` pattern is read literally, a glob included: `src/d?cs/` claims only
|
|
34
|
+
* files under a directory named `src/d?cs`. With it on, the glob matches
|
|
35
|
+
* directories as in gitignore. Complex prefixes before a terminal `/**`
|
|
8
36
|
* deliberately fall through to minimatch below.
|
|
9
37
|
*/
|
|
10
|
-
export function patternMatchesFile(
|
|
38
|
+
export function patternMatchesFile(
|
|
39
|
+
pattern: string,
|
|
40
|
+
filepath: string,
|
|
41
|
+
options: PatternMatchOptions = globDirectoryPatternsFromEnv(),
|
|
42
|
+
): boolean {
|
|
11
43
|
const patternIsRooted = pattern.startsWith("/");
|
|
12
44
|
const normalizedPattern = pattern.replace(/^\/+/, "");
|
|
13
45
|
const normalizedPath = filepath.replace(/^\/+/, "");
|
|
@@ -32,6 +64,16 @@ export function patternMatchesFile(pattern: string, filepath: string): boolean {
|
|
|
32
64
|
return globMatches(normalizedPath, `${literalPrefix}*`);
|
|
33
65
|
}
|
|
34
66
|
|
|
67
|
+
const globDirectory =
|
|
68
|
+
options.globDirectoryPatterns === true ? globDirectoryOf(normalizedPattern) : undefined;
|
|
69
|
+
if (globDirectory !== undefined) {
|
|
70
|
+
const rootLevelOnly = patternIsRooted && !globDirectory.includes("/");
|
|
71
|
+
return ancestorDirectories(normalizedPath).some(
|
|
72
|
+
(ancestor) =>
|
|
73
|
+
!(rootLevelOnly && ancestor.includes("/")) && globMatches(ancestor, globDirectory),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
35
77
|
if (normalizedPattern.endsWith("/")) {
|
|
36
78
|
const prefix = normalizedPattern.replace(/\\(.)/g, "$1").replace(/\/+$/, "");
|
|
37
79
|
if (!patternIsRooted && !prefix.includes("/")) {
|
|
@@ -63,6 +105,19 @@ function hasComplexGlob(pattern: string): boolean {
|
|
|
63
105
|
return /[*?[\]{}!()+@]/.test(pattern);
|
|
64
106
|
}
|
|
65
107
|
|
|
108
|
+
function globDirectoryOf(normalizedPattern: string): string | undefined {
|
|
109
|
+
if (!normalizedPattern.endsWith("/")) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const directory = normalizedPattern.replace(/\/+$/, "");
|
|
113
|
+
return hasComplexGlob(directory) && !directory.startsWith("!") ? directory : undefined;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function ancestorDirectories(filepath: string): string[] {
|
|
117
|
+
const segments = filepath.split("/").slice(0, -1);
|
|
118
|
+
return segments.map((_, index) => segments.slice(0, index + 1).join("/"));
|
|
119
|
+
}
|
|
120
|
+
|
|
66
121
|
/** Higher score means a more specific pattern (used to break ties within one policy.yml). */
|
|
67
122
|
export function patternSpecificity(pattern: string): number {
|
|
68
123
|
const normalized = pattern.replace(/^\/+/, "");
|