@cursor/bdk 0.2.1 → 0.2.3
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 +1 -1
- package/README.md +1 -6
- package/dist/artifacts.d.ts +5 -2
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +5 -2
- package/dist/bin/agent-serve.js +23 -7
- package/dist/channels/github/auth.d.ts.map +1 -1
- package/dist/channels/github/auth.js +36 -5
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +3 -2
- package/dist/channels/slack/types.d.ts +6 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.JVQvbRO-.js → app.BOIHhrKi.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.D5L-b34G.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BkhY63uW.js → VPLocalSearchBox.D49zVZqM.js} +1 -1
- package/dist/docs/assets/chunks/{arc.Cc1unYd3.js → arc.hmjb-sc4.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CAY_TPVz.js → architectureDiagram-Q4EWVU46.CxEI1KqM.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.my2VD3Xm.js → baseUniq.DHHvBWoV.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.CQXAOmqd.js → blockDiagram-DXYQGD6D.DnXW-3bu.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.D0AsQFSX.js → c4Diagram-AHTNJAMY.e-47O2jM.js} +1 -1
- package/dist/docs/assets/chunks/channel.BbOGaJQP.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.DZjhgNls.js → chunk-4BX2VUAB.3ry4pYXB.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.qdcp_qbo.js → chunk-4TB4RGXK.DGIZFRx6.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BHXoZhJ-.js → chunk-55IACEB6.DKBnqg9U.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.Cds_Vwj3.js → chunk-EDXVE4YY.BIU8Ue5k.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CSl0HknT.js → chunk-FMBD7UC4.DP-TFhjI.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.DJMvAt5N.js → chunk-OYMX7WX6.Ux0OYj5v.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.BYQzBK9D.js → chunk-QZHKN3VN.BzHMwYox.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BAvw7N4o.js → chunk-YZCP3GAM.D4OGAsSP.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.Db58HCb1.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.Db58HCb1.js +1 -0
- package/dist/docs/assets/chunks/clone.Co4MBflG.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.Buf3seya.js → cose-bilkent-S5V4N54A.Jq_7BUNx.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.DMGGa3uA.js → dagre-KV5264BT.Di-skR2x.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.DDjnwRmY.js → diagram-5BDNPKRD.DeREHIdH.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.RwyrIr8Q.js → diagram-G4DWMVQ6.C7Kcqxro.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.DRvQV16Z.js → diagram-MMDJMWI5.BK3eohyo.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.Dw8W9BTk.js → diagram-TYMM5635.C6TyymXT.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DQT1Hnwf.js → erDiagram-SMLLAGMA.DYGG-gGx.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.6_Aky-ut.js → flowDiagram-DWJPFMVM.C9nBcSV4.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.DHIwqnqN.js → ganttDiagram-T4ZO3ILL.wAg_ymsp.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.CGd_eJbn.js → gitGraphDiagram-UUTBAWPF.B87j9Oeg.js} +1 -1
- package/dist/docs/assets/chunks/{graph.ChMEylkh.js → graph.CuFMj31w.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.Cd4gMyAz.js → infoDiagram-42DDH7IO.P_mLGumP.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.D1uw7MXq.js → ishikawaDiagram-UXIWVN3A.DyuL_MsT.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.AWLXtelc.js → journeyDiagram-VCZTEJTY.CtP09IoJ.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.CagPhAn5.js → kanban-definition-6JOO6SKY.BoeSYPZo.js} +1 -1
- package/dist/docs/assets/chunks/{layout.ClTBBkE_.js → layout.B0lMMtNo.js} +1 -1
- package/dist/docs/assets/chunks/{linear.SwS2rOLA.js → linear.HxRBiAFX.js} +1 -1
- package/dist/docs/assets/chunks/{min.By_x-Btb.js → min.BGlFFHwS.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.By_RAMaP.js → mindmap-definition-QFDTVHPH.JyLBD9M8.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.DfAl9sy4.js → pieDiagram-DEJITSTG.DnSmNZF8.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CNuqFRBj.js → quadrantDiagram-34T5L4WZ.CUCnbfCa.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.DJ5CmTCl.js → requirementDiagram-MS252O5E.py0IVUn5.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.D-T_AKJj.js → sankeyDiagram-XADWPNL6.Bkc-HWYp.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BRn9WcrR.js → sequenceDiagram-FGHM5R23.Dqn8Mlv2.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.F12urmm7.js → stateDiagram-FHFEXIEX.JikkoQUU.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CMsKhrW0.js +1 -0
- package/dist/docs/assets/chunks/{theme.zK3OJa_C.js → theme.b6HQ6zG_.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.B7GiQBeC.js → timeline-definition-GMOUNBTQ.BvpSXiBj.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.D0niwuY_.js → vennDiagram-DHZGUBPP.CU7MVnZx.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.1zhHNRsx.js → wardley-RL74JXVD.BKwC4ctG.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.DKaqpT7K.js → wardleyDiagram-NUSXRM2D.BfaF6Uhe.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.e8BPicch.js → xychartDiagram-5P7HB3ND.Bg5dcpj4.js} +1 -1
- package/dist/docs/assets/{deployment.md.nGo1yIsa.js → deployment.md.BJ8i7Q6p.js} +5 -8
- package/dist/docs/assets/{deployment.md.nGo1yIsa.lean.js → deployment.md.BJ8i7Q6p.lean.js} +1 -1
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.js → guides_github.md.Bq9kQU9B.js} +9 -3
- package/dist/docs/assets/{guides_github.md.C2_DSWlE.lean.js → guides_github.md.Bq9kQU9B.lean.js} +1 -1
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.js → guides_slack.md.diqqXTTm.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.ZbHQETOT.lean.js → guides_slack.md.diqqXTTm.lean.js} +1 -1
- package/dist/docs/assets/{quickstart.md.wG4shE1f.js → quickstart.md.CHpHPBUN.js} +5 -3
- package/dist/docs/assets/{quickstart.md.wG4shE1f.lean.js → quickstart.md.CHpHPBUN.lean.js} +1 -1
- package/dist/docs/assets/{reference_artifacts.md.IFFC5Zln.js → reference_artifacts.md.CQfKq8F2.js} +1 -1
- package/dist/docs/assets/reference_cli.md.DgeLTO18.js +91 -0
- package/dist/docs/assets/reference_cli.md.DgeLTO18.lean.js +1 -0
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.js → reference_connections.md.COq--gAm.js} +7 -3
- package/dist/docs/assets/{reference_connections.md._XpKiOaF.lean.js → reference_connections.md.COq--gAm.lean.js} +1 -1
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.js → reference_evals.md.CJm3uCUm.js} +4 -4
- package/dist/docs/assets/{reference_evals.md.DqNyHMA6.lean.js → reference_evals.md.CJm3uCUm.lean.js} +1 -1
- package/dist/docs/assets/{reference_hooks.md.Dg3dEugd.js → reference_hooks.md.DbthhtIR.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.BtpTjZmh.js → reference_sessions.md.DeRUItHD.js} +1 -1
- package/dist/docs/assets/troubleshooting.md.Cw5PKa3t.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.BzZSu1Gz.lean.js → troubleshooting.md.Cw5PKa3t.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +40 -43
- package/dist/docs/deployment.md +45 -15
- 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/github.html +43 -37
- package/dist/docs/guides/github.md +34 -0
- 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/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +37 -37
- package/dist/docs/guides/slack.md +5 -0
- 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 +205 -97
- package/dist/docs/quickstart.html +40 -38
- package/dist/docs/quickstart.md +7 -1
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +37 -37
- package/dist/docs/reference/artifacts.md +1 -1
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +55 -61
- package/dist/docs/reference/cli.md +65 -63
- package/dist/docs/reference/connections.html +42 -38
- package/dist/docs/reference/connections.md +28 -2
- package/dist/docs/reference/evals.html +39 -39
- package/dist/docs/reference/evals.md +6 -7
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +37 -37
- package/dist/docs/reference/hooks.md +3 -2
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.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 +35 -35
- package/dist/docs/reference/sessions.html +36 -36
- package/dist/docs/reference/sessions.md +4 -3
- 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/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 +36 -36
- package/dist/docs/troubleshooting.md +7 -3
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +16 -4
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +7 -3
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +7 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +4 -2
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +21 -12
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +2 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +3 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +2 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +63 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +158 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +59 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +206 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +25 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +37 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +32 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +34 -0
- package/dist/files-backends/cursor-hosted.js +4 -4
- package/dist/internal/artifacts-store.d.ts +12 -2
- package/dist/internal/artifacts-store.d.ts.map +1 -1
- package/dist/internal/artifacts-store.js +8 -4
- package/dist/internal/cli-ax.d.ts +1 -0
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +43 -10
- package/dist/internal/cli-deploy.d.ts +5 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +22 -4
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -1
- package/dist/internal/cli-mcp-oauth.js +2 -1
- package/dist/internal/cli-skills.d.ts +1 -1
- package/dist/internal/cli-skills.d.ts.map +1 -1
- package/dist/internal/cli-skills.js +5 -5
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +84 -0
- package/dist/internal/cursor/backend-client.js +5 -0
- package/dist/internal/deploy-client.d.ts +30 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +45 -9
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +11 -0
- package/dist/internal/event-mapper.d.ts +46 -4
- package/dist/internal/event-mapper.d.ts.map +1 -1
- package/dist/internal/event-mapper.js +316 -25
- package/dist/internal/hosted-delivery-protocol.d.ts +36 -11
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +31 -8
- package/dist/internal/hosted-delivery.d.ts +2 -2
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +229 -49
- package/dist/internal/hosting.d.ts +2 -2
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +9 -3
- package/dist/internal/install-cursor-skills.d.ts +20 -24
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +50 -48
- package/dist/internal/legacy-command-guard.d.ts +2 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -1
- package/dist/internal/legacy-command-guard.js +10 -1
- package/dist/internal/mcp-host.d.ts +6 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +35 -16
- package/dist/internal/sdk-runner.d.ts +2 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +10 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +11 -1
- package/dist/internal/session-engine.d.ts +1 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +33 -8
- package/dist/playground/assets/index-6BbTPnaT.css +1 -0
- package/dist/playground/assets/{index-FFdUqTt_.js → index-CI7FAmOP.js} +43 -43
- package/dist/playground/index.html +2 -2
- package/dist/types.d.ts +50 -4
- package/dist/types.d.ts.map +1 -1
- package/docs/deployment.md +45 -15
- package/docs/guides/github.md +34 -0
- package/docs/guides/slack.md +5 -0
- package/docs/quickstart.md +7 -1
- package/docs/reference/artifacts.md +1 -1
- package/docs/reference/cli.md +65 -63
- package/docs/reference/connections.md +28 -2
- package/docs/reference/evals.md +6 -7
- package/docs/reference/hooks.md +3 -2
- package/docs/reference/sessions.md +4 -3
- package/docs/troubleshooting.md +7 -3
- package/package.json +2 -4
- package/scripts/install-cursor-skills.mjs +1 -1
- package/skills/create-agent/SKILL.md +1 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/deploy/SKILL.md +1 -1
- package/skills/evals/SKILL.md +1 -1
- package/skills/framework-map/SKILL.md +1 -1
- package/skills/github/SKILL.md +1 -1
- package/skills/hillclimb/SKILL.md +1 -1
- package/skills/mcp-auth/SKILL.md +1 -1
- package/skills/otel/SKILL.md +1 -1
- package/skills/setup-slack/SKILL.md +1 -1
- package/src/artifacts.ts +5 -2
- package/src/bin/agent-serve.ts +27 -6
- package/src/channels/github/auth.ts +44 -5
- package/src/channels/slack/manifest.ts +2 -1
- package/src/channels/slack/types.ts +6 -1
- package/src/connections.ts +1 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +23 -6
- package/src/extensions/cursor-cloud-agents/lib/channels.ts +11 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +19 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +2 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +3 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +2 -0
- package/src/extensions/cursor-grokbot-agents/extension.ts +132 -0
- package/src/extensions/cursor-grokbot-agents/lib/agents.ts +42 -0
- package/src/extensions/cursor-grokbot-agents/lib/backend.ts +208 -0
- package/src/extensions/cursor-grokbot-agents/lib/contacts.ts +74 -0
- package/src/extensions/cursor-grokbot-agents/lib/conversation.ts +260 -0
- package/src/extensions/cursor-grokbot-agents/lib/inputs.ts +21 -0
- package/src/extensions/cursor-grokbot-agents/lib/lock.ts +26 -0
- package/src/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/src/extensions/cursor-grokbot-agents/tools/ask.ts +32 -0
- package/src/extensions/cursor-grokbot-agents/tools/check.ts +25 -0
- package/src/extensions/cursor-grokbot-agents/tools/interrupt.ts +17 -0
- package/src/extensions/cursor-grokbot-agents/tools/list.ts +26 -0
- package/src/files-backends/cursor-hosted.ts +4 -4
- package/src/internal/artifacts-store.ts +14 -3
- package/src/internal/cli-ax.ts +52 -7
- package/src/internal/cli-deploy.ts +39 -6
- package/src/internal/cli-mcp-oauth.ts +2 -1
- package/src/internal/cli-skills.ts +4 -5
- package/src/internal/connection-env.ts +106 -0
- package/src/internal/cursor/backend-client.ts +6 -0
- package/src/internal/deploy-client.ts +79 -9
- package/src/internal/discovery/connections.ts +11 -0
- package/src/internal/event-mapper.ts +367 -36
- package/src/internal/hosted-delivery-protocol.ts +57 -20
- package/src/internal/hosted-delivery.ts +487 -229
- package/src/internal/hosting.ts +10 -3
- package/src/internal/install-cursor-skills.ts +56 -53
- package/src/internal/legacy-command-guard.ts +13 -1
- package/src/internal/mcp-host.ts +45 -17
- package/src/internal/sdk-runner.ts +11 -0
- package/src/internal/server.ts +13 -1
- package/src/internal/session-engine.ts +33 -13
- package/src/types.ts +56 -5
- package/templates/agents-md/bot/lib/collect.ts +1 -4
- package/templates/code-wiki/bot/channels/github.ts +2 -2
- package/templates/demo/bot/channels/github.ts +5 -1
- package/templates/pr-autofixer/bot/lib/start-drive.ts +4 -4
- package/templates/triage/bot/lib/types.ts +6 -6
- package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +0 -1
- package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +0 -1
- package/dist/docs/assets/chunks/clone.zl2qolPE.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +0 -1
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +0 -97
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +0 -1
- package/dist/playground/assets/index-BMV_IcEE.css +0 -1
- /package/dist/docs/assets/{reference_artifacts.md.IFFC5Zln.lean.js → reference_artifacts.md.CQfKq8F2.lean.js} +0 -0
- /package/dist/docs/assets/{reference_hooks.md.Dg3dEugd.lean.js → reference_hooks.md.DbthhtIR.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.BtpTjZmh.lean.js → reference_sessions.md.DeRUItHD.lean.js} +0 -0
|
@@ -215,6 +215,22 @@ const agentkitSessionRunsSchema = z
|
|
|
215
215
|
startLog: z.string().nullable(),
|
|
216
216
|
})
|
|
217
217
|
.passthrough();
|
|
218
|
+
const agentkitSessionEventPollSchema = z
|
|
219
|
+
.object({
|
|
220
|
+
events: z.array(z
|
|
221
|
+
.object({
|
|
222
|
+
index: z.number().optional(),
|
|
223
|
+
type: z.string().optional(),
|
|
224
|
+
})
|
|
225
|
+
.passthrough()),
|
|
226
|
+
execution: z
|
|
227
|
+
.object({
|
|
228
|
+
executionId: z.string(),
|
|
229
|
+
turnStatus: z.string(),
|
|
230
|
+
})
|
|
231
|
+
.nullable(),
|
|
232
|
+
})
|
|
233
|
+
.passthrough();
|
|
218
234
|
const deploymentSchema = z.object({
|
|
219
235
|
id: z.number(),
|
|
220
236
|
slug: z.string(),
|
|
@@ -559,19 +575,26 @@ export class AgentServeDeployClient {
|
|
|
559
575
|
return agentkitEventRepositoriesSchema.parse(raw).repositories;
|
|
560
576
|
});
|
|
561
577
|
}
|
|
562
|
-
/**
|
|
563
|
-
* Pin a v2 install onto a release
|
|
564
|
-
* (`PUT /internal/agentsdk/deployments/:slug/release`), newest ready one
|
|
565
|
-
* when neither selector is given. A multi-tenant deploy leaves tenants
|
|
566
|
-
* on the release they were installed on.
|
|
567
|
-
*/
|
|
568
578
|
upgradeAgentkitInstall(args) {
|
|
579
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
580
|
+
return this.pinAgentkitInstall("upgrade", args);
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
rollbackAgentkitInstall(args) {
|
|
584
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
585
|
+
return this.pinAgentkitInstall("rollback", args);
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
pinAgentkitInstall(direction, args) {
|
|
569
589
|
return __awaiter(this, void 0, void 0, function* () {
|
|
570
590
|
const raw = yield this.request({
|
|
571
|
-
method: "PUT",
|
|
572
|
-
path: `/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}
|
|
591
|
+
method: direction === "upgrade" ? "PUT" : "POST",
|
|
592
|
+
path: `/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}/${direction === "upgrade" ? "release" : "rollback"}?teamId=${args.teamId}`,
|
|
573
593
|
body: Object.assign(Object.assign({}, (args.releaseId === undefined ? {} : { releaseId: args.releaseId })), (args.version === undefined ? {} : { version: args.version })),
|
|
574
|
-
context: {
|
|
594
|
+
context: {
|
|
595
|
+
verb: direction === "upgrade" ? "upgrade" : "roll back",
|
|
596
|
+
slug: args.slug,
|
|
597
|
+
},
|
|
575
598
|
});
|
|
576
599
|
return agentkitInstallReleaseSchema.parse(raw).releaseId;
|
|
577
600
|
});
|
|
@@ -624,6 +647,19 @@ export class AgentServeDeployClient {
|
|
|
624
647
|
return agentkitSessionRunsSchema.parse(raw);
|
|
625
648
|
});
|
|
626
649
|
}
|
|
650
|
+
/** Events written so far. Pass `afterEventIndex: -1` to read from the start. */
|
|
651
|
+
getAgentkitSessionEvents(args) {
|
|
652
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
653
|
+
const raw = yield this.request({
|
|
654
|
+
method: "GET",
|
|
655
|
+
path: `/internal/agentsdk/deployments/${encodeURIComponent(args.slug)}` +
|
|
656
|
+
`/sessions/${encodeURIComponent(args.sessionId)}/events` +
|
|
657
|
+
`?teamId=${args.teamId}&afterEventIndex=${args.afterEventIndex}`,
|
|
658
|
+
context: { verb: "get session events", slug: args.slug },
|
|
659
|
+
});
|
|
660
|
+
return agentkitSessionEventPollSchema.parse(raw);
|
|
661
|
+
});
|
|
662
|
+
}
|
|
627
663
|
listDeployments(args) {
|
|
628
664
|
return __awaiter(this, void 0, void 0, function* () {
|
|
629
665
|
const raw = yield this.request({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/connections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAQ1B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/internal/discovery/connections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAQ1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,gBAAgB,EAAsC,MAAM,cAAc,CAAC;AAIzF,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,mBAAmB,GAAG,MAAM,CAa/E;AA4FD,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,SAAS,oBAAoB,EAAE,GAChD,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAoBjC;AAED,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAM3C;AA2BD,wBAAsB,eAAe,CACnC,GAAG,EAAE,gBAAgB,EACrB,cAAc,EAAE,MAAM,EACtB,IAAI,GAAE,OAAO,GAAG,MAAgB,GAC/B,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAmBjC;AAED,iEAAiE;AACjE,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,gBAAgB,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,oBAAoB,EAChC,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CA8N3C"}
|
|
@@ -12,6 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
};
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { cursorAccountServersHasMixedWildcard, isInlineStdioConnection, isToolEffect, normalizeConnectionEffects, normalizeConnectionTools, normalizeCursorAccountServers, } from "../../types.js";
|
|
15
|
+
import { unresolvedConnectionEnvNames } from "../connection-env.js";
|
|
15
16
|
import { packageInlineStdioConnection } from "../package-inline-stdio.js";
|
|
16
17
|
import { displayPath, errorMessage, isBlank } from "./context.js";
|
|
17
18
|
import { importDefault, moduleEntries } from "./modules.js";
|
|
@@ -352,6 +353,16 @@ export function compileConnection(ctx, entryPath, name, connection, role) {
|
|
|
352
353
|
});
|
|
353
354
|
return undefined;
|
|
354
355
|
}
|
|
356
|
+
// A warning, never an error: templates resolve when the connection opens,
|
|
357
|
+
// and a hosted deployment binds its secrets after discovery has run.
|
|
358
|
+
const unresolved = unresolvedConnectionEnvNames(transport);
|
|
359
|
+
if (unresolved.length > 0) {
|
|
360
|
+
ctx.diagnostics.push({
|
|
361
|
+
severity: "warning",
|
|
362
|
+
path: displayPath(ctx, entryPath),
|
|
363
|
+
message: `MCP connection "${name}" templates ${unresolved.map(variable => `\${${variable}}`).join(", ")}, which the environment does not set. The value resolves when the connection opens, so hosted deployments are fine; locally, set it before the turn or the credential is empty.`,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
355
366
|
return {
|
|
356
367
|
name,
|
|
357
368
|
transport,
|
|
@@ -41,6 +41,9 @@ type NestedTaskUpdate = {
|
|
|
41
41
|
type: "step-completed";
|
|
42
42
|
stepId: number;
|
|
43
43
|
stepDurationMs: number;
|
|
44
|
+
} | {
|
|
45
|
+
type: "tool-requests-listed";
|
|
46
|
+
callCount: number;
|
|
44
47
|
};
|
|
45
48
|
type ToolCallDeltaUpdate = {
|
|
46
49
|
type: "tool-call-delta";
|
|
@@ -48,8 +51,12 @@ type ToolCallDeltaUpdate = {
|
|
|
48
51
|
modelCallId: string;
|
|
49
52
|
taskUpdate: NestedTaskUpdate;
|
|
50
53
|
};
|
|
51
|
-
|
|
52
|
-
type
|
|
54
|
+
type ToolRequestsListedUpdate = {
|
|
55
|
+
type: "tool-requests-listed";
|
|
56
|
+
callCount: number;
|
|
57
|
+
};
|
|
58
|
+
/** SDK updates plus list-closed / nested task deltas ahead of `@cursor/sdk`. */
|
|
59
|
+
type InteractionUpdate = SdkInteractionUpdate | ToolCallDeltaUpdate | ToolRequestsListedUpdate;
|
|
53
60
|
export interface ToolCallDescription {
|
|
54
61
|
toolName: string;
|
|
55
62
|
args?: unknown;
|
|
@@ -72,6 +79,17 @@ export declare class TurnEventMapper {
|
|
|
72
79
|
private summaryTitle;
|
|
73
80
|
/** Per-parent-call accumulators for nested subagent streams. */
|
|
74
81
|
private readonly nested;
|
|
82
|
+
/** One wave per model step (or per call when the step id is missing). */
|
|
83
|
+
private readonly waves;
|
|
84
|
+
/**
|
|
85
|
+
* Keys of waves that already emitted `actions.completed`, plus each
|
|
86
|
+
* finished call's singleton key. A late duplicate cannot reopen the
|
|
87
|
+
* batch or emit a second pair for the same callId. A new late callId
|
|
88
|
+
* still gets its own singleton.
|
|
89
|
+
*/
|
|
90
|
+
private readonly sealedWaveKeys;
|
|
91
|
+
/** Listed-call count from `tool-requests-listed`, keyed by parentCallId. */
|
|
92
|
+
private readonly listedCounts;
|
|
75
93
|
/**
|
|
76
94
|
* @param isStubbed Reports whether a finished tool call was answered by the
|
|
77
95
|
* host rather than executed. The harness reports an answered call exactly
|
|
@@ -106,8 +124,32 @@ export declare class TurnEventMapper {
|
|
|
106
124
|
/** Close out the turn: finalize any open assistant text block. */
|
|
107
125
|
finish(): void;
|
|
108
126
|
private handleNestedTaskUpdate;
|
|
109
|
-
private
|
|
110
|
-
private
|
|
127
|
+
private noteToolStarted;
|
|
128
|
+
private noteToolCompleted;
|
|
129
|
+
private callBelongsToWave;
|
|
130
|
+
private singletonWave;
|
|
131
|
+
/**
|
|
132
|
+
* Starts join the open model-step wave until `actions.requested` seals.
|
|
133
|
+
* A later start for that same step is its own singleton pair so completed
|
|
134
|
+
* cannot list tools the matching requested envelope never had.
|
|
135
|
+
*/
|
|
136
|
+
private waveForStart;
|
|
137
|
+
/**
|
|
138
|
+
* Completes join a model-step wave only when that call already started
|
|
139
|
+
* there. A start-less complete on an open sibling batch would flush with
|
|
140
|
+
* `actions.requested` and then block `actions.completed` forever.
|
|
141
|
+
*/
|
|
142
|
+
private waveForComplete;
|
|
143
|
+
private adoptSingletonResults;
|
|
144
|
+
private ensureWave;
|
|
145
|
+
private noteRequestsListed;
|
|
146
|
+
private maybeSealListedWave;
|
|
147
|
+
private sealOpenRequests;
|
|
148
|
+
private sealWaveRequests;
|
|
149
|
+
private maybeEmitActionsCompleted;
|
|
150
|
+
private emitActionsCompleted;
|
|
151
|
+
private forgetWave;
|
|
152
|
+
private flushOpenResults;
|
|
111
153
|
private ensureNested;
|
|
112
154
|
private flushAssistantText;
|
|
113
155
|
private flushNestedAssistantText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-mapper.d.ts","sourceRoot":"","sources":["../../src/internal/event-mapper.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"event-mapper.d.ts","sourceRoot":"","sources":["../../src/internal/event-mapper.ts"],"names":[],"mappings":"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"}
|
|
@@ -12,6 +12,11 @@ function asToolCallDelta(update) {
|
|
|
12
12
|
}
|
|
13
13
|
return update;
|
|
14
14
|
}
|
|
15
|
+
function modelCallIdOf(update) {
|
|
16
|
+
return typeof update.modelCallId === "string" && update.modelCallId !== ""
|
|
17
|
+
? update.modelCallId
|
|
18
|
+
: undefined;
|
|
19
|
+
}
|
|
15
20
|
export class TurnEventMapper {
|
|
16
21
|
/**
|
|
17
22
|
* @param isStubbed Reports whether a finished tool call was answered by the
|
|
@@ -25,6 +30,17 @@ export class TurnEventMapper {
|
|
|
25
30
|
this.reasoningAccumulator = "";
|
|
26
31
|
/** Per-parent-call accumulators for nested subagent streams. */
|
|
27
32
|
this.nested = new Map();
|
|
33
|
+
/** One wave per model step (or per call when the step id is missing). */
|
|
34
|
+
this.waves = new Map();
|
|
35
|
+
/**
|
|
36
|
+
* Keys of waves that already emitted `actions.completed`, plus each
|
|
37
|
+
* finished call's singleton key. A late duplicate cannot reopen the
|
|
38
|
+
* batch or emit a second pair for the same callId. A new late callId
|
|
39
|
+
* still gets its own singleton.
|
|
40
|
+
*/
|
|
41
|
+
this.sealedWaveKeys = new Set();
|
|
42
|
+
/** Listed-call count from `tool-requests-listed`, keyed by parentCallId. */
|
|
43
|
+
this.listedCounts = new Map();
|
|
28
44
|
}
|
|
29
45
|
/** Per-turn token usage summed across model steps. */
|
|
30
46
|
get usage() {
|
|
@@ -100,17 +116,25 @@ export class TurnEventMapper {
|
|
|
100
116
|
}
|
|
101
117
|
case "tool-call-started": {
|
|
102
118
|
this.flushAssistantText("tool_call");
|
|
103
|
-
this.
|
|
119
|
+
this.noteToolStarted(update.callId, update.toolCall, {
|
|
120
|
+
modelCallId: modelCallIdOf(update),
|
|
121
|
+
});
|
|
104
122
|
return;
|
|
105
123
|
}
|
|
106
124
|
case "tool-call-completed": {
|
|
107
|
-
this.
|
|
125
|
+
this.noteToolCompleted(update.callId, update.toolCall, {
|
|
126
|
+
modelCallId: modelCallIdOf(update),
|
|
127
|
+
});
|
|
108
128
|
return;
|
|
109
129
|
}
|
|
110
130
|
case "step-started": {
|
|
111
131
|
this.emit({ type: "step.started", data: { stepId: update.stepId } });
|
|
112
132
|
return;
|
|
113
133
|
}
|
|
134
|
+
case "tool-requests-listed": {
|
|
135
|
+
this.noteRequestsListed(undefined, update.callCount);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
114
138
|
case "step-completed": {
|
|
115
139
|
this.emit({
|
|
116
140
|
type: "step.completed",
|
|
@@ -149,6 +173,8 @@ export class TurnEventMapper {
|
|
|
149
173
|
}
|
|
150
174
|
/** Close out the turn: finalize any open assistant text block. */
|
|
151
175
|
finish() {
|
|
176
|
+
this.sealOpenRequests();
|
|
177
|
+
this.flushOpenResults();
|
|
152
178
|
this.flushAssistantText("stop");
|
|
153
179
|
for (const parentCallId of this.nested.keys()) {
|
|
154
180
|
this.flushNestedAssistantText(parentCallId, "stop");
|
|
@@ -198,15 +224,26 @@ export class TurnEventMapper {
|
|
|
198
224
|
}
|
|
199
225
|
case "tool-call-started": {
|
|
200
226
|
this.flushNestedAssistantText(parentCallId, "tool_call");
|
|
201
|
-
this.
|
|
227
|
+
this.noteToolStarted(update.callId, update.toolCall, {
|
|
228
|
+
parentCallId,
|
|
229
|
+
modelCallId: modelCallIdOf(update),
|
|
230
|
+
});
|
|
202
231
|
return;
|
|
203
232
|
}
|
|
204
233
|
case "tool-call-completed": {
|
|
205
|
-
this.
|
|
234
|
+
this.noteToolCompleted(update.callId, update.toolCall, {
|
|
235
|
+
parentCallId,
|
|
236
|
+
modelCallId: modelCallIdOf(update),
|
|
237
|
+
});
|
|
206
238
|
return;
|
|
207
239
|
}
|
|
208
240
|
case "partial-tool-call":
|
|
241
|
+
return;
|
|
209
242
|
case "step-started":
|
|
243
|
+
return;
|
|
244
|
+
case "tool-requests-listed":
|
|
245
|
+
this.noteRequestsListed(parentCallId, update.callCount);
|
|
246
|
+
return;
|
|
210
247
|
case "step-completed":
|
|
211
248
|
return;
|
|
212
249
|
default: {
|
|
@@ -214,22 +251,32 @@ export class TurnEventMapper {
|
|
|
214
251
|
}
|
|
215
252
|
}
|
|
216
253
|
}
|
|
217
|
-
|
|
254
|
+
noteToolStarted(callId, toolCall, ids) {
|
|
255
|
+
const parentCallId = ids === null || ids === void 0 ? void 0 : ids.parentCallId;
|
|
256
|
+
const modelCallId = ids === null || ids === void 0 ? void 0 : ids.modelCallId;
|
|
218
257
|
const description = describeToolCall(toolCall);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
},
|
|
229
|
-
],
|
|
258
|
+
const call = {
|
|
259
|
+
callId,
|
|
260
|
+
toolName: description.toolName,
|
|
261
|
+
args: description.args,
|
|
262
|
+
parentCallId,
|
|
263
|
+
modelCallId,
|
|
264
|
+
};
|
|
265
|
+
if (modelCallId !== undefined) {
|
|
266
|
+
this.sealOpenRequests({
|
|
230
267
|
parentCallId,
|
|
231
|
-
|
|
232
|
-
|
|
268
|
+
exceptModelCallId: modelCallId,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const wave = this.waveForStart({ parentCallId, modelCallId, callId });
|
|
272
|
+
if (wave === undefined) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (wave.calls.every(existing => existing.callId !== callId)) {
|
|
276
|
+
wave.calls.push(call);
|
|
277
|
+
}
|
|
278
|
+
this.adoptSingletonResults(wave, parentCallId, callId);
|
|
279
|
+
this.maybeSealListedWave(wave);
|
|
233
280
|
// Subagent bookends only fire for the top-level task tool, not nested
|
|
234
281
|
// tools inside a subagent (nested subagents aren't supported).
|
|
235
282
|
if (description.subagent !== undefined && parentCallId === undefined) {
|
|
@@ -242,14 +289,39 @@ export class TurnEventMapper {
|
|
|
242
289
|
},
|
|
243
290
|
});
|
|
244
291
|
}
|
|
292
|
+
if (wave.modelCallId === undefined) {
|
|
293
|
+
this.sealWaveRequests(wave);
|
|
294
|
+
}
|
|
245
295
|
}
|
|
246
|
-
|
|
296
|
+
noteToolCompleted(callId, toolCall, ids) {
|
|
297
|
+
const parentCallId = ids === null || ids === void 0 ? void 0 : ids.parentCallId;
|
|
298
|
+
const modelCallId = ids === null || ids === void 0 ? void 0 : ids.modelCallId;
|
|
247
299
|
const description = describeToolCall(toolCall);
|
|
248
300
|
const result = describeToolResult(toolCall);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
301
|
+
const actionResult = {
|
|
302
|
+
callId,
|
|
303
|
+
toolName: description.toolName,
|
|
304
|
+
output: result.output,
|
|
305
|
+
isError: result.isError,
|
|
306
|
+
stubbed: this.isStubbed(callId) ? true : undefined,
|
|
307
|
+
parentCallId,
|
|
308
|
+
modelCallId,
|
|
309
|
+
};
|
|
310
|
+
const wave = this.waveForComplete({ parentCallId, modelCallId, callId });
|
|
311
|
+
if (wave === undefined) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const isNew = wave.results.every(existing => existing.callId !== callId);
|
|
315
|
+
if (isNew) {
|
|
316
|
+
wave.results.push(actionResult);
|
|
317
|
+
}
|
|
318
|
+
if (wave.requestedEmitted && isNew) {
|
|
319
|
+
this.emit({
|
|
320
|
+
type: "action.result",
|
|
321
|
+
data: actionResult,
|
|
322
|
+
});
|
|
323
|
+
this.maybeEmitActionsCompleted(wave);
|
|
324
|
+
}
|
|
253
325
|
if (description.subagent !== undefined && parentCallId === undefined) {
|
|
254
326
|
this.flushNestedAssistantText(callId, "stop");
|
|
255
327
|
this.nested.delete(callId);
|
|
@@ -259,6 +331,215 @@ export class TurnEventMapper {
|
|
|
259
331
|
});
|
|
260
332
|
}
|
|
261
333
|
}
|
|
334
|
+
callBelongsToWave(wave, callId) {
|
|
335
|
+
return (wave.calls.some(existing => existing.callId === callId) ||
|
|
336
|
+
wave.results.some(existing => existing.callId === callId));
|
|
337
|
+
}
|
|
338
|
+
singletonWave(parentCallId, callId) {
|
|
339
|
+
const key = waveKey({ parentCallId, callId });
|
|
340
|
+
if (this.sealedWaveKeys.has(key) && !this.waves.has(key)) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
return this.ensureWave(key, { parentCallId });
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Starts join the open model-step wave until `actions.requested` seals.
|
|
347
|
+
* A later start for that same step is its own singleton pair so completed
|
|
348
|
+
* cannot list tools the matching requested envelope never had.
|
|
349
|
+
*/
|
|
350
|
+
waveForStart(ids) {
|
|
351
|
+
const groupedKey = waveKey(ids);
|
|
352
|
+
const grouped = this.waves.get(groupedKey);
|
|
353
|
+
if (grouped !== undefined && !grouped.requestedEmitted) {
|
|
354
|
+
return grouped;
|
|
355
|
+
}
|
|
356
|
+
if (grouped !== undefined && this.callBelongsToWave(grouped, ids.callId)) {
|
|
357
|
+
return grouped;
|
|
358
|
+
}
|
|
359
|
+
if (grouped !== undefined && grouped.requestedEmitted) {
|
|
360
|
+
return this.singletonWave(ids.parentCallId, ids.callId);
|
|
361
|
+
}
|
|
362
|
+
if (this.sealedWaveKeys.has(groupedKey)) {
|
|
363
|
+
return this.singletonWave(ids.parentCallId, ids.callId);
|
|
364
|
+
}
|
|
365
|
+
return this.ensureWave(groupedKey, {
|
|
366
|
+
modelCallId: ids.modelCallId,
|
|
367
|
+
parentCallId: ids.parentCallId,
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Completes join a model-step wave only when that call already started
|
|
372
|
+
* there. A start-less complete on an open sibling batch would flush with
|
|
373
|
+
* `actions.requested` and then block `actions.completed` forever.
|
|
374
|
+
*/
|
|
375
|
+
waveForComplete(ids) {
|
|
376
|
+
const groupedKey = waveKey(ids);
|
|
377
|
+
const grouped = this.waves.get(groupedKey);
|
|
378
|
+
if (grouped !== undefined && this.callBelongsToWave(grouped, ids.callId)) {
|
|
379
|
+
return grouped;
|
|
380
|
+
}
|
|
381
|
+
if (grouped !== undefined) {
|
|
382
|
+
return this.singletonWave(ids.parentCallId, ids.callId);
|
|
383
|
+
}
|
|
384
|
+
if (this.sealedWaveKeys.has(groupedKey)) {
|
|
385
|
+
return this.waves.get(waveKey({ parentCallId: ids.parentCallId, callId: ids.callId }));
|
|
386
|
+
}
|
|
387
|
+
return this.ensureWave(groupedKey, {
|
|
388
|
+
modelCallId: ids.modelCallId,
|
|
389
|
+
parentCallId: ids.parentCallId,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
adoptSingletonResults(wave, parentCallId, callId) {
|
|
393
|
+
const singletonKey = waveKey({ parentCallId, callId });
|
|
394
|
+
if (singletonKey === wave.key) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
const singleton = this.waves.get(singletonKey);
|
|
398
|
+
if (singleton === undefined) {
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
for (const result of singleton.results) {
|
|
402
|
+
if (wave.results.every(existing => existing.callId !== result.callId)) {
|
|
403
|
+
wave.results.push(result);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
this.waves.delete(singletonKey);
|
|
407
|
+
}
|
|
408
|
+
ensureWave(key, ids) {
|
|
409
|
+
var _a;
|
|
410
|
+
let wave = this.waves.get(key);
|
|
411
|
+
if (wave === undefined) {
|
|
412
|
+
const expectedCalls = this.listedCounts.get((_a = ids.parentCallId) !== null && _a !== void 0 ? _a : "");
|
|
413
|
+
wave = {
|
|
414
|
+
key,
|
|
415
|
+
modelCallId: ids.modelCallId,
|
|
416
|
+
parentCallId: ids.parentCallId,
|
|
417
|
+
expectedCalls,
|
|
418
|
+
calls: [],
|
|
419
|
+
results: [],
|
|
420
|
+
requestedEmitted: false,
|
|
421
|
+
completedEmitted: false,
|
|
422
|
+
};
|
|
423
|
+
this.waves.set(key, wave);
|
|
424
|
+
}
|
|
425
|
+
return wave;
|
|
426
|
+
}
|
|
427
|
+
noteRequestsListed(parentCallId, callCount) {
|
|
428
|
+
const listed = Math.max(0, callCount);
|
|
429
|
+
if (listed === 0) {
|
|
430
|
+
this.sealOpenRequests({ parentCallId });
|
|
431
|
+
this.listedCounts.delete(parentCallId !== null && parentCallId !== void 0 ? parentCallId : "");
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
this.listedCounts.set(parentCallId !== null && parentCallId !== void 0 ? parentCallId : "", listed);
|
|
435
|
+
for (const wave of this.waves.values()) {
|
|
436
|
+
if (wave.parentCallId !== parentCallId || wave.requestedEmitted) {
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
wave.expectedCalls = listed;
|
|
440
|
+
this.maybeSealListedWave(wave);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
maybeSealListedWave(wave) {
|
|
444
|
+
var _a, _b;
|
|
445
|
+
const expected = (_a = wave.expectedCalls) !== null && _a !== void 0 ? _a : this.listedCounts.get((_b = wave.parentCallId) !== null && _b !== void 0 ? _b : "");
|
|
446
|
+
if (expected !== undefined && wave.calls.length >= expected) {
|
|
447
|
+
this.sealWaveRequests(wave);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
sealOpenRequests(ids) {
|
|
451
|
+
const parentCallId = ids === null || ids === void 0 ? void 0 : ids.parentCallId;
|
|
452
|
+
const exceptModelCallId = ids === null || ids === void 0 ? void 0 : ids.exceptModelCallId;
|
|
453
|
+
for (const wave of this.waves.values()) {
|
|
454
|
+
if (wave.parentCallId !== parentCallId) {
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
if (exceptModelCallId !== undefined && wave.modelCallId === exceptModelCallId) {
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
this.sealWaveRequests(wave);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
sealWaveRequests(wave) {
|
|
464
|
+
var _a;
|
|
465
|
+
if (wave.requestedEmitted || wave.calls.length === 0) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
wave.requestedEmitted = true;
|
|
469
|
+
this.listedCounts.delete((_a = wave.parentCallId) !== null && _a !== void 0 ? _a : "");
|
|
470
|
+
this.emit({
|
|
471
|
+
type: "actions.requested",
|
|
472
|
+
data: {
|
|
473
|
+
calls: wave.calls,
|
|
474
|
+
parentCallId: wave.parentCallId,
|
|
475
|
+
modelCallId: wave.modelCallId,
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
for (const result of wave.results) {
|
|
479
|
+
this.emit({
|
|
480
|
+
type: "action.result",
|
|
481
|
+
data: result,
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
this.maybeEmitActionsCompleted(wave);
|
|
485
|
+
}
|
|
486
|
+
maybeEmitActionsCompleted(wave) {
|
|
487
|
+
if (wave.completedEmitted ||
|
|
488
|
+
!wave.requestedEmitted ||
|
|
489
|
+
wave.calls.length === 0 ||
|
|
490
|
+
wave.results.length < wave.calls.length) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
const callIds = new Set(wave.calls.map(call => call.callId));
|
|
494
|
+
if (!wave.results.every(result => callIds.has(result.callId))) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (!wave.calls.every(call => wave.results.some(result => result.callId === call.callId))) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this.emitActionsCompleted(wave);
|
|
501
|
+
}
|
|
502
|
+
emitActionsCompleted(wave) {
|
|
503
|
+
wave.completedEmitted = true;
|
|
504
|
+
this.emit({
|
|
505
|
+
type: "actions.completed",
|
|
506
|
+
data: {
|
|
507
|
+
results: wave.results,
|
|
508
|
+
parentCallId: wave.parentCallId,
|
|
509
|
+
modelCallId: wave.modelCallId,
|
|
510
|
+
},
|
|
511
|
+
});
|
|
512
|
+
this.forgetWave(wave);
|
|
513
|
+
}
|
|
514
|
+
forgetWave(wave) {
|
|
515
|
+
this.waves.delete(wave.key);
|
|
516
|
+
this.sealedWaveKeys.add(wave.key);
|
|
517
|
+
for (const callId of new Set([
|
|
518
|
+
...wave.calls.map(call => call.callId),
|
|
519
|
+
...wave.results.map(result => result.callId),
|
|
520
|
+
])) {
|
|
521
|
+
this.sealedWaveKeys.add(waveKey({ parentCallId: wave.parentCallId, callId }));
|
|
522
|
+
}
|
|
523
|
+
wave.calls = [];
|
|
524
|
+
wave.results = [];
|
|
525
|
+
}
|
|
526
|
+
flushOpenResults() {
|
|
527
|
+
for (const wave of [...this.waves.values()]) {
|
|
528
|
+
if (wave.calls.length === 0 && wave.results.length > 0) {
|
|
529
|
+
wave.calls = wave.results.map(result => ({
|
|
530
|
+
callId: result.callId,
|
|
531
|
+
toolName: result.toolName,
|
|
532
|
+
parentCallId: result.parentCallId,
|
|
533
|
+
modelCallId: result.modelCallId,
|
|
534
|
+
}));
|
|
535
|
+
}
|
|
536
|
+
this.sealWaveRequests(wave);
|
|
537
|
+
this.maybeEmitActionsCompleted(wave);
|
|
538
|
+
if (!wave.completedEmitted) {
|
|
539
|
+
this.forgetWave(wave);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
262
543
|
ensureNested(parentCallId) {
|
|
263
544
|
let acc = this.nested.get(parentCallId);
|
|
264
545
|
if (acc === undefined) {
|
|
@@ -323,8 +604,14 @@ export function describeToolCall(toolCall) {
|
|
|
323
604
|
const subagentName = (_a = subagentType === null || subagentType === void 0 ? void 0 : subagentType.name) !== null && _a !== void 0 ? _a : subagentType === null || subagentType === void 0 ? void 0 : subagentType.kind;
|
|
324
605
|
return {
|
|
325
606
|
toolName: "task",
|
|
326
|
-
args:
|
|
327
|
-
|
|
607
|
+
args: {
|
|
608
|
+
description: toolCall.args.description,
|
|
609
|
+
subagentType: subagentName,
|
|
610
|
+
},
|
|
611
|
+
subagent: {
|
|
612
|
+
name: subagentName,
|
|
613
|
+
description: toolCall.args.description,
|
|
614
|
+
},
|
|
328
615
|
};
|
|
329
616
|
}
|
|
330
617
|
default: {
|
|
@@ -357,6 +644,10 @@ export function describeToolResult(toolCall) {
|
|
|
357
644
|
}
|
|
358
645
|
return { output: result.value, isError: false };
|
|
359
646
|
}
|
|
647
|
+
function waveKey(ids) {
|
|
648
|
+
var _a, _b;
|
|
649
|
+
return `${(_a = ids.parentCallId) !== null && _a !== void 0 ? _a : ""}:${(_b = ids.modelCallId) !== null && _b !== void 0 ? _b : `call:${ids.callId}`}`;
|
|
650
|
+
}
|
|
360
651
|
function addUsage(total, usage) {
|
|
361
652
|
var _a, _b;
|
|
362
653
|
if (total === undefined) {
|