@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,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;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Agent } from "@cursor/sdk";
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
import { defineTool } from "../../../tools.js";
|
|
4
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
5
4
|
import extension from "../extension.js";
|
|
6
|
-
import {
|
|
5
|
+
import { cloudAgentsBackend } from "../lib/backend.js";
|
|
7
6
|
import { recordLaunch } from "../lib/fleet.js";
|
|
8
7
|
import { launchRepos } from "../lib/repos.js";
|
|
9
8
|
|
|
10
9
|
const launch: ToolDefinition = defineTool({
|
|
11
10
|
description:
|
|
12
|
-
"Launch a Cursor cloud agent on a repository with a self-contained task. Returns the agent id and URL; check
|
|
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.",
|
|
13
12
|
effect: "write",
|
|
14
13
|
needsApproval: () => extension.config.needsApproval,
|
|
15
14
|
inputSchema: z.object({
|
|
@@ -26,8 +25,13 @@ const launch: ToolDefinition = defineTool({
|
|
|
26
25
|
.describe(
|
|
27
26
|
"GitHub repository URL, one of the configured repositories. Defaults to the configured repository."
|
|
28
27
|
),
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
31
35
|
.string()
|
|
32
36
|
.url()
|
|
33
37
|
.optional()
|
|
@@ -39,45 +43,21 @@ const launch: ToolDefinition = defineTool({
|
|
|
39
43
|
.describe("Display name; derived from the prompt when omitted."),
|
|
40
44
|
}),
|
|
41
45
|
async execute(input, ctx) {
|
|
42
|
-
const { cloud } = extension.config;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
apiKey: key,
|
|
46
|
-
model: modelSelection(),
|
|
46
|
+
const { cloud, model } = extension.config;
|
|
47
|
+
const launched = await cloudAgentsBackend().launch({
|
|
48
|
+
prompt: input.prompt,
|
|
47
49
|
name: input.name,
|
|
48
|
-
|
|
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
|
+
},
|
|
49
58
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
await recordLaunch(ctx, agent.agentId, input.name);
|
|
53
|
-
return {
|
|
54
|
-
agentId: agent.agentId,
|
|
55
|
-
runId: run.id,
|
|
56
|
-
status: run.status,
|
|
57
|
-
url: agentUrl(agent.agentId),
|
|
58
|
-
};
|
|
59
|
-
} catch (error) {
|
|
60
|
-
// The API can fail after the agent exists (slow admission,
|
|
61
|
-
// post-create checks). The SDK seeded the id unless envVars made
|
|
62
|
-
// the server mint it, so read the agent back and keep the handle;
|
|
63
|
-
// envVars launches have no id to read back and surface the error.
|
|
64
|
-
const info =
|
|
65
|
-
cloud.envVars === undefined
|
|
66
|
-
? await Agent.get(agent.agentId, { apiKey: key }).catch(
|
|
67
|
-
() => undefined
|
|
68
|
-
)
|
|
69
|
-
: undefined;
|
|
70
|
-
if (info === undefined) {
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
await recordLaunch(ctx, info.agentId, input.name);
|
|
74
|
-
return {
|
|
75
|
-
...agentView(info),
|
|
76
|
-
launchError: error instanceof Error ? error.message : String(error),
|
|
77
|
-
};
|
|
78
|
-
} finally {
|
|
79
|
-
agent.close();
|
|
80
|
-
}
|
|
59
|
+
await recordLaunch(ctx, launched.agentId, input.name);
|
|
60
|
+
return launched;
|
|
81
61
|
},
|
|
82
62
|
});
|
|
83
63
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { defineTool } from "../../../tools.js";
|
|
3
3
|
import type { ToolDefinition } from "../../../types.js";
|
|
4
|
-
import { agentUrl } from "../lib/
|
|
4
|
+
import { agentUrl } from "../lib/backend.js";
|
|
5
5
|
import { listFleet } from "../lib/fleet.js";
|
|
6
6
|
|
|
7
7
|
const list: ToolDefinition = defineTool({
|
|
@@ -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;
|
package/src/extensions.ts
CHANGED
|
@@ -12,39 +12,63 @@
|
|
|
12
12
|
*
|
|
13
13
|
* export default defineExtension({
|
|
14
14
|
* root: import.meta.dirname,
|
|
15
|
-
* description: "
|
|
16
|
-
* config: z.object({
|
|
15
|
+
* description: "Investigate failing CI builds.",
|
|
16
|
+
* config: z.object({ org: z.string(), token: z.string() }),
|
|
17
17
|
* });
|
|
18
18
|
*
|
|
19
|
-
* // tools/
|
|
19
|
+
* // tools/failed_jobs.ts
|
|
20
20
|
* import extension from "../extension.js";
|
|
21
21
|
*
|
|
22
22
|
* export default defineTool({
|
|
23
|
-
* description: "
|
|
24
|
-
* execute: (input) =>
|
|
23
|
+
* description: "List the failed jobs of a build.",
|
|
24
|
+
* execute: (input) => failedJobs(extension.config, input),
|
|
25
25
|
* });
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
28
|
* A consumer mounts it from `agent/extensions/<ns>.ts`; the filename is the
|
|
29
29
|
* namespace, and every contribution is exposed as `<ns>__<name>`
|
|
30
|
-
* (`
|
|
31
|
-
* `agent/skills/` name may not contain it.
|
|
30
|
+
* (`ci__failed_jobs`). `__` is reserved for that: an authored `agent/tools/`
|
|
31
|
+
* or `agent/skills/` name may not contain it.
|
|
32
32
|
*
|
|
33
33
|
* ```ts
|
|
34
|
-
* // agent/extensions/
|
|
35
|
-
* import
|
|
34
|
+
* // agent/extensions/ci.ts
|
|
35
|
+
* import ci from "@acme/ci-triage";
|
|
36
36
|
*
|
|
37
|
-
* export default
|
|
37
|
+
* export default ci({ org: "acme", token: process.env.BUILDKITE_TOKEN! });
|
|
38
38
|
* ```
|
|
39
39
|
*
|
|
40
40
|
* To adjust a contribution, mount as a directory instead and overlay the
|
|
41
|
-
* slot: `agent/extensions/
|
|
42
|
-
* `agent/extensions/
|
|
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
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.
|
|
44
66
|
*/
|
|
45
67
|
|
|
46
68
|
import { brandDefinition } from "./internal/brand.js";
|
|
47
69
|
import type {
|
|
70
|
+
CursorPluginOptions,
|
|
71
|
+
DisabledConnectionDefinition,
|
|
48
72
|
DisabledToolDefinition,
|
|
49
73
|
Extension,
|
|
50
74
|
ExtensionMount,
|
|
@@ -52,6 +76,9 @@ import type {
|
|
|
52
76
|
} from "./types.js";
|
|
53
77
|
|
|
54
78
|
export type {
|
|
79
|
+
CursorPluginDeclaration,
|
|
80
|
+
CursorPluginOptions,
|
|
81
|
+
DisabledConnectionDefinition,
|
|
55
82
|
DisabledToolDefinition,
|
|
56
83
|
DiscoveredExtension,
|
|
57
84
|
Extension,
|
|
@@ -96,3 +123,19 @@ export function defineExtension<TConfig = undefined, TInput = TConfig>(
|
|
|
96
123
|
export function disableTool(): DisabledToolDefinition {
|
|
97
124
|
return brandDefinition("disabled-tool", {});
|
|
98
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
|
package/src/files.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* know the write did not land.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import { STORAGE_KEY_ROOT } from "./storage.js";
|
|
26
|
+
import { AGENTSDK_STORAGE_KEY_ROOT, STORAGE_KEY_ROOT } from "./storage.js";
|
|
27
27
|
|
|
28
28
|
// ============================================================================
|
|
29
29
|
// Sink interface
|
|
@@ -163,39 +163,48 @@ export const AGENT_SERVE_USER_STORE_KEY_PREFIX = "agent-serve";
|
|
|
163
163
|
* `--agent-store-skills-dir` walk finds them the same way it finds user-store
|
|
164
164
|
* skills. Memory and artifacts stay under {@link STORAGE_KEY_ROOT}.
|
|
165
165
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
166
|
+
function createAgentStoreKeys(root: string) {
|
|
167
|
+
return {
|
|
168
|
+
artifactRow: (agent: string, id: string): string =>
|
|
169
|
+
`${root}/${agent}/artifacts/rows/${encodeURIComponent(id)}.json`,
|
|
170
|
+
artifactRowPrefix: (agent: string): string =>
|
|
171
|
+
`${root}/${agent}/artifacts/rows/`,
|
|
172
|
+
artifactContent: (agent: string, id: string): string =>
|
|
173
|
+
`${root}/${agent}/artifacts/content/${encodeURIComponent(id)}`,
|
|
174
|
+
skillFile: (
|
|
175
|
+
skillName: string,
|
|
176
|
+
relPath: string,
|
|
177
|
+
skillsPrefix: string = "skills/"
|
|
178
|
+
): string => `${skillsPrefix}${skillName}/${relPath}`,
|
|
179
|
+
skillsPrefix: (): string => "skills/",
|
|
180
|
+
/** Personal-key cloud agents: namespaced so they cannot collide with the user's own `skills/`. */
|
|
181
|
+
userSkillsPrefix: (agent: string): string =>
|
|
182
|
+
`${AGENT_SERVE_USER_STORE_KEY_PREFIX}/${agent}/skills/`,
|
|
183
|
+
memoryDir: (agent: string): string => `${root}/${agent}/memory`,
|
|
184
|
+
memoryJournal: (agent: string): string =>
|
|
185
|
+
`${root}/${agent}/memory/journal.jsonl`,
|
|
186
|
+
memoryJournalRotated: (agent: string, stamp: string): string =>
|
|
187
|
+
`${root}/${agent}/memory/journal-${stamp}.jsonl`,
|
|
188
|
+
// SDK conversation mirror (the runner's SQLite store, exported through the
|
|
189
|
+
// store APIs): one manifest per SDK agent id plus its content-addressed
|
|
190
|
+
// checkpoint blobs. See internal/conversation-mirror.ts.
|
|
191
|
+
conversationManifest: (agent: string, sdkAgentId: string): string =>
|
|
192
|
+
`${root}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/manifest.json`,
|
|
193
|
+
conversationBlob: (
|
|
194
|
+
agent: string,
|
|
195
|
+
sdkAgentId: string,
|
|
196
|
+
blobId: string
|
|
197
|
+
): string =>
|
|
198
|
+
`${root}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/blobs/${encodeURIComponent(blobId)}`,
|
|
199
|
+
} as const;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type AgentStoreKeys = ReturnType<typeof createAgentStoreKeys>;
|
|
203
|
+
export const agentStoreKeys: AgentStoreKeys =
|
|
204
|
+
createAgentStoreKeys(STORAGE_KEY_ROOT);
|
|
205
|
+
export const agentSdkAgentStoreKeys: AgentStoreKeys = createAgentStoreKeys(
|
|
206
|
+
AGENTSDK_STORAGE_KEY_ROOT
|
|
207
|
+
);
|
|
199
208
|
|
|
200
209
|
/**
|
|
201
210
|
* Deployment store FUSE mount on cloud-runtime VMs. Mirrors
|
package/src/index.ts
CHANGED
|
@@ -78,7 +78,12 @@ export {
|
|
|
78
78
|
stampMailboxContinuation,
|
|
79
79
|
V2EngineError,
|
|
80
80
|
} from "./continuation.js";
|
|
81
|
-
export {
|
|
81
|
+
export {
|
|
82
|
+
cursorPlugin,
|
|
83
|
+
defineExtension,
|
|
84
|
+
disableConnection,
|
|
85
|
+
disableTool,
|
|
86
|
+
} from "./extensions.js";
|
|
82
87
|
export { defineHook } from "./hooks.js";
|
|
83
88
|
export {
|
|
84
89
|
InvalidAsOfError,
|
|
@@ -167,15 +172,19 @@ export type {
|
|
|
167
172
|
StorageDefinition,
|
|
168
173
|
StorageEntry,
|
|
169
174
|
StorageEvalsTable,
|
|
175
|
+
StorageKeys,
|
|
170
176
|
StoragePolicy,
|
|
171
177
|
StorageRestorePolicy,
|
|
172
178
|
} from "./storage.js";
|
|
173
179
|
export {
|
|
180
|
+
AGENTSDK_STORAGE_KEY_ROOT,
|
|
181
|
+
agentSdkStorageKeys,
|
|
174
182
|
defineStorage,
|
|
175
183
|
isDurableSessionRecordKey,
|
|
176
184
|
parseDurableSessionRecord,
|
|
177
185
|
STORAGE_KEY_ROOT,
|
|
178
186
|
storageKeys,
|
|
187
|
+
storageKeysForArchitecture,
|
|
179
188
|
summarizeDurableSessionRecord,
|
|
180
189
|
} from "./storage.js";
|
|
181
190
|
export { defineTool } from "./tools.js";
|
|
@@ -37,16 +37,13 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
import type { LocalAgentDocument, LocalAgentStore } from "@cursor/sdk";
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
cursorFrameworkStoreSourceId,
|
|
43
|
-
cursorHostedFiles,
|
|
44
|
-
} from "../files-backends/cursor-hosted.js";
|
|
40
|
+
import { agentSdkAgentStoreKeys, type FileSink } from "../files.js";
|
|
41
|
+
import { cursorHostedFiles } from "../files-backends/cursor-hosted.js";
|
|
45
42
|
import type { AgentProject } from "../types.js";
|
|
46
43
|
import { mapBounded } from "./bounded.js";
|
|
47
44
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
48
|
-
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
49
45
|
import { describeError } from "./describe-error.js";
|
|
46
|
+
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
50
47
|
|
|
51
48
|
/**
|
|
52
49
|
* Persist/restore one SDK conversation between a {@link LocalAgentStore} and
|
|
@@ -70,7 +67,7 @@ export interface ConversationMirror {
|
|
|
70
67
|
persist(store: LocalAgentStore, sdkAgentId: string): Promise<void>;
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
/** Wire shape at {@link
|
|
70
|
+
/** Wire shape at {@link agentSdkAgentStoreKeys.conversationManifest}. */
|
|
74
71
|
interface ConversationManifestV1 {
|
|
75
72
|
v: 1;
|
|
76
73
|
/** The SDK agent document, verbatim apart from `activeRunId` (nulled). */
|
|
@@ -181,7 +178,11 @@ export function createConversationMirror(
|
|
|
181
178
|
continue;
|
|
182
179
|
}
|
|
183
180
|
await sink.put(
|
|
184
|
-
|
|
181
|
+
agentSdkAgentStoreKeys.conversationBlob(
|
|
182
|
+
agentName,
|
|
183
|
+
sdkAgentId,
|
|
184
|
+
blobId
|
|
185
|
+
),
|
|
185
186
|
bytes
|
|
186
187
|
);
|
|
187
188
|
// Content-addressed: once in the sink, never re-uploaded.
|
|
@@ -197,7 +198,7 @@ export function createConversationMirror(
|
|
|
197
198
|
};
|
|
198
199
|
// Manifest last: it only ever references blobs already uploaded.
|
|
199
200
|
await sink.put(
|
|
200
|
-
|
|
201
|
+
agentSdkAgentStoreKeys.conversationManifest(agentName, sdkAgentId),
|
|
201
202
|
new TextEncoder().encode(JSON.stringify(manifest))
|
|
202
203
|
);
|
|
203
204
|
});
|
|
@@ -242,7 +243,11 @@ export function createConversationMirror(
|
|
|
242
243
|
async (blobId) => ({
|
|
243
244
|
blobId,
|
|
244
245
|
body: await sink.get(
|
|
245
|
-
|
|
246
|
+
agentSdkAgentStoreKeys.conversationBlob(
|
|
247
|
+
agentName,
|
|
248
|
+
sdkAgentId,
|
|
249
|
+
blobId
|
|
250
|
+
)
|
|
246
251
|
),
|
|
247
252
|
})
|
|
248
253
|
);
|
|
@@ -317,7 +322,7 @@ async function readManifest(
|
|
|
317
322
|
sdkAgentId: string
|
|
318
323
|
): Promise<ManifestRead> {
|
|
319
324
|
const body = await sink.get(
|
|
320
|
-
|
|
325
|
+
agentSdkAgentStoreKeys.conversationManifest(agentName, sdkAgentId)
|
|
321
326
|
);
|
|
322
327
|
if (body === undefined) {
|
|
323
328
|
return { outcome: "miss" };
|
|
@@ -379,17 +384,17 @@ export function selectConversationMirror(input: {
|
|
|
379
384
|
logger?: (line: string) => void;
|
|
380
385
|
env?: Record<string, string | undefined>;
|
|
381
386
|
}): ConversationMirror | undefined {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (
|
|
387
|
+
const hosting = resolveAgentV2Hosting({
|
|
388
|
+
architecture: input.project.agent.architecture,
|
|
389
|
+
env: input.env as NodeJS.ProcessEnv | undefined,
|
|
390
|
+
});
|
|
391
|
+
if (hosting.kind !== "cursor-managed") {
|
|
387
392
|
return undefined;
|
|
388
393
|
}
|
|
389
|
-
const envSnapshot = env as NodeJS.ProcessEnv;
|
|
390
394
|
return createConversationMirror({
|
|
391
395
|
sink: cursorHostedFiles({
|
|
392
|
-
resolveStoreSourceId: () =>
|
|
396
|
+
resolveStoreSourceId: () =>
|
|
397
|
+
hosting.resolveStoreIds().frameworkStoreSourceId,
|
|
393
398
|
// Full chain (env → key file → stored login): frozen engines listen
|
|
394
399
|
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this sink
|
|
395
400
|
// is constructed.
|