@cursor/july 0.1.100 → 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/bin/agent-serve.js +3 -2
- package/dist/channels/deployments/deployments-channel.d.ts +41 -5
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +88 -8
- package/dist/channels/deployments/types.d.ts +4 -3
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +111 -0
- package/dist/channels/origin/index.d.ts +2 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +2 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +24 -3
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +23 -1
- package/dist/channels/origin/types.d.ts.map +1 -1
- 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 +5 -2
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +168 -0
- 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/index.d.ts +1 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +1 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +11 -4
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- package/dist/connections.d.ts +18 -2
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +18 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DZ1e0Ycq.js → app.CLA03RCz.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.FAqdWIXo.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.l8omwc6D.js → VPLocalSearchBox.ifxv-cJV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.JVcD6gel.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_connections.md.BiGoBAk2.js → reference_connections.md.Di6jJAXF.js} +12 -2
- package/dist/docs/assets/{reference_connections.md.BiGoBAk2.lean.js → reference_connections.md.Di6jJAXF.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_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
- 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 +353 -5
- 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 +16 -6
- package/dist/docs/reference/connections.md +31 -0
- 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 +6 -6
- package/dist/docs/reference/http-api.md +1 -1
- 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 +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- 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/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -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/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -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 +41 -0
- 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 +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- 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/reply.js +35 -0
- package/dist/extensions.d.ts +73 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +112 -0
- 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 +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/internal/advertise-tools.d.ts +4 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +20 -1
- package/dist/internal/as-of.d.ts +18 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +131 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +64 -19
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +3 -1
- 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-deployment-secrets.d.ts +16 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
- 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/cursor-deployment-relay.d.ts +15 -1
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +46 -7
- package/dist/internal/deploy-client.d.ts +23 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +54 -12
- 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 -2210
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +5 -0
- package/dist/internal/framework-file-storage.d.ts +3 -3
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +38 -9
- 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/hosted-delivery.d.ts +3 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +19 -32
- package/dist/internal/hosted-execution-diag.d.ts +5 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +5 -0
- package/dist/internal/hosted-execution-flush.d.ts +46 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +81 -0
- package/dist/internal/mcp-endpoint.js +1 -0
- package/dist/internal/mcp-host.d.ts +2 -1
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +66 -29
- 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/review-comments.d.ts +1 -1
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +4 -4
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +79 -104
- package/dist/internal/session-engine.d.ts +14 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +113 -66
- package/dist/internal/session-run-log.d.ts +3 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -14
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- 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/tool-policy.d.ts +8 -0
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +19 -7
- 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/assets/{index-DVs98vPL.js → index-ZqNoT8Ie.js} +45 -45
- package/dist/playground/index.html +2 -2
- package/dist/storage-protocol.d.ts +47 -22
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +90 -54
- 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 +154 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -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/connections.md +31 -0
- package/docs/reference/extensions.md +205 -0
- package/docs/reference/http-api.md +1 -1
- 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 +18 -4
- package/skills/framework-map/SKILL.md +1 -0
- package/src/bin/agent-serve.ts +11 -2
- package/src/channels/deployments/deployments-channel.ts +117 -8
- package/src/channels/deployments/types.ts +4 -3
- package/src/channels/origin/defaults.ts +143 -0
- package/src/channels/origin/index.ts +2 -0
- package/src/channels/origin/origin-channel.ts +37 -1
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +24 -0
- package/src/channels/slack/api.ts +6 -3
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/code-fences.ts +183 -0
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/index.ts +1 -0
- package/src/channels/slack/live-delivery.ts +16 -13
- package/src/channels/slack/manifest.ts +2 -1
- package/src/connections.ts +18 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +120 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- 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 +64 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +141 -0
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +43 -34
- package/src/index.ts +11 -0
- package/src/internal/advertise-tools.ts +37 -12
- package/src/internal/as-of.ts +163 -0
- package/src/internal/cli-deploy.ts +86 -23
- package/src/internal/continuation-identity.ts +3 -1
- package/src/internal/conversation-mirror.ts +23 -18
- package/src/internal/cursor/backend-client.ts +32 -10
- package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
- package/src/internal/cursor/hosted-store-secrets.ts +27 -0
- package/src/internal/cursor-deployment-relay.ts +65 -8
- package/src/internal/deploy-client.ts +73 -18
- 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 -2724
- package/src/internal/distribution.ts +5 -0
- package/src/internal/framework-file-storage.ts +43 -9
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/hosted-delivery.ts +38 -63
- package/src/internal/hosted-execution-diag.ts +6 -0
- package/src/internal/hosted-execution-flush.ts +142 -0
- package/src/internal/mcp-endpoint.ts +1 -0
- package/src/internal/mcp-host.ts +116 -37
- 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/review-comments.ts +5 -2
- package/src/internal/server.ts +81 -100
- package/src/internal/session-engine.ts +152 -39
- package/src/internal/session-run-log.ts +18 -16
- package/src/internal/start-log-store.ts +174 -0
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/tool-policy.ts +39 -9
- 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 +126 -79
- package/src/storage.ts +5 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +213 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.j70vvPL4.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/playground/assets/index-BszoQDc6.css +0 -1
- /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_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who launched which cloud agent. The tools authenticate with the serve
|
|
3
|
+
* host's one Cursor API key, so the host itself must keep every session's
|
|
4
|
+
* cloud agents bound to the principal that launched them: status and
|
|
5
|
+
* follow-ups only reach agents recorded here for the same principal, and
|
|
6
|
+
* the fleet listing is that principal's records, by default narrowed to the
|
|
7
|
+
* session that launched them.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import type { ToolContext } from "../../../types.js";
|
|
12
|
+
|
|
13
|
+
const PREFIX = "cloud-agents";
|
|
14
|
+
|
|
15
|
+
// Type alias, not an interface: fleet entries flow into tool results.
|
|
16
|
+
export type FleetEntry = {
|
|
17
|
+
agentId: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
launchedAt: string;
|
|
20
|
+
/** The session whose turn launched the agent; absent on records older than this field. */
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type FleetScope = "session" | "all";
|
|
25
|
+
|
|
26
|
+
const fleetSchema: z.ZodType<FleetEntry[]> = z.array(
|
|
27
|
+
z.object({
|
|
28
|
+
agentId: z.string(),
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
launchedAt: z.string(),
|
|
31
|
+
sessionId: z.string().optional(),
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
const ownerSchema = z.object({ principal: z.string() });
|
|
35
|
+
|
|
36
|
+
// `host.kv` has no compare-and-swap, and a model that launches two agents in
|
|
37
|
+
// one turn calls this tool in parallel. Chain the index read-modify-write per
|
|
38
|
+
// principal so neither launch overwrites the other's entry.
|
|
39
|
+
const indexWrites = new Map<string, Promise<void>>();
|
|
40
|
+
|
|
41
|
+
function withIndexLock(key: string, task: () => Promise<void>): Promise<void> {
|
|
42
|
+
const run = (indexWrites.get(key) ?? Promise.resolve()).then(task, task);
|
|
43
|
+
indexWrites.set(key, run);
|
|
44
|
+
return run.finally(() => {
|
|
45
|
+
if (indexWrites.get(key) === run) {
|
|
46
|
+
indexWrites.delete(key);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Unauthenticated sessions (local dev, direct calls) share one principal. */
|
|
52
|
+
export function principalOf(ctx: ToolContext): string {
|
|
53
|
+
const auth = ctx.session.auth;
|
|
54
|
+
return auth === null
|
|
55
|
+
? "anonymous"
|
|
56
|
+
: `${auth.principalType}:${auth.principalId}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function recordLaunch(
|
|
60
|
+
ctx: ToolContext,
|
|
61
|
+
agentId: string,
|
|
62
|
+
name: string | undefined
|
|
63
|
+
): Promise<void> {
|
|
64
|
+
const principal = principalOf(ctx);
|
|
65
|
+
const entry: FleetEntry = {
|
|
66
|
+
agentId,
|
|
67
|
+
name,
|
|
68
|
+
launchedAt: new Date().toISOString(),
|
|
69
|
+
sessionId: ctx.session.id,
|
|
70
|
+
};
|
|
71
|
+
await ctx.host.kv.put(`${PREFIX}/agents/${agentId}`, { principal });
|
|
72
|
+
await withIndexLock(fleetKey(principal), async () => {
|
|
73
|
+
const fleet = await listFleet(ctx);
|
|
74
|
+
await ctx.host.kv.put(fleetKey(principal), [entry, ...fleet]);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Refuse agents launched by another principal, or not through the extension. */
|
|
79
|
+
export async function assertOwned(
|
|
80
|
+
ctx: ToolContext,
|
|
81
|
+
agentId: string
|
|
82
|
+
): Promise<void> {
|
|
83
|
+
const owner = ownerSchema.safeParse(
|
|
84
|
+
await ctx.host.kv.get(`${PREFIX}/agents/${agentId}`)
|
|
85
|
+
);
|
|
86
|
+
if (!owner.success || owner.data.principal !== principalOf(ctx)) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Agent ${agentId} was not launched through this extension by this principal; only your own launches can be read or steered.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The caller's launches, newest first: this session's, or every session's. */
|
|
94
|
+
export async function listFleet(
|
|
95
|
+
ctx: ToolContext,
|
|
96
|
+
scope: FleetScope = "all"
|
|
97
|
+
): Promise<FleetEntry[]> {
|
|
98
|
+
const fleet = fleetSchema.safeParse(
|
|
99
|
+
await ctx.host.kv.get(fleetKey(principalOf(ctx)))
|
|
100
|
+
);
|
|
101
|
+
const entries = fleet.success ? fleet.data : [];
|
|
102
|
+
return scope === "all"
|
|
103
|
+
? entries
|
|
104
|
+
: entries.filter((entry) => entry.sessionId === ctx.session.id);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function fleetKey(principal: string): string {
|
|
108
|
+
return `${PREFIX}/principals/${encodeURIComponent(principal)}`;
|
|
109
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which repositories a launch may target. The model picks `repo` / `ref` /
|
|
3
|
+
* `prUrl` per call, but the author's `cloud.repos` are the allowlist.
|
|
4
|
+
* Model-chosen targets always require that allowlist: an unbound mount
|
|
5
|
+
* (no `cloud.repos`) must not accept an arbitrary URL under the host API
|
|
6
|
+
* key, with or without `envVars`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { parsePrUrl } from "../../../internal/scm/pr-url.js";
|
|
10
|
+
import type { AgentCloudOptions } from "../../../types.js";
|
|
11
|
+
|
|
12
|
+
export interface LaunchTarget {
|
|
13
|
+
repo?: string;
|
|
14
|
+
ref?: string;
|
|
15
|
+
prUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function launchRepos(
|
|
19
|
+
target: LaunchTarget,
|
|
20
|
+
cloud: AgentCloudOptions
|
|
21
|
+
): AgentCloudOptions["repos"] {
|
|
22
|
+
if (
|
|
23
|
+
target.repo === undefined &&
|
|
24
|
+
target.ref === undefined &&
|
|
25
|
+
target.prUrl === undefined
|
|
26
|
+
) {
|
|
27
|
+
return cloud.repos;
|
|
28
|
+
}
|
|
29
|
+
const pr = target.prUrl === undefined ? undefined : parsePrUrl(target.prUrl);
|
|
30
|
+
if (target.prUrl !== undefined && pr?.provider !== "github") {
|
|
31
|
+
throw new Error(`prUrl must be a GitHub pull request URL: ${target.prUrl}`);
|
|
32
|
+
}
|
|
33
|
+
const prRepo =
|
|
34
|
+
pr === undefined ? undefined : `https://github.com/${pr.owner}/${pr.repo}`;
|
|
35
|
+
// A lone `ref` needs exactly one configured repository to apply to.
|
|
36
|
+
const configured = cloud.repos ?? [];
|
|
37
|
+
const url =
|
|
38
|
+
target.repo ??
|
|
39
|
+
prRepo ??
|
|
40
|
+
(configured.length === 1 ? configured[0]?.url : undefined);
|
|
41
|
+
if (url === undefined) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
configured.length > 1
|
|
44
|
+
? "`repo` is required: this extension configures several repositories."
|
|
45
|
+
: "`repo` is required: this extension has no configured default repository."
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
if (prRepo !== undefined && repoKey(prRepo) !== repoKey(url)) {
|
|
49
|
+
throw new Error(`prUrl ${target.prUrl} is not a pull request of ${url}.`);
|
|
50
|
+
}
|
|
51
|
+
const allowlisted = cloud.repos?.some(
|
|
52
|
+
(configured) => repoKey(configured.url) === repoKey(url)
|
|
53
|
+
);
|
|
54
|
+
if (allowlisted !== true) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
cloud.repos === undefined
|
|
57
|
+
? `Configure cloud.repos before launching against a model-chosen repository (${url}).`
|
|
58
|
+
: `${url} is not one of this extension's configured repositories.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
// Keep the matching allowlist entry's branch / PR defaults when the model
|
|
62
|
+
// only names the repository (handoff always passes `repo`). An explicit
|
|
63
|
+
// `ref` clears an inherited `prUrl` so branch and PR targets do not mix.
|
|
64
|
+
const match = configured.find(
|
|
65
|
+
(configuredRepo) => repoKey(configuredRepo.url) === repoKey(url)
|
|
66
|
+
);
|
|
67
|
+
return [
|
|
68
|
+
{
|
|
69
|
+
url,
|
|
70
|
+
startingRef: target.ref ?? match?.startingRef,
|
|
71
|
+
prUrl:
|
|
72
|
+
target.prUrl ?? (target.ref !== undefined ? undefined : match?.prUrl),
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function repoKey(url: string): string {
|
|
78
|
+
const parsed = new URL(url);
|
|
79
|
+
const path = parsed.pathname.replace(/\.git$/, "").replace(/\/+$/, "");
|
|
80
|
+
return `${parsed.hostname}${path}`.toLowerCase();
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** A cloud agent's conversation as JSONL lines, one message per line. */
|
|
2
|
+
|
|
3
|
+
import type { CloudAgentMessage } from "./backend.js";
|
|
4
|
+
|
|
5
|
+
/** Workspace-relative path of a dumped transcript; the directory Sand uses too. */
|
|
6
|
+
export function transcriptPath(agentId: string): string {
|
|
7
|
+
return `cloud-agent-transcripts/${agentId}.jsonl`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function transcriptLines(messages: CloudAgentMessage[]): string[] {
|
|
11
|
+
return messages.map((message) => JSON.stringify(message));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** The text of the last assistant message, the agent's report. */
|
|
15
|
+
export function lastAssistantText(
|
|
16
|
+
messages: CloudAgentMessage[]
|
|
17
|
+
): string | undefined {
|
|
18
|
+
return messages
|
|
19
|
+
.toReversed()
|
|
20
|
+
.find(
|
|
21
|
+
(message) => message.role === "assistant" && message.text !== undefined
|
|
22
|
+
)?.text;
|
|
23
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
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
|
+
---
|
|
4
|
+
|
|
5
|
+
# Cloud agent handoff
|
|
6
|
+
|
|
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
|
+
|
|
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
|
+
|
|
11
|
+
## Launch
|
|
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 `starting_ref` or `pr_url` to pick a branch or pull request; `repo` must be one of the configured repositories.
|
|
14
|
+
|
|
15
|
+
The result carries `agentId` (`bc-...`) and a `url`. Report both in full. Never truncate the id.
|
|
16
|
+
|
|
17
|
+
## Look an agent up by id
|
|
18
|
+
|
|
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
|
+
|
|
21
|
+
## Read what it did
|
|
22
|
+
|
|
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.
|
|
38
|
+
|
|
39
|
+
## Fleet
|
|
40
|
+
|
|
41
|
+
`list` returns the agents launched in this session, newest first; pass `scope: "all"` to include your launches from other sessions. Launch one agent per independent task and give each a descriptive `name`. Agents launched by others are out of reach.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineTool } from "../../../tools.js";
|
|
2
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
3
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
4
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
5
|
+
import { agentRef } from "../lib/inputs.js";
|
|
6
|
+
|
|
7
|
+
const cancel: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"Stop a cloud agent's active run. The agent keeps its branch and conversation; reply to it to continue.",
|
|
10
|
+
effect: "write",
|
|
11
|
+
inputSchema: agentRef,
|
|
12
|
+
async execute(input, ctx) {
|
|
13
|
+
await assertOwned(ctx, input.agent_id);
|
|
14
|
+
await cloudAgentsBackend().pause(input.agent_id);
|
|
15
|
+
return { agentId: input.agent_id, cancelled: true };
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export default cancel;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { defineTool } from "../../../tools.js";
|
|
4
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
7
|
+
import { agentRef } from "../lib/inputs.js";
|
|
8
|
+
import {
|
|
9
|
+
lastAssistantText,
|
|
10
|
+
transcriptLines,
|
|
11
|
+
transcriptPath,
|
|
12
|
+
} from "../lib/transcript.js";
|
|
13
|
+
|
|
14
|
+
const dump: ToolDefinition = defineTool({
|
|
15
|
+
description:
|
|
16
|
+
"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.",
|
|
17
|
+
effect: "read",
|
|
18
|
+
inputSchema: agentRef,
|
|
19
|
+
async execute(input, ctx) {
|
|
20
|
+
await assertOwned(ctx, input.agent_id);
|
|
21
|
+
const backend = cloudAgentsBackend();
|
|
22
|
+
const [messages, info] = await Promise.all([
|
|
23
|
+
backend.conversation(input.agent_id),
|
|
24
|
+
backend.info(input.agent_id),
|
|
25
|
+
]);
|
|
26
|
+
if (messages.length === 0) {
|
|
27
|
+
return {
|
|
28
|
+
agentId: input.agent_id,
|
|
29
|
+
lineCount: 0,
|
|
30
|
+
status: info.status,
|
|
31
|
+
note: "The agent has not produced any transcript yet.",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Absolute: the harness's shell does not run in the workspace directory.
|
|
35
|
+
const path = join(ctx.workspaceDir, transcriptPath(input.agent_id));
|
|
36
|
+
const jsonl = `${transcriptLines(messages).join("\n")}\n`;
|
|
37
|
+
await mkdir(dirname(path), { recursive: true });
|
|
38
|
+
await writeFile(path, jsonl, "utf8");
|
|
39
|
+
return {
|
|
40
|
+
agentId: input.agent_id,
|
|
41
|
+
path,
|
|
42
|
+
sizeBytes: Buffer.byteLength(jsonl),
|
|
43
|
+
lineCount: messages.length,
|
|
44
|
+
status: info.status,
|
|
45
|
+
finalMessage: lastAssistantText(messages),
|
|
46
|
+
note: `One JSON message per line. Grep it, or read the final report with \`tail -n 1 ${path}\`.`,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export default dump;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineTool } from "../../../tools.js";
|
|
2
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
3
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
4
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
5
|
+
import { agentRef } from "../lib/inputs.js";
|
|
6
|
+
|
|
7
|
+
const get: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
"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.",
|
|
10
|
+
effect: "read",
|
|
11
|
+
inputSchema: agentRef,
|
|
12
|
+
async execute(input, ctx) {
|
|
13
|
+
await assertOwned(ctx, input.agent_id);
|
|
14
|
+
return cloudAgentsBackend().info(input.agent_id);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default get;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import extension from "../extension.js";
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { recordLaunch } from "../lib/fleet.js";
|
|
7
|
+
import { launchRepos } from "../lib/repos.js";
|
|
8
|
+
|
|
9
|
+
const launch: ToolDefinition = defineTool({
|
|
10
|
+
description:
|
|
11
|
+
"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.",
|
|
12
|
+
effect: "write",
|
|
13
|
+
needsApproval: () => extension.config.needsApproval,
|
|
14
|
+
inputSchema: z.object({
|
|
15
|
+
prompt: z
|
|
16
|
+
.string()
|
|
17
|
+
.min(1)
|
|
18
|
+
.describe(
|
|
19
|
+
"Self-contained task: goal, constraints, and what done looks like."
|
|
20
|
+
),
|
|
21
|
+
repo: z
|
|
22
|
+
.string()
|
|
23
|
+
.url()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe(
|
|
26
|
+
"GitHub repository URL, one of the configured repositories. Defaults to the configured repository."
|
|
27
|
+
),
|
|
28
|
+
starting_ref: z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe(
|
|
32
|
+
"Branch or commit to start from; defaults to the configured or default branch."
|
|
33
|
+
),
|
|
34
|
+
pr_url: z
|
|
35
|
+
.string()
|
|
36
|
+
.url()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Work on this pull request's branch instead of a new one."),
|
|
39
|
+
name: z
|
|
40
|
+
.string()
|
|
41
|
+
.max(100)
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Display name; derived from the prompt when omitted."),
|
|
44
|
+
}),
|
|
45
|
+
async execute(input, ctx) {
|
|
46
|
+
const { cloud, model } = extension.config;
|
|
47
|
+
const launched = await cloudAgentsBackend().launch({
|
|
48
|
+
prompt: input.prompt,
|
|
49
|
+
name: input.name,
|
|
50
|
+
model,
|
|
51
|
+
cloud: {
|
|
52
|
+
...cloud,
|
|
53
|
+
repos: launchRepos(
|
|
54
|
+
{ repo: input.repo, ref: input.starting_ref, prUrl: input.pr_url },
|
|
55
|
+
cloud
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
await recordLaunch(ctx, launched.agentId, input.name);
|
|
60
|
+
return launched;
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export default launch;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import { agentUrl } from "../lib/backend.js";
|
|
5
|
+
import { listFleet } from "../lib/fleet.js";
|
|
6
|
+
|
|
7
|
+
const list: ToolDefinition = defineTool({
|
|
8
|
+
description:
|
|
9
|
+
'List the cloud agents launched in this session, newest first. Pass scope "all" for every agent you launched, in any session.',
|
|
10
|
+
effect: "read",
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
scope: z
|
|
13
|
+
.enum(["session", "all"])
|
|
14
|
+
.default("session")
|
|
15
|
+
.describe(
|
|
16
|
+
"session: agents this session launched; all: every agent launched by you, in any session."
|
|
17
|
+
),
|
|
18
|
+
limit: z.number().int().min(1).max(100).default(20),
|
|
19
|
+
}),
|
|
20
|
+
async execute(input, ctx) {
|
|
21
|
+
const fleet = await listFleet(ctx, input.scope);
|
|
22
|
+
return {
|
|
23
|
+
sessionId: ctx.session.id,
|
|
24
|
+
agents: fleet
|
|
25
|
+
.slice(0, input.limit)
|
|
26
|
+
.map((entry) => ({ ...entry, url: agentUrl(entry.agentId) })),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default list;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineTool } from "../../../tools.js";
|
|
3
|
+
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
+
import extension from "../extension.js";
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
6
|
+
import { assertOwned } from "../lib/fleet.js";
|
|
7
|
+
import { agentRef } from "../lib/inputs.js";
|
|
8
|
+
|
|
9
|
+
const reply: ToolDefinition = defineTool({
|
|
10
|
+
description:
|
|
11
|
+
"Send a follow-up prompt to a cloud agent you launched. It queues behind the current run; pass interrupt to stop that run's current step and deliver it now.",
|
|
12
|
+
effect: "write",
|
|
13
|
+
needsApproval: () => extension.config.needsApproval,
|
|
14
|
+
inputSchema: agentRef.extend({
|
|
15
|
+
prompt: z.string().min(1).describe("The follow-up instruction."),
|
|
16
|
+
interrupt: z
|
|
17
|
+
.boolean()
|
|
18
|
+
.default(false)
|
|
19
|
+
.describe(
|
|
20
|
+
"Deliver now, cancelling the in-flight step, instead of waiting for the current run to finish."
|
|
21
|
+
),
|
|
22
|
+
}),
|
|
23
|
+
async execute(input, ctx) {
|
|
24
|
+
await assertOwned(ctx, input.agent_id);
|
|
25
|
+
const { runId } = await cloudAgentsBackend().followUp(
|
|
26
|
+
input.agent_id,
|
|
27
|
+
input.prompt,
|
|
28
|
+
input.interrupt
|
|
29
|
+
);
|
|
30
|
+
return { agentId: input.agent_id, runId, queued: !input.interrupt };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export default reply;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extensions — agent-shaped trees an agent mounts under a namespace.
|
|
3
|
+
*
|
|
4
|
+
* An extension is a directory laid out like `agent/`: `extension.ts`
|
|
5
|
+
* declares it, `tools/<name>.ts` and `skills/<name>.md|ts` are its
|
|
6
|
+
* contributions, `lib/` holds shared code.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* // extension.ts
|
|
10
|
+
* import { defineExtension } from "@cursor/july/extensions";
|
|
11
|
+
* import { z } from "zod";
|
|
12
|
+
*
|
|
13
|
+
* export default defineExtension({
|
|
14
|
+
* root: import.meta.dirname,
|
|
15
|
+
* description: "Investigate failing CI builds.",
|
|
16
|
+
* config: z.object({ org: z.string(), token: z.string() }),
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // tools/failed_jobs.ts
|
|
20
|
+
* import extension from "../extension.js";
|
|
21
|
+
*
|
|
22
|
+
* export default defineTool({
|
|
23
|
+
* description: "List the failed jobs of a build.",
|
|
24
|
+
* execute: (input) => failedJobs(extension.config, input),
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* A consumer mounts it from `agent/extensions/<ns>.ts`; the filename is the
|
|
29
|
+
* namespace, and every contribution is exposed as `<ns>__<name>`
|
|
30
|
+
* (`ci__failed_jobs`). `__` is reserved for that: an authored `agent/tools/`
|
|
31
|
+
* or `agent/skills/` name may not contain it.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* // agent/extensions/ci.ts
|
|
35
|
+
* import ci from "@acme/ci-triage";
|
|
36
|
+
*
|
|
37
|
+
* export default ci({ org: "acme", token: process.env.BUILDKITE_TOKEN! });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* To adjust a contribution, mount as a directory instead and overlay the
|
|
41
|
+
* slot: `agent/extensions/ci/extension.ts` holds the mount, and
|
|
42
|
+
* `agent/extensions/ci/tools/job_log.ts` replaces `ci__job_log` — or removes
|
|
43
|
+
* it with `export default disableTool()`.
|
|
44
|
+
*
|
|
45
|
+
* A Cursor plugin (the marketplace format: `.cursor-plugin/plugin.json`,
|
|
46
|
+
* `skills/`, `commands/`, `agents/`, `mcp.json`) mounts the same way with
|
|
47
|
+
* `cursorPlugin`. Its skills and commands become `<ns>__<name>` skills, its
|
|
48
|
+
* agents `<ns>__<name>` subagents, and its MCP servers `<ns>__<server>`
|
|
49
|
+
* connections. Rules and hooks are not mounted yet.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* // agent/extensions/notion.ts
|
|
53
|
+
* import { cursorPlugin } from "@cursor/july/extensions";
|
|
54
|
+
*
|
|
55
|
+
* export default cursorPlugin({
|
|
56
|
+
* path: "plugins/notion-workspace",
|
|
57
|
+
* variables: { NOTION_TOKEN: process.env.NOTION_TOKEN! },
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* A directory mount overlays its MCP servers too:
|
|
62
|
+
* `agent/extensions/notion/mcp-connections/notion.ts` replaces
|
|
63
|
+
* `notion__notion` with your own `defineConnection` (headers, `oauth`,
|
|
64
|
+
* `advertiseTools`), and `export default disableConnection()` drops a server
|
|
65
|
+
* the agent should not carry.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
import { brandDefinition } from "./internal/brand.js";
|
|
69
|
+
import type {
|
|
70
|
+
CursorPluginOptions,
|
|
71
|
+
DisabledConnectionDefinition,
|
|
72
|
+
DisabledToolDefinition,
|
|
73
|
+
Extension,
|
|
74
|
+
ExtensionMount,
|
|
75
|
+
ExtensionOptions,
|
|
76
|
+
} from "./types.js";
|
|
77
|
+
|
|
78
|
+
export type {
|
|
79
|
+
CursorPluginDeclaration,
|
|
80
|
+
CursorPluginOptions,
|
|
81
|
+
DisabledConnectionDefinition,
|
|
82
|
+
DisabledToolDefinition,
|
|
83
|
+
DiscoveredExtension,
|
|
84
|
+
Extension,
|
|
85
|
+
ExtensionDeclaration,
|
|
86
|
+
ExtensionMount,
|
|
87
|
+
ExtensionOptions,
|
|
88
|
+
} from "./types.js";
|
|
89
|
+
|
|
90
|
+
export function defineExtension<TConfig = undefined, TInput = TConfig>(
|
|
91
|
+
options: ExtensionOptions<TConfig, TInput>
|
|
92
|
+
): Extension<TConfig, TInput> {
|
|
93
|
+
let mounted: { config: TConfig } | undefined;
|
|
94
|
+
const mount = (config?: TInput): ExtensionMount => {
|
|
95
|
+
const parsed =
|
|
96
|
+
options.config === undefined
|
|
97
|
+
? (config as unknown as TConfig)
|
|
98
|
+
: options.config.parse(config);
|
|
99
|
+
mounted = { config: parsed };
|
|
100
|
+
return brandDefinition("extension", {
|
|
101
|
+
extension: handle,
|
|
102
|
+
config: parsed,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
const handle = Object.defineProperties(mount, {
|
|
106
|
+
root: { value: options.root, enumerable: true },
|
|
107
|
+
description: { value: options.description, enumerable: true },
|
|
108
|
+
config: {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get(): TConfig {
|
|
111
|
+
if (mounted === undefined) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`Extension at ${options.root} read its config before an agent mounted it. Mount it from agent/extensions/<ns>.ts; the mount runs before the tree loads.`
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return mounted.config;
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
}) as unknown as Extension<TConfig, TInput>;
|
|
120
|
+
return handle;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function disableTool(): DisabledToolDefinition {
|
|
124
|
+
return brandDefinition("disabled-tool", {});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function disableConnection(): DisabledConnectionDefinition {
|
|
128
|
+
return brandDefinition("disabled-connection", {});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function cursorPlugin(options: CursorPluginOptions): ExtensionMount {
|
|
132
|
+
return brandDefinition("extension", {
|
|
133
|
+
extension: {
|
|
134
|
+
root: options.path,
|
|
135
|
+
description: undefined,
|
|
136
|
+
layout: "cursor-plugin",
|
|
137
|
+
variables: options.variables ?? {},
|
|
138
|
+
},
|
|
139
|
+
config: undefined,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
@@ -51,10 +51,7 @@ import {
|
|
|
51
51
|
type FileSinkEntry,
|
|
52
52
|
type FileSinkPutResult,
|
|
53
53
|
} from "../files.js";
|
|
54
|
-
import {
|
|
55
|
-
resolveDeploymentStoreSourceIdSync,
|
|
56
|
-
resolveFrameworkStoreSourceIdSync,
|
|
57
|
-
} from "../internal/cursor/hosted-store-secrets.js";
|
|
54
|
+
import { resolveDeploymentStoreSourceIdSync } from "../internal/cursor/hosted-store-secrets.js";
|
|
58
55
|
import { createAgentStorePresignedUrlValidatorForBackend } from "./agent-store-presigned-url.js";
|
|
59
56
|
|
|
60
57
|
/**
|
|
@@ -118,19 +115,6 @@ export function isCursorHostedFilesAvailable(
|
|
|
118
115
|
return resolveDeploymentStoreSourceIdSync(env) !== undefined;
|
|
119
116
|
}
|
|
120
117
|
|
|
121
|
-
/**
|
|
122
|
-
* The framework-level store's source id, or `undefined` when the deployment
|
|
123
|
-
* has none (v1, self-hosted, or a v2 deploy predating framework-store
|
|
124
|
-
* provisioning). Same detection posture as
|
|
125
|
-
* {@link isCursorHostedFilesAvailable}: keyed on the id alone — a missing
|
|
126
|
-
* credential must fail loudly at use, not silently deselect the store.
|
|
127
|
-
*/
|
|
128
|
-
export function cursorFrameworkStoreSourceId(
|
|
129
|
-
env: NodeJS.ProcessEnv = process.env
|
|
130
|
-
): string | undefined {
|
|
131
|
-
return resolveFrameworkStoreSourceIdSync(env);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
118
|
/**
|
|
135
119
|
* Local `serve`/`run` with a personal `CURSOR_API_KEY` can address
|
|
136
120
|
* `/v0/agent-serve-files/user`. Hosted deployments have a store source id
|