@cursor/july 0.1.101 → 0.1.102
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/README.md +27 -0
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -1
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +28 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.BASO9Kih.js → app.CLA03RCz.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.DWCwM6p-.js} +2 -2
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.lean.js +1 -0
- package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.js → guides_cloud-runtime.md.BRirbRAN.js} +1 -1
- package/dist/docs/assets/index.md.Kiht7ell.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.Kiht7ell.lean.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.js +56 -0
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +1 -0
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.CA6QP6Lw.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.CA6QP6Lw.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.B1up2r9W.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.DDa4MeEW.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +3 -3
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +4 -4
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +93 -0
- package/dist/docs/guides/cloud-runtime.html +6 -6
- package/dist/docs/guides/cloud-runtime.md +2 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +4 -4
- package/dist/docs/guides/opentelemetry.html +5 -5
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -1
- package/dist/docs/llms-full.txt +321 -4
- package/dist/docs/llms.txt +2 -0
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +5 -5
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +82 -0
- package/dist/docs/reference/extensions.md +200 -0
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +3 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +2 -0
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +1 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +4 -4
- package/dist/docs/skills/setup-slack.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
- package/dist/extensions.d.ts +38 -14
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +49 -12
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +5 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +22 -18
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +13 -15
- package/dist/internal/cursor/backend-client.d.ts +8 -1
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +25 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +11 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +15 -0
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +101 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +11 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +306 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +17 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +436 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +570 -0
- package/dist/internal/discovery/extensions.d.ts +19 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +238 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +48 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +141 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +101 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +36 -0
- package/dist/internal/discovery/project.d.ts +53 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +239 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +98 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +97 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +17 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +104 -0
- package/dist/internal/discovery/skills.d.ts +16 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +151 -0
- package/dist/internal/discovery/subagent.d.ts +13 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +19 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -62
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +8 -2505
- package/dist/internal/framework-file-storage.js +6 -6
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +37 -20
- package/dist/internal/otel/collector.d.ts +13 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +84 -17
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +2 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +68 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +2 -0
- package/dist/internal/session-engine.d.ts +5 -0
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +68 -32
- package/dist/internal/session-run-log.d.ts +2 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +13 -14
- package/dist/internal/start-log-store.d.ts +1 -1
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +12 -14
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/otel.d.ts +16 -0
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +26 -0
- package/dist/playground/assets/index-B6C9S9nG.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +24 -23
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +68 -65
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +39 -3
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -1
- package/docs/concepts.md +3 -3
- package/docs/guides/cloud-agents.md +98 -0
- package/docs/guides/cloud-runtime.md +2 -0
- package/docs/reference/extensions.md +205 -0
- package/docs/reference/project-layout.md +3 -0
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +2 -0
- package/package.json +1 -1
- package/skills/framework-map/SKILL.md +1 -0
- package/src/channels/slack/api.ts +4 -2
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/manifest.ts +2 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
- package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +55 -12
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +43 -34
- package/src/index.ts +10 -1
- package/src/internal/conversation-mirror.ts +23 -18
- package/src/internal/cursor/backend-client.ts +32 -10
- package/src/internal/cursor/hosted-store-secrets.ts +27 -0
- package/src/internal/discovery/ab.ts +111 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +360 -0
- package/src/internal/discovery/channels.ts +103 -0
- package/src/internal/discovery/connections.ts +540 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +708 -0
- package/src/internal/discovery/extensions.ts +348 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +45 -0
- package/src/internal/discovery/info.ts +179 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +44 -0
- package/src/internal/discovery/project.ts +270 -0
- package/src/internal/discovery/runtime.ts +159 -0
- package/src/internal/discovery/schedules.ts +94 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +124 -0
- package/src/internal/discovery/skills.ts +176 -0
- package/src/internal/discovery/subagent.ts +29 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +20 -3081
- package/src/internal/framework-file-storage.ts +6 -6
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/mcp-host.ts +84 -31
- package/src/internal/otel/collector.ts +125 -25
- package/src/internal/otel/http.ts +2 -12
- package/src/internal/otel/mcp.ts +69 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +2 -0
- package/src/internal/session-engine.ts +96 -11
- package/src/internal/session-run-log.ts +17 -16
- package/src/internal/start-log-store.ts +13 -16
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/otel.ts +38 -0
- package/src/storage-protocol.ts +101 -91
- package/src/storage.ts +4 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +43 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
- package/dist/docs/assets/concepts.md.lwAgBIMI.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
- package/dist/playground/assets/index-DBQCwFp0.css +0 -1
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
- package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
- /package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.rPzW2HZN.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.CkYbjnAX.lean.js → guides_cloud-runtime.md.BRirbRAN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.B1up2r9W.lean.js} +0 -0
- /package/dist/playground/assets/{index-BnNN1-EK.js → index-ZqNoT8Ie.js} +0 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Cursor backend as the tools use it: launches go through the public
|
|
3
|
+
* v1 Cloud Agents API (the only surface that takes per-launch `envVars`),
|
|
4
|
+
* everything about an existing agent goes through the same
|
|
5
|
+
* `aiserver.v1.BackgroundComposerService` RPCs Sand's CloudAgent tool
|
|
6
|
+
* calls, so follow-ups queue, runs pause, and the full conversation is
|
|
7
|
+
* readable. Both authenticate with the host's Cursor API key; the RPCs
|
|
8
|
+
* exchange it for a session token the way the dashboard client does.
|
|
9
|
+
*/
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
import { randomUUID } from "node:crypto";
|
|
20
|
+
import { z } from "zod";
|
|
21
|
+
import { CursorBackendClient } from "../../../internal/cursor/backend-client.js";
|
|
22
|
+
import { cursorBackendUrl, cursorExternalApiUrl, cursorWebsiteUrl, resolveApiKeySync, SIGN_IN_HINT, } from "../../../internal/cursor/credentials.js";
|
|
23
|
+
import { toModelSelection } from "../../../internal/sdk-runner.js";
|
|
24
|
+
import extension from "../extension.js";
|
|
25
|
+
const SERVICE = "BackgroundComposerService";
|
|
26
|
+
/** Launches and follow-ups from this extension carry the SDK source, like the v1 API. */
|
|
27
|
+
const SOURCE = "BACKGROUND_COMPOSER_SOURCE_SDK";
|
|
28
|
+
const RPC_TIMEOUT_MS = 60000;
|
|
29
|
+
// The create call returns once the initial run exists, which can wait on a VM.
|
|
30
|
+
const LAUNCH_TIMEOUT_MS = 300000;
|
|
31
|
+
export class CloudAgentsApiError extends Error {
|
|
32
|
+
constructor(message, status) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.status = status;
|
|
35
|
+
this.name = "CloudAgentsApiError";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Proto-JSON response schemas (camelCase; default-valued fields are omitted)
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
const composerSchema = z.object({
|
|
42
|
+
bcId: z.string(),
|
|
43
|
+
name: z.string().optional(),
|
|
44
|
+
status: z.string().optional(),
|
|
45
|
+
isArchived: z.boolean().optional(),
|
|
46
|
+
branchName: z.string().optional(),
|
|
47
|
+
prUrl: z.string().optional(),
|
|
48
|
+
linesAdded: z.number().optional(),
|
|
49
|
+
linesRemoved: z.number().optional(),
|
|
50
|
+
filesChanged: z.number().optional(),
|
|
51
|
+
});
|
|
52
|
+
const errorDetailsSchema = z.object({
|
|
53
|
+
details: z
|
|
54
|
+
.object({ title: z.string().optional(), detail: z.string().optional() })
|
|
55
|
+
.optional(),
|
|
56
|
+
});
|
|
57
|
+
const infoResponseSchema = z.object({
|
|
58
|
+
composer: z.object({
|
|
59
|
+
composer: composerSchema,
|
|
60
|
+
summary: z.string().optional(),
|
|
61
|
+
startError: errorDetailsSchema.optional(),
|
|
62
|
+
permanentError: errorDetailsSchema.optional(),
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
const toolResultSchema = z.object({
|
|
66
|
+
toolName: z.string().optional(),
|
|
67
|
+
args: z.string().optional(),
|
|
68
|
+
rawArgs: z.string().optional(),
|
|
69
|
+
content: z.string().optional(),
|
|
70
|
+
error: z
|
|
71
|
+
.object({ clientVisibleErrorMessage: z.string().optional() })
|
|
72
|
+
.optional(),
|
|
73
|
+
});
|
|
74
|
+
const conversationResponseSchema = z.object({
|
|
75
|
+
conversation: z
|
|
76
|
+
.array(z.object({
|
|
77
|
+
type: z.string().optional(),
|
|
78
|
+
text: z.string().optional(),
|
|
79
|
+
thinking: z.object({ text: z.string().optional() }).optional(),
|
|
80
|
+
toolResults: z.array(toolResultSchema).optional(),
|
|
81
|
+
}))
|
|
82
|
+
.optional(),
|
|
83
|
+
});
|
|
84
|
+
const followupResponseSchema = z.object({ runId: z.string().optional() });
|
|
85
|
+
const launchResponseSchema = z.object({
|
|
86
|
+
agent: z.object({ id: z.string(), url: z.string().optional() }),
|
|
87
|
+
run: z.object({ id: z.string(), status: z.string() }),
|
|
88
|
+
});
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
export class CloudAgentsBackend {
|
|
91
|
+
constructor(apiKey, fetchImpl = fetch) {
|
|
92
|
+
this.apiKey = apiKey;
|
|
93
|
+
this.fetchImpl = fetchImpl;
|
|
94
|
+
// The key is read per call: the host can sign in after the mount.
|
|
95
|
+
this.rpcClient = new CursorBackendClient({
|
|
96
|
+
backendUrl: cursorBackendUrl(),
|
|
97
|
+
apiKey: "",
|
|
98
|
+
getApiKey: apiKey,
|
|
99
|
+
fetchImpl,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** `POST /v1/agents`: create the agent and start its first run in one call. */
|
|
103
|
+
launch(request) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
var _a;
|
|
106
|
+
const { cloud } = request;
|
|
107
|
+
const body = {
|
|
108
|
+
prompt: { text: request.prompt },
|
|
109
|
+
name: request.name,
|
|
110
|
+
model: request.model === undefined
|
|
111
|
+
? undefined
|
|
112
|
+
: toModelSelection(request.model),
|
|
113
|
+
env: cloud.env,
|
|
114
|
+
envVars: cloud.envVars,
|
|
115
|
+
repos: cloud.repos,
|
|
116
|
+
workOnCurrentBranch: cloud.workOnCurrentBranch,
|
|
117
|
+
autoCreatePR: cloud.autoCreatePR,
|
|
118
|
+
skipReviewerRequest: cloud.skipReviewerRequest,
|
|
119
|
+
};
|
|
120
|
+
let response;
|
|
121
|
+
try {
|
|
122
|
+
response = yield this.fetchImpl(`${cursorExternalApiUrl()}/v1/agents`, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: {
|
|
125
|
+
"content-type": "application/json",
|
|
126
|
+
authorization: `Bearer ${this.apiKey()}`,
|
|
127
|
+
"x-ghost-mode": "true",
|
|
128
|
+
"x-cursor-client-type": "agent-serve",
|
|
129
|
+
"x-request-id": randomUUID(),
|
|
130
|
+
},
|
|
131
|
+
body: JSON.stringify(body),
|
|
132
|
+
signal: AbortSignal.timeout(LAUNCH_TIMEOUT_MS),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
throw new CloudAgentsApiError(`Cloud agent launch failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
137
|
+
}
|
|
138
|
+
const text = yield response.text();
|
|
139
|
+
if (!response.ok) {
|
|
140
|
+
throw new CloudAgentsApiError(`Cloud agent launch failed (${response.status}): ${apiErrorMessage(text)}`, response.status);
|
|
141
|
+
}
|
|
142
|
+
const parsed = launchResponseSchema.parse(JSON.parse(text));
|
|
143
|
+
return {
|
|
144
|
+
agentId: parsed.agent.id,
|
|
145
|
+
runId: parsed.run.id,
|
|
146
|
+
status: parsed.run.status.toLowerCase(),
|
|
147
|
+
url: (_a = parsed.agent.url) !== null && _a !== void 0 ? _a : agentUrl(parsed.agent.id),
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
info(agentId) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
var _a, _b, _c, _d;
|
|
154
|
+
const { composer } = infoResponseSchema.parse(yield this.rpcClient.serviceRpc(SERVICE, "GetBackgroundComposerInfo", { bcId: agentId }, RPC_TIMEOUT_MS));
|
|
155
|
+
const { composer: summary } = composer;
|
|
156
|
+
const failure = (_a = composer.permanentError) !== null && _a !== void 0 ? _a : composer.startError;
|
|
157
|
+
return {
|
|
158
|
+
agentId: summary.bcId,
|
|
159
|
+
name: (_b = summary.name) !== null && _b !== void 0 ? _b : "",
|
|
160
|
+
status: statusOf(summary.status),
|
|
161
|
+
archived: summary.isArchived === true,
|
|
162
|
+
url: agentUrl(summary.bcId),
|
|
163
|
+
branch: emptyToUndefined(summary.branchName),
|
|
164
|
+
prUrl: emptyToUndefined(summary.prUrl),
|
|
165
|
+
summary: emptyToUndefined(composer.summary),
|
|
166
|
+
error: failureMessage(failure),
|
|
167
|
+
changes: summary.filesChanged === undefined
|
|
168
|
+
? undefined
|
|
169
|
+
: {
|
|
170
|
+
filesChanged: summary.filesChanged,
|
|
171
|
+
linesAdded: (_c = summary.linesAdded) !== null && _c !== void 0 ? _c : 0,
|
|
172
|
+
linesRemoved: (_d = summary.linesRemoved) !== null && _d !== void 0 ? _d : 0,
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
conversation(agentId) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const { conversation } = conversationResponseSchema.parse(yield this.rpcClient.serviceRpc(SERVICE, "GetBackgroundComposerConversation", { bcId: agentId }, RPC_TIMEOUT_MS));
|
|
180
|
+
return (conversation !== null && conversation !== void 0 ? conversation : []).map((message) => {
|
|
181
|
+
var _a;
|
|
182
|
+
var _b;
|
|
183
|
+
const toolCalls = ((_b = message.toolResults) !== null && _b !== void 0 ? _b : []).map((result) => { var _a; var _b, _c; return ({
|
|
184
|
+
name: (_b = result.toolName) !== null && _b !== void 0 ? _b : "",
|
|
185
|
+
args: parseArgs((_c = result.args) !== null && _c !== void 0 ? _c : result.rawArgs),
|
|
186
|
+
content: result.content,
|
|
187
|
+
error: (_a = result.error) === null || _a === void 0 ? void 0 : _a.clientVisibleErrorMessage,
|
|
188
|
+
}); });
|
|
189
|
+
return {
|
|
190
|
+
role: message.type === "MESSAGE_TYPE_HUMAN" ? "user" : "assistant",
|
|
191
|
+
text: emptyToUndefined(message.text),
|
|
192
|
+
thinking: emptyToUndefined((_a = message.thinking) === null || _a === void 0 ? void 0 : _a.text),
|
|
193
|
+
toolCalls: toolCalls.length === 0 ? undefined : toolCalls,
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Queue a follow-up behind the current run, or with `interrupt` cancel the
|
|
200
|
+
* in-flight step and run it now; the backend's `synchronous` switch.
|
|
201
|
+
*/
|
|
202
|
+
followUp(agentId, prompt, interrupt) {
|
|
203
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
const { runId } = followupResponseSchema.parse(yield this.rpcClient.serviceRpc(SERVICE, "AddAsyncFollowupBackgroundComposer", {
|
|
205
|
+
bcId: agentId,
|
|
206
|
+
synchronous: interrupt,
|
|
207
|
+
followupSource: SOURCE,
|
|
208
|
+
followupMessage: {
|
|
209
|
+
text: prompt,
|
|
210
|
+
type: "MESSAGE_TYPE_HUMAN",
|
|
211
|
+
bubbleId: randomUUID(),
|
|
212
|
+
},
|
|
213
|
+
}, RPC_TIMEOUT_MS));
|
|
214
|
+
return { runId };
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
pause(agentId) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
yield this.rpcClient.serviceRpc(SERVICE, "PauseBackgroundComposer", { bcId: agentId, source: SOURCE }, RPC_TIMEOUT_MS);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
let backend;
|
|
224
|
+
/** The process-wide backend for this mount, built on first use. */
|
|
225
|
+
export function cloudAgentsBackend() {
|
|
226
|
+
backend !== null && backend !== void 0 ? backend : (backend = new CloudAgentsBackend(apiKey));
|
|
227
|
+
return backend;
|
|
228
|
+
}
|
|
229
|
+
export function apiKey() {
|
|
230
|
+
const key = resolveApiKeySync({ apiKey: extension.config.apiKey });
|
|
231
|
+
if (key === undefined) {
|
|
232
|
+
throw new Error(`Cloud agents need a Cursor API key. ${SIGN_IN_HINT}`);
|
|
233
|
+
}
|
|
234
|
+
return key.apiKey;
|
|
235
|
+
}
|
|
236
|
+
export function agentUrl(agentId) {
|
|
237
|
+
return `${cursorWebsiteUrl()}/agents/${agentId}`;
|
|
238
|
+
}
|
|
239
|
+
function statusOf(status) {
|
|
240
|
+
switch (status) {
|
|
241
|
+
case "BACKGROUND_COMPOSER_STATUS_CREATING":
|
|
242
|
+
return "creating";
|
|
243
|
+
case "BACKGROUND_COMPOSER_STATUS_RUNNING":
|
|
244
|
+
return "running";
|
|
245
|
+
case "BACKGROUND_COMPOSER_STATUS_FINISHED":
|
|
246
|
+
return "finished";
|
|
247
|
+
case "BACKGROUND_COMPOSER_STATUS_ERROR":
|
|
248
|
+
return "error";
|
|
249
|
+
case "BACKGROUND_COMPOSER_STATUS_EXPIRED":
|
|
250
|
+
return "expired";
|
|
251
|
+
default:
|
|
252
|
+
return "unknown";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function failureMessage(failure) {
|
|
256
|
+
var _a, _b;
|
|
257
|
+
const parts = [(_a = failure === null || failure === void 0 ? void 0 : failure.details) === null || _a === void 0 ? void 0 : _a.title, (_b = failure === null || failure === void 0 ? void 0 : failure.details) === null || _b === void 0 ? void 0 : _b.detail].filter((part) => part !== undefined && part !== "");
|
|
258
|
+
return parts.length === 0 ? undefined : parts.join(": ");
|
|
259
|
+
}
|
|
260
|
+
function parseArgs(args) {
|
|
261
|
+
if (args === undefined || args === "") {
|
|
262
|
+
return undefined;
|
|
263
|
+
}
|
|
264
|
+
try {
|
|
265
|
+
return JSON.parse(args);
|
|
266
|
+
}
|
|
267
|
+
catch (_a) {
|
|
268
|
+
return args;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function emptyToUndefined(value) {
|
|
272
|
+
return value === undefined || value === "" ? undefined : value;
|
|
273
|
+
}
|
|
274
|
+
function apiErrorMessage(text) {
|
|
275
|
+
var _a, _b;
|
|
276
|
+
var _c, _d;
|
|
277
|
+
try {
|
|
278
|
+
const parsed = JSON.parse(text);
|
|
279
|
+
const code = (_c = (_a = parsed.error) === null || _a === void 0 ? void 0 : _a.code) !== null && _c !== void 0 ? _c : parsed.code;
|
|
280
|
+
const message = (_d = (_b = parsed.error) === null || _b === void 0 ? void 0 : _b.message) !== null && _d !== void 0 ? _d : parsed.message;
|
|
281
|
+
return ([code, message].filter((part) => part !== undefined).join(": ") || text);
|
|
282
|
+
}
|
|
283
|
+
catch (_e) {
|
|
284
|
+
return text;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/lib/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC;IAAE,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAA;CAAE,CAE1D,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** A cloud agent's conversation as JSONL lines, one message per line. */
|
|
2
|
+
import type { CloudAgentMessage } from "./backend.js";
|
|
3
|
+
/** Workspace-relative path of a dumped transcript; the directory Sand uses too. */
|
|
4
|
+
export declare function transcriptPath(agentId: string): string;
|
|
5
|
+
export declare function transcriptLines(messages: CloudAgentMessage[]): string[];
|
|
6
|
+
/** The text of the last assistant message, the agent's report. */
|
|
7
|
+
export declare function lastAssistantText(messages: CloudAgentMessage[]): string | undefined;
|
|
8
|
+
//# sourceMappingURL=transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/lib/transcript.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAEvE;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,iBAAiB,EAAE,GAC5B,MAAM,GAAG,SAAS,CAMpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** A cloud agent's conversation as JSONL lines, one message per line. */
|
|
2
|
+
/** Workspace-relative path of a dumped transcript; the directory Sand uses too. */
|
|
3
|
+
export function transcriptPath(agentId) {
|
|
4
|
+
return `cloud-agent-transcripts/${agentId}.jsonl`;
|
|
5
|
+
}
|
|
6
|
+
export function transcriptLines(messages) {
|
|
7
|
+
return messages.map((message) => JSON.stringify(message));
|
|
8
|
+
}
|
|
9
|
+
/** The text of the last assistant message, the agent's report. */
|
|
10
|
+
export function lastAssistantText(messages) {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = messages
|
|
13
|
+
.toReversed()
|
|
14
|
+
.find((message) => message.role === "assistant" && message.text !== undefined)) === null || _a === void 0 ? void 0 : _a.text;
|
|
15
|
+
}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to
|
|
2
|
+
description: "Delegate coding work to Cursor cloud agents: when to hand off, how to write the prompt, and how to look an agent up by id, read what it did, reply, and cancel."
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
# Cloud agent handoff
|
|
6
6
|
|
|
7
7
|
Hand work to a Cursor cloud agent when it needs a repository checkout, a long run, or an isolated machine: implementing a change, running a test suite, opening a pull request. Answer questions and small reads yourself.
|
|
8
8
|
|
|
9
|
-
The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on.
|
|
9
|
+
The tools below are this extension's; they appear under its mount namespace, as `<namespace>__launch` and so on. Every agent is addressed by its `agent_id` (`bc-...`).
|
|
10
10
|
|
|
11
11
|
## Launch
|
|
12
12
|
|
|
13
|
-
Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `
|
|
13
|
+
Call `launch` with a self-contained prompt: the goal, the repository or pull request, constraints (branch, files to leave alone), and what done looks like (tests pass, PR opened). Pass `starting_ref` or `pr_url` to pick a branch or pull request; `repo` must be one of the configured repositories.
|
|
14
14
|
|
|
15
15
|
The result carries `agentId` (`bc-...`) and a `url`. Report both in full. Never truncate the id.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Look an agent up by id
|
|
18
18
|
|
|
19
|
-
Call `
|
|
19
|
+
Call `get` with the `agent_id`. It returns the agent's `status` (`creating`, `running`, `finished`, `error`, or `expired`), its `branch` and pull request `prUrl` once pushed, the `changes` it made so far (files and lines), a `summary` when one exists, and an `error` when it failed. A run takes minutes: check when asked or when you need the result, not in a tight loop. The final report itself comes from `dump`.
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Read what it did
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
To read the report or understand what was done, call `dump` with the `agent_id`. It writes the agent's whole conversation, every run, to `cloud-agent-transcripts/<agent_id>.jsonl` in your workspace and returns the absolute `path` plus the `finalMessage`. Each line is one JSON message with `role` (`user` or `assistant`) and, for assistant lines, `text`, `thinking`, and `toolCalls` (tool `name`, `args`, `content`, `error`). Read it with your file and shell tools, using the returned path:
|
|
24
|
+
|
|
25
|
+
- `tail -n 1 <path>` gives the final report.
|
|
26
|
+
- `grep '"toolCalls"' <path>` shows the commands and edits it made.
|
|
27
|
+
- `grep '"role":"user"' <path>` shows every prompt it received, including replies.
|
|
28
|
+
|
|
29
|
+
Use `dump` before summarizing an agent's work for a person, and to understand a failure before replying with a fix.
|
|
30
|
+
|
|
31
|
+
## Reply
|
|
32
|
+
|
|
33
|
+
Call `reply` with the `agent_id` and a prompt to steer an agent or ask for changes on its branch. The follow-up queues behind the current run and starts when it finishes; pass `interrupt: true` to stop the current step and deliver it now. Do not launch a second agent for follow-up work on the same branch.
|
|
34
|
+
|
|
35
|
+
## Cancel
|
|
36
|
+
|
|
37
|
+
Call `cancel` with the `agent_id` to stop the active run. The agent keeps its branch and conversation, so a `reply` can continue from where it stopped.
|
|
24
38
|
|
|
25
39
|
## Fleet
|
|
26
40
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/cancel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,QAAA,MAAM,MAAM,EAAE,cAUZ,CAAC;eAEY,MAAM"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { defineTool } from "../../../tools.js";
|
|
11
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
12
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
13
|
+
import { agentRef } from "../lib/inputs.js";
|
|
14
|
+
const cancel = defineTool({
|
|
15
|
+
description: "Stop a cloud agent's active run. The agent keeps its branch and conversation; reply to it to continue.",
|
|
16
|
+
effect: "write",
|
|
17
|
+
inputSchema: agentRef,
|
|
18
|
+
execute(input, ctx) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield assertOwned(ctx, input.agent_id);
|
|
21
|
+
yield cloudAgentsBackend().pause(input.agent_id);
|
|
22
|
+
return { agentId: input.agent_id, cancelled: true };
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export default cancel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dump.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/dump.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUxD,QAAA,MAAM,IAAI,EAAE,cAmCV,CAAC;eAEY,IAAI"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
import { defineTool } from "../../../tools.js";
|
|
13
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
14
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
15
|
+
import { agentRef } from "../lib/inputs.js";
|
|
16
|
+
import { lastAssistantText, transcriptLines, transcriptPath, } from "../lib/transcript.js";
|
|
17
|
+
const dump = defineTool({
|
|
18
|
+
description: "Write a cloud agent's full conversation to a JSONL file in your workspace so you can read what it did: one JSON message per line (prompts, assistant text, thinking, tool calls). Read the last line for the final report.",
|
|
19
|
+
effect: "read",
|
|
20
|
+
inputSchema: agentRef,
|
|
21
|
+
execute(input, ctx) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield assertOwned(ctx, input.agent_id);
|
|
24
|
+
const backend = cloudAgentsBackend();
|
|
25
|
+
const [messages, info] = yield Promise.all([
|
|
26
|
+
backend.conversation(input.agent_id),
|
|
27
|
+
backend.info(input.agent_id),
|
|
28
|
+
]);
|
|
29
|
+
if (messages.length === 0) {
|
|
30
|
+
return {
|
|
31
|
+
agentId: input.agent_id,
|
|
32
|
+
lineCount: 0,
|
|
33
|
+
status: info.status,
|
|
34
|
+
note: "The agent has not produced any transcript yet.",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Absolute: the harness's shell does not run in the workspace directory.
|
|
38
|
+
const path = join(ctx.workspaceDir, transcriptPath(input.agent_id));
|
|
39
|
+
const jsonl = `${transcriptLines(messages).join("\n")}\n`;
|
|
40
|
+
yield mkdir(dirname(path), { recursive: true });
|
|
41
|
+
yield writeFile(path, jsonl, "utf8");
|
|
42
|
+
return {
|
|
43
|
+
agentId: input.agent_id,
|
|
44
|
+
path,
|
|
45
|
+
sizeBytes: Buffer.byteLength(jsonl),
|
|
46
|
+
lineCount: messages.length,
|
|
47
|
+
status: info.status,
|
|
48
|
+
finalMessage: lastAssistantText(messages),
|
|
49
|
+
note: `One JSON message per line. Grep it, or read the final report with \`tail -n 1 ${path}\`.`,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
export default dump;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/get.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,QAAA,MAAM,GAAG,EAAE,cAST,CAAC;eAEY,GAAG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { defineTool } from "../../../tools.js";
|
|
11
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
12
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
13
|
+
import { agentRef } from "../lib/inputs.js";
|
|
14
|
+
const get = defineTool({
|
|
15
|
+
description: "Look up a cloud agent you launched by id: its status, branch, pull request, changed-file counts, summary, and any error. Use dump to read everything it did.",
|
|
16
|
+
effect: "read",
|
|
17
|
+
inputSchema: agentRef,
|
|
18
|
+
execute(input, ctx) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield assertOwned(ctx, input.agent_id);
|
|
21
|
+
return cloudAgentsBackend().info(input.agent_id);
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
export default get;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/launch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/launch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD,QAAA,MAAM,MAAM,EAAE,cAqDZ,CAAC;eAEY,MAAM"}
|
|
@@ -7,15 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Agent } from "@cursor/sdk";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
import { defineTool } from "../../../tools.js";
|
|
13
12
|
import extension from "../extension.js";
|
|
14
|
-
import {
|
|
13
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
15
14
|
import { recordLaunch } from "../lib/fleet.js";
|
|
16
15
|
import { launchRepos } from "../lib/repos.js";
|
|
17
16
|
const launch = defineTool({
|
|
18
|
-
description: "Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check
|
|
17
|
+
description: "Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check on it with get, read what it did with dump.",
|
|
19
18
|
effect: "write",
|
|
20
19
|
needsApproval: () => extension.config.needsApproval,
|
|
21
20
|
inputSchema: z.object({
|
|
@@ -28,8 +27,11 @@ const launch = defineTool({
|
|
|
28
27
|
.url()
|
|
29
28
|
.optional()
|
|
30
29
|
.describe("GitHub repository URL, one of the configured repositories. Defaults to the configured repository."),
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
starting_ref: z
|
|
31
|
+
.string()
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Branch or commit to start from; defaults to the configured or default branch."),
|
|
34
|
+
pr_url: z
|
|
33
35
|
.string()
|
|
34
36
|
.url()
|
|
35
37
|
.optional()
|
|
@@ -42,41 +44,15 @@ const launch = defineTool({
|
|
|
42
44
|
}),
|
|
43
45
|
execute(input, ctx) {
|
|
44
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const { cloud } = extension.config;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
apiKey: key,
|
|
49
|
-
model: modelSelection(),
|
|
47
|
+
const { cloud, model } = extension.config;
|
|
48
|
+
const launched = yield cloudAgentsBackend().launch({
|
|
49
|
+
prompt: input.prompt,
|
|
50
50
|
name: input.name,
|
|
51
|
-
|
|
51
|
+
model,
|
|
52
|
+
cloud: Object.assign(Object.assign({}, cloud), { repos: launchRepos({ repo: input.repo, ref: input.starting_ref, prUrl: input.pr_url }, cloud) }),
|
|
52
53
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
yield recordLaunch(ctx, agent.agentId, input.name);
|
|
56
|
-
return {
|
|
57
|
-
agentId: agent.agentId,
|
|
58
|
-
runId: run.id,
|
|
59
|
-
status: run.status,
|
|
60
|
-
url: agentUrl(agent.agentId),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
// The API can fail after the agent exists (slow admission,
|
|
65
|
-
// post-create checks). The SDK seeded the id unless envVars made
|
|
66
|
-
// the server mint it, so read the agent back and keep the handle;
|
|
67
|
-
// envVars launches have no id to read back and surface the error.
|
|
68
|
-
const info = cloud.envVars === undefined
|
|
69
|
-
? yield Agent.get(agent.agentId, { apiKey: key }).catch(() => undefined)
|
|
70
|
-
: undefined;
|
|
71
|
-
if (info === undefined) {
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
yield recordLaunch(ctx, info.agentId, input.name);
|
|
75
|
-
return Object.assign(Object.assign({}, agentView(info)), { launchError: error instanceof Error ? error.message : String(error) });
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
agent.close();
|
|
79
|
-
}
|
|
54
|
+
yield recordLaunch(ctx, launched.agentId, input.name);
|
|
55
|
+
return launched;
|
|
80
56
|
});
|
|
81
57
|
},
|
|
82
58
|
});
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { defineTool } from "../../../tools.js";
|
|
12
|
-
import { agentUrl } from "../lib/
|
|
12
|
+
import { agentUrl } from "../lib/backend.js";
|
|
13
13
|
import { listFleet } from "../lib/fleet.js";
|
|
14
14
|
const list = defineTool({
|
|
15
15
|
description: 'List the cloud agents launched in this session, newest first. Pass scope "all" for every agent you launched, in any session.',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../../../src/extensions/cursor-cloud-agents/tools/reply.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD,QAAA,MAAM,KAAK,EAAE,cAuBX,CAAC;eAEY,KAAK"}
|