@cursor/july 0.1.29 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/README.md +10 -5
- package/dist/bin/agent-serve.js +4 -4
- package/dist/channels/github/index.d.ts +1 -1
- package/dist/channels/github/index.js +1 -1
- package/dist/channels/slack/bot-mentions.d.ts +1 -1
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -1
- package/dist/channels/slack/bot-mentions.js +1 -1
- package/dist/channels/slack/eval-directive.js +1 -1
- package/dist/channels/slack/external-policy.d.ts +1 -1
- package/dist/channels/slack/external-policy.js +1 -1
- package/dist/channels/slack/log.d.ts +1 -1
- package/dist/channels/slack/log.js +1 -1
- package/dist/channels/slack/setup.js +1 -1
- package/dist/channels/slack/socket-mode.js +1 -1
- package/dist/docs/404.html +3 -3
- package/dist/docs/ab.html +11 -11
- package/dist/docs/assets/{ab.md.BMCZ6Hd7.js → ab.md.DAQoJ-up.js} +6 -6
- package/dist/docs/assets/{ab.md.BMCZ6Hd7.lean.js → ab.md.DAQoJ-up.lean.js} +1 -1
- package/dist/docs/assets/{app.QdunVQKg.js → app.DigB_9cQ.js} +1 -1
- package/dist/docs/assets/building-with-agents.md.CnHqvYDd.js +13 -0
- package/dist/docs/assets/{building-with-agents.md.CJCtZCyi.lean.js → building-with-agents.md.CnHqvYDd.lean.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CnFFl07y.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.B6EpUXYf.js → VPLocalSearchBox.BCMX25Bv.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BOTJVqh7.js → theme.BDDWeELx.js} +2 -2
- package/dist/docs/assets/concepts.md.DFaQEFkA.js +4 -0
- package/dist/docs/assets/concepts.md.DFaQEFkA.lean.js +1 -0
- package/dist/docs/assets/deployment.md.9MYBuKM1.js +55 -0
- package/dist/docs/assets/deployment.md.9MYBuKM1.lean.js +1 -0
- package/dist/docs/assets/{evals.md.DYOjkRCX.js → evals.md.BIUoVZ6X.js} +13 -13
- package/dist/docs/assets/evals.md.BIUoVZ6X.lean.js +1 -0
- package/dist/docs/assets/{example-agents_approval-buddy.md.DFGBYLcc.js → example-agents_approval-buddy.md.BhEfleVx.js} +4 -4
- package/dist/docs/assets/{example-agents_approval-buddy.md.DFGBYLcc.lean.js → example-agents_approval-buddy.md.BhEfleVx.lean.js} +1 -1
- package/dist/docs/assets/example-agents_benny.md.2Et1qa8f.js +7 -0
- package/dist/docs/assets/{example-agents_bugbot.md.DelIdhxB.js → example-agents_bugbot.md.ByUexi5i.js} +5 -5
- package/dist/docs/assets/{example-agents_codebase-wiki.md.DC6sgwn0.js → example-agents_codebase-wiki.md.B4y-7ZVW.js} +6 -6
- package/dist/docs/assets/{example-agents_codebase-wiki.md.DC6sgwn0.lean.js → example-agents_codebase-wiki.md.B4y-7ZVW.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_codeowners-review.md.Ku_tG2RY.js → example-agents_codeowners-review.md.D6ay4nvf.js} +6 -6
- package/dist/docs/assets/{example-agents_codeowners-review.md.Ku_tG2RY.lean.js → example-agents_codeowners-review.md.D6ay4nvf.lean.js} +1 -1
- package/dist/docs/assets/{example-agents_concierge.md.4rQTSMXt.js → example-agents_concierge.md.lL8rhYlj.js} +7 -7
- package/dist/docs/assets/{example-agents_fsd.md.CzgUrDfi.js → example-agents_fsd.md.DfNKQTHz.js} +5 -5
- package/dist/docs/assets/example-agents_index.md.DgGBwckv.js +2 -0
- package/dist/docs/assets/example-agents_index.md.DgGBwckv.lean.js +1 -0
- package/dist/docs/assets/{example-agents_knowledge-base.md.BPJiVueF.js → example-agents_knowledge-base.md.CzyZ2DCr.js} +5 -5
- package/dist/docs/assets/{example-agents_knowledge-base.md.BPJiVueF.lean.js → example-agents_knowledge-base.md.CzyZ2DCr.lean.js} +1 -1
- package/dist/docs/assets/example-agents_oncall.md.wFFXXEyW.js +10 -0
- package/dist/docs/assets/{example-agents_security-reviewer.md.Dhj_m7_B.js → example-agents_security-reviewer.md.Dkf1gyo6.js} +8 -8
- package/dist/docs/assets/example-agents_slack-agent.md.DvgvT4nn.js +5 -0
- package/dist/docs/assets/example-agents_weather-agent.md.Dmrcphhl.js +24 -0
- package/dist/docs/assets/example-agents_weather-agent.md.Dmrcphhl.lean.js +1 -0
- package/dist/docs/assets/{guides_agent-to-agent.md.Bpzgq2Pq.js → guides_agent-to-agent.md.Bmbxy-FA.js} +4 -4
- package/dist/docs/assets/guides_cloud-runtime.md.BZ2GA7Es.js +9 -0
- package/dist/docs/assets/{guides_github.md.DOOCpqsW.js → guides_github.md.R2QlpR75.js} +5 -5
- package/dist/docs/assets/{guides_human-in-the-loop.md.DlUqsp1S.js → guides_human-in-the-loop.md.BWvT7UqY.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.Dd8EgSem.js → guides_mcp-oauth.md.C7G7IykG.js} +5 -5
- package/dist/docs/assets/guides_mcp-oauth.md.C7G7IykG.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.zriQpU_9.js +47 -0
- package/dist/docs/assets/guides_slack.md.zriQpU_9.lean.js +1 -0
- package/dist/docs/assets/{guides_webhooks.md.wSOYas3X.js → guides_webhooks.md.DiAwSR42.js} +1 -1
- package/dist/docs/assets/{hillclimbing.md.DHNast08.js → hillclimbing.md.D9Y1_bYh.js} +1 -1
- package/dist/docs/assets/index.md.CZqbBJPB.js +20 -0
- package/dist/docs/assets/index.md.CZqbBJPB.lean.js +1 -0
- package/dist/docs/assets/{quickstart.md.BU6Iwi_9.js → quickstart.md.TnEXYgYW.js} +12 -12
- package/dist/docs/assets/{reference_agent-config.md.DrW2JUM8.js → reference_agent-config.md.kuN6-OxK.js} +1 -1
- package/dist/docs/assets/reference_cli.md.sD-IUWjg.js +73 -0
- package/dist/docs/assets/{reference_cli.md.ccoKOoXt.lean.js → reference_cli.md.sD-IUWjg.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.B9Q3TOve.js → reference_connections.md.DGqAsFXb.js} +3 -3
- package/dist/docs/assets/reference_http-api.md.CfVM_ICa.js +11 -0
- package/dist/docs/assets/{reference_project-layout.md.Bd_CKtNS.js → reference_project-layout.md.D8E6ZmHJ.js} +4 -4
- package/dist/docs/assets/{reference_project-layout.md.Bd_CKtNS.lean.js → reference_project-layout.md.D8E6ZmHJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_schedules.md.w_F2mXB6.js → reference_schedules.md.gmfYzf_I.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.DLd6mvbv.js → reference_sessions.md.C_ouF_uf.js} +3 -3
- package/dist/docs/assets/{reference_tools.md.BRSDnTbN.js → reference_tools.md.BswAQM41.js} +3 -3
- package/dist/docs/assets/{scaffolding-agents.md.C3pTrmoE.js → scaffolding-agents.md.Bsr9Pwzu.js} +1 -1
- package/dist/docs/assets/{scaffolding-agents.md.C3pTrmoE.lean.js → scaffolding-agents.md.Bsr9Pwzu.lean.js} +1 -1
- package/dist/docs/assets/{storage.md.DRTdnFvd.js → storage.md.xZoiGM58.js} +3 -3
- package/dist/docs/assets/storage.md.xZoiGM58.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.B5RVX_tL.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.CmQkmnzC.lean.js → troubleshooting.md.B5RVX_tL.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +12 -12
- package/dist/docs/concepts.html +6 -6
- package/dist/docs/deployment.html +32 -32
- package/dist/docs/evals.html +19 -19
- package/dist/docs/example-agents/approval-buddy.html +9 -9
- package/dist/docs/example-agents/benny.html +11 -11
- package/dist/docs/example-agents/bugbot.html +10 -10
- package/dist/docs/example-agents/codebase-wiki.html +11 -11
- package/dist/docs/example-agents/codeowners-review.html +11 -11
- package/dist/docs/example-agents/concierge.html +12 -12
- package/dist/docs/example-agents/fsd.html +10 -10
- package/dist/docs/example-agents/index.html +7 -7
- package/dist/docs/example-agents/knowledge-base.html +10 -10
- package/dist/docs/example-agents/oncall.html +10 -10
- package/dist/docs/example-agents/security-reviewer.html +13 -13
- package/dist/docs/example-agents/slack-agent.html +10 -10
- package/dist/docs/example-agents/weather-agent.html +16 -16
- package/dist/docs/guides/agent-to-agent.html +9 -9
- package/dist/docs/guides/cloud-runtime.html +7 -7
- package/dist/docs/guides/github.html +10 -10
- package/dist/docs/guides/human-in-the-loop.html +7 -7
- package/dist/docs/guides/mcp-oauth.html +11 -11
- package/dist/docs/guides/slack.html +22 -17
- package/dist/docs/guides/webhooks.html +7 -7
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +7 -7
- package/dist/docs/index.html +9 -9
- package/dist/docs/quickstart.html +17 -17
- package/dist/docs/reference/agent-config.html +7 -7
- package/dist/docs/reference/channels.html +5 -5
- package/dist/docs/reference/cli.html +56 -48
- package/dist/docs/reference/connections.html +9 -9
- package/dist/docs/reference/hooks.html +5 -5
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/instructions.html +5 -5
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/project-layout.html +9 -9
- package/dist/docs/reference/prompt.html +5 -5
- package/dist/docs/reference/schedules.html +7 -7
- package/dist/docs/reference/sessions.html +8 -8
- package/dist/docs/reference/skills.html +5 -5
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +9 -9
- package/dist/docs/scaffolding-agents.html +6 -6
- package/dist/docs/storage.html +9 -9
- package/dist/docs/troubleshooting.html +6 -6
- package/dist/evals/reporters.d.ts +1 -1
- package/dist/evals/reporters.js +1 -1
- package/dist/evals.d.ts +2 -2
- package/dist/files-backends/agent-store-presigned-url.d.ts +100 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
- package/dist/files-backends/agent-store-presigned-url.js +347 -0
- package/dist/files-backends/cursor-hosted.d.ts +87 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +540 -0
- package/dist/files-backends/local-fs.d.ts +33 -0
- package/dist/files-backends/local-fs.d.ts.map +1 -0
- package/dist/files-backends/local-fs.js +199 -0
- package/dist/files.d.ts +139 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +89 -0
- package/dist/internal/ab-collector.js +2 -2
- package/dist/internal/ab-fold.js +1 -1
- package/dist/internal/cli-ax.d.ts +2 -2
- package/dist/internal/cli-ax.js +2 -2
- package/dist/internal/cli-deploy.d.ts +1 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +7 -2
- package/dist/internal/cli-docs.d.ts +1 -1
- package/dist/internal/cli-docs.js +1 -1
- package/dist/internal/cli-github.js +13 -13
- package/dist/internal/cli-mcp-oauth.d.ts +1 -1
- package/dist/internal/cli-mcp-oauth.js +2 -2
- package/dist/internal/cli-mcp.d.ts +3 -3
- package/dist/internal/cli-mcp.js +4 -4
- package/dist/internal/cli-skills.js +1 -1
- package/dist/internal/cloud-turn-cost.d.ts +9 -1
- package/dist/internal/cloud-turn-cost.d.ts.map +1 -1
- package/dist/internal/cloud-turn-cost.js +14 -4
- package/dist/internal/cursor/account-mcp.js +5 -5
- package/dist/internal/cursor/backend-client.js +1 -1
- package/dist/internal/cursor/github-credentials.js +3 -3
- package/dist/internal/cursor-account-mcp-auth.d.ts +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +1 -1
- package/dist/internal/cursor-event-relay.js +1 -1
- package/dist/internal/cursor-relay-core.d.ts +1 -1
- package/dist/internal/cursor-relay-core.d.ts.map +1 -1
- package/dist/internal/cursor-slack-relay.js +1 -1
- package/dist/internal/deploy-client.d.ts +6 -1
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +3 -2
- package/dist/internal/deploy-source.d.ts +2 -2
- package/dist/internal/deploy-source.js +2 -2
- package/dist/internal/discovery.js +2 -2
- package/dist/internal/distribution.d.ts +5 -5
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +6 -6
- package/dist/internal/docs-site.js +5 -5
- package/dist/internal/eval-run-store.js +8 -8
- package/dist/internal/evals-client.d.ts +1 -1
- package/dist/internal/evals-client.js +1 -1
- package/dist/internal/github-fanout.js +2 -2
- package/dist/internal/host-files.d.ts +29 -0
- package/dist/internal/host-files.d.ts.map +1 -0
- package/dist/internal/host-files.js +283 -0
- package/dist/internal/host-platforms.js +5 -5
- package/dist/internal/hosting.d.ts +1 -1
- package/dist/internal/hosting.js +1 -1
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +26 -0
- package/dist/internal/install-cursor-skills.d.ts +1 -1
- package/dist/internal/install-cursor-skills.d.ts.map +1 -1
- package/dist/internal/install-cursor-skills.js +33 -4
- package/dist/internal/local-control-plane.js +2 -2
- package/dist/internal/logs-client.d.ts +2 -2
- package/dist/internal/logs-client.js +2 -2
- package/dist/internal/mcp-endpoint.js +1 -1
- package/dist/internal/mcp-oauth.js +2 -2
- package/dist/internal/platform-schedule-sync.js +2 -2
- package/dist/internal/playground/toolchain.js +6 -6
- package/dist/internal/reminder-runner.js +13 -13
- package/dist/internal/resolved-connections.js +6 -6
- package/dist/internal/schedule-runner.js +1 -1
- package/dist/internal/sdk-runner.js +5 -5
- package/dist/internal/server.js +16 -16
- package/dist/internal/session-cost.d.ts +3 -2
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +7 -6
- package/dist/internal/session-engine.d.ts +31 -1
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +119 -31
- package/dist/internal/slack-provision-client.js +1 -1
- package/dist/internal/storage-coordinator.js +7 -7
- package/dist/internal/trajectory.js +2 -2
- package/dist/internal/turn-cost.d.ts +27 -0
- package/dist/internal/turn-cost.d.ts.map +1 -0
- package/dist/internal/turn-cost.js +83 -0
- package/dist/internal/update-check.d.ts +3 -3
- package/dist/internal/update-check.d.ts.map +1 -1
- package/dist/internal/update-check.js +5 -5
- package/dist/memory.d.ts +1 -1
- package/dist/memory.js +1 -1
- package/dist/playground/assets/index-50PKeJlG.css +1 -0
- package/dist/playground/assets/index-C0f2Wl1q.js +85 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +1 -1
- package/dist/types.d.ts +120 -16
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +23 -23
- package/docs/ab.md +12 -12
- package/docs/building-with-agents.md +9 -9
- package/docs/concepts.md +11 -11
- package/docs/deployment.md +55 -43
- package/docs/evals.md +20 -20
- package/docs/example-agents/approval-buddy.md +9 -9
- package/docs/example-agents/benny.md +13 -13
- package/docs/example-agents/bugbot.md +6 -6
- package/docs/example-agents/codebase-wiki.md +8 -8
- package/docs/example-agents/codeowners-review.md +8 -8
- package/docs/example-agents/concierge.md +10 -10
- package/docs/example-agents/fsd.md +7 -7
- package/docs/example-agents/index.md +8 -8
- package/docs/example-agents/knowledge-base.md +9 -9
- package/docs/example-agents/oncall.md +7 -7
- package/docs/example-agents/security-reviewer.md +12 -12
- package/docs/example-agents/slack-agent.md +10 -10
- package/docs/example-agents/weather-agent.md +30 -26
- package/docs/guides/agent-to-agent.md +4 -4
- package/docs/guides/cloud-runtime.md +3 -3
- package/docs/guides/github.md +6 -6
- package/docs/guides/human-in-the-loop.md +1 -1
- package/docs/guides/mcp-oauth.md +9 -9
- package/docs/guides/slack.md +94 -21
- package/docs/guides/webhooks.md +1 -1
- package/docs/hillclimbing.md +3 -3
- package/docs/quickstart.md +18 -18
- package/docs/reference/agent-config.md +1 -1
- package/docs/reference/cli.md +110 -79
- package/docs/reference/connections.md +3 -3
- package/docs/reference/http-api.md +2 -2
- package/docs/reference/project-layout.md +7 -7
- package/docs/reference/schedules.md +1 -1
- package/docs/reference/sessions.md +7 -7
- package/docs/reference/tools.md +3 -3
- package/docs/scaffolding-agents.md +2 -2
- package/docs/storage.md +5 -5
- package/docs/troubleshooting.md +11 -10
- package/package.json +3 -1
- package/skills/ab/SKILL.md +5 -5
- package/skills/create-agent/SKILL.md +17 -17
- package/skills/debug/SKILL.md +10 -10
- package/skills/evals/SKILL.md +13 -13
- package/skills/framework-map/SKILL.md +3 -3
- package/skills/github/SKILL.md +11 -11
- package/skills/hillclimb/SKILL.md +9 -9
- package/skills/mcp-auth/SKILL.md +11 -11
- package/skills/setup-slack/SKILL.md +28 -28
- package/src/bin/agent-serve.ts +4 -4
- package/src/channels/github/index.ts +1 -1
- package/src/channels/slack/bot-mentions.ts +1 -1
- package/src/channels/slack/eval-directive.ts +1 -1
- package/src/channels/slack/external-policy.ts +1 -1
- package/src/channels/slack/log.ts +1 -1
- package/src/channels/slack/setup.ts +1 -1
- package/src/channels/slack/socket-mode.ts +1 -1
- package/src/evals/reporters.ts +1 -1
- package/src/evals.ts +2 -2
- package/src/files-backends/agent-store-presigned-url.ts +402 -0
- package/src/files-backends/cursor-hosted.ts +698 -0
- package/src/files-backends/local-fs.ts +178 -0
- package/src/files.ts +195 -0
- package/src/internal/ab-collector.ts +2 -2
- package/src/internal/ab-fold.ts +1 -1
- package/src/internal/cli-ax.ts +2 -2
- package/src/internal/cli-deploy.ts +7 -2
- package/src/internal/cli-docs.ts +1 -1
- package/src/internal/cli-github.ts +13 -13
- package/src/internal/cli-mcp-oauth.ts +2 -2
- package/src/internal/cli-mcp.ts +4 -4
- package/src/internal/cli-skills.ts +1 -1
- package/src/internal/cloud-turn-cost.ts +20 -4
- package/src/internal/cursor/account-mcp.ts +5 -5
- package/src/internal/cursor/backend-client.ts +1 -1
- package/src/internal/cursor/github-credentials.ts +3 -3
- package/src/internal/cursor-account-mcp-auth.ts +1 -1
- package/src/internal/cursor-event-relay.ts +1 -1
- package/src/internal/cursor-relay-core.ts +1 -1
- package/src/internal/cursor-slack-relay.ts +1 -1
- package/src/internal/deploy-client.ts +8 -2
- package/src/internal/deploy-source.ts +2 -2
- package/src/internal/discovery.ts +2 -2
- package/src/internal/distribution.ts +6 -6
- package/src/internal/docs-site.ts +5 -5
- package/src/internal/eval-run-store.ts +8 -8
- package/src/internal/evals-client.ts +1 -1
- package/src/internal/github-fanout.ts +2 -2
- package/src/internal/host-files.ts +372 -0
- package/src/internal/host-platforms.ts +5 -5
- package/src/internal/hosting.ts +1 -1
- package/src/internal/http-channel.ts +30 -0
- package/src/internal/install-cursor-skills.ts +31 -3
- package/src/internal/local-control-plane.ts +2 -2
- package/src/internal/logs-client.ts +2 -2
- package/src/internal/mcp-endpoint.ts +1 -1
- package/src/internal/mcp-oauth.ts +2 -2
- package/src/internal/platform-schedule-sync.ts +2 -2
- package/src/internal/playground/toolchain.ts +6 -6
- package/src/internal/reminder-runner.ts +13 -13
- package/src/internal/resolved-connections.ts +6 -6
- package/src/internal/schedule-runner.ts +1 -1
- package/src/internal/sdk-runner.ts +5 -5
- package/src/internal/server.ts +16 -16
- package/src/internal/session-cost.ts +7 -6
- package/src/internal/session-engine.ts +141 -28
- package/src/internal/slack-provision-client.ts +1 -1
- package/src/internal/storage-coordinator.ts +7 -7
- package/src/internal/trajectory.ts +2 -2
- package/src/internal/turn-cost.ts +110 -0
- package/src/internal/update-check.ts +6 -6
- package/src/memory.ts +1 -1
- package/src/storage.ts +1 -1
- package/src/types.ts +148 -16
- package/dist/docs/assets/building-with-agents.md.CJCtZCyi.js +0 -13
- package/dist/docs/assets/chunks/@localSearchIndexroot.DGe61XHA.js +0 -1
- package/dist/docs/assets/concepts.md.Cfb9b-k1.js +0 -4
- package/dist/docs/assets/concepts.md.Cfb9b-k1.lean.js +0 -1
- package/dist/docs/assets/deployment.md.TecHo0_2.js +0 -55
- package/dist/docs/assets/deployment.md.TecHo0_2.lean.js +0 -1
- package/dist/docs/assets/evals.md.DYOjkRCX.lean.js +0 -1
- package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.js +0 -7
- package/dist/docs/assets/example-agents_index.md.D2PEVSXl.js +0 -2
- package/dist/docs/assets/example-agents_index.md.D2PEVSXl.lean.js +0 -1
- package/dist/docs/assets/example-agents_oncall.md.BG_sUMly.js +0 -10
- package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.js +0 -5
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.js +0 -24
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.lean.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.gVzabdQL.js +0 -9
- package/dist/docs/assets/guides_mcp-oauth.md.Dd8EgSem.lean.js +0 -1
- package/dist/docs/assets/guides_slack.md.CjmJSvZS.js +0 -42
- package/dist/docs/assets/guides_slack.md.CjmJSvZS.lean.js +0 -1
- package/dist/docs/assets/index.md.CH_s5uZe.js +0 -20
- package/dist/docs/assets/index.md.CH_s5uZe.lean.js +0 -1
- package/dist/docs/assets/reference_cli.md.ccoKOoXt.js +0 -65
- package/dist/docs/assets/reference_http-api.md.BncLd3PZ.js +0 -11
- package/dist/docs/assets/storage.md.DRTdnFvd.lean.js +0 -1
- package/dist/docs/assets/troubleshooting.md.CmQkmnzC.js +0 -1
- package/dist/internal/model-pricing.d.ts +0 -49
- package/dist/internal/model-pricing.d.ts.map +0 -1
- package/dist/internal/model-pricing.js +0 -377
- package/dist/playground/assets/index-CquRB-l0.js +0 -85
- package/dist/playground/assets/index-Dj0bWpkn.css +0 -1
- package/src/internal/model-pricing.ts +0 -426
- /package/dist/docs/assets/{example-agents_benny.md.B0gjhI-p.lean.js → example-agents_benny.md.2Et1qa8f.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_bugbot.md.DelIdhxB.lean.js → example-agents_bugbot.md.ByUexi5i.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_concierge.md.4rQTSMXt.lean.js → example-agents_concierge.md.lL8rhYlj.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_fsd.md.CzgUrDfi.lean.js → example-agents_fsd.md.DfNKQTHz.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_oncall.md.BG_sUMly.lean.js → example-agents_oncall.md.wFFXXEyW.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_security-reviewer.md.Dhj_m7_B.lean.js → example-agents_security-reviewer.md.Dkf1gyo6.lean.js} +0 -0
- /package/dist/docs/assets/{example-agents_slack-agent.md.buLbgvBf.lean.js → example-agents_slack-agent.md.DvgvT4nn.lean.js} +0 -0
- /package/dist/docs/assets/{guides_agent-to-agent.md.Bpzgq2Pq.lean.js → guides_agent-to-agent.md.Bmbxy-FA.lean.js} +0 -0
- /package/dist/docs/assets/{guides_cloud-runtime.md.gVzabdQL.lean.js → guides_cloud-runtime.md.BZ2GA7Es.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.DOOCpqsW.lean.js → guides_github.md.R2QlpR75.lean.js} +0 -0
- /package/dist/docs/assets/{guides_human-in-the-loop.md.DlUqsp1S.lean.js → guides_human-in-the-loop.md.BWvT7UqY.lean.js} +0 -0
- /package/dist/docs/assets/{guides_webhooks.md.wSOYas3X.lean.js → guides_webhooks.md.DiAwSR42.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.DHNast08.lean.js → hillclimbing.md.D9Y1_bYh.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.BU6Iwi_9.lean.js → quickstart.md.TnEXYgYW.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.DrW2JUM8.lean.js → reference_agent-config.md.kuN6-OxK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.B9Q3TOve.lean.js → reference_connections.md.DGqAsFXb.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.BncLd3PZ.lean.js → reference_http-api.md.CfVM_ICa.lean.js} +0 -0
- /package/dist/docs/assets/{reference_schedules.md.w_F2mXB6.lean.js → reference_schedules.md.gmfYzf_I.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.DLd6mvbv.lean.js → reference_sessions.md.C_ouF_uf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.BRSDnTbN.lean.js → reference_tools.md.BswAQM41.lean.js} +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored from `@anysphere/agent-store-sync` `presigned-url.ts` so the
|
|
3
|
+
* published `@cursor/july` tarball does not depend on that private workspace
|
|
4
|
+
* package (not on npm). Keep in sync when the source validator changes.
|
|
5
|
+
*/
|
|
6
|
+
export class PresignedUrlRejectedError extends Error {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options.message);
|
|
9
|
+
this.name = "PresignedUrlRejectedError";
|
|
10
|
+
this.code = options.code;
|
|
11
|
+
this.url = options.url;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Strict default: accepts `https:` URLs to an AWS S3 endpoint with no
|
|
16
|
+
* userinfo and no private/internal address. Rejects DNS hosts that
|
|
17
|
+
* resolve into the private IP space and IPv4-mapped IPv6 literals.
|
|
18
|
+
*/
|
|
19
|
+
export function defaultPresignedUrlValidator(url) {
|
|
20
|
+
assertSafeAuthority(url);
|
|
21
|
+
if (url.protocol !== "https:") {
|
|
22
|
+
throw new PresignedUrlRejectedError({
|
|
23
|
+
code: "scheme_not_allowed",
|
|
24
|
+
message: `Refused presigned URL with non-https scheme: ${url.protocol}`,
|
|
25
|
+
url: redactPresignedUrlString(url),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const hostname = stripIPv6Brackets(url.hostname);
|
|
29
|
+
if (isLocalOrInternalHost(hostname)) {
|
|
30
|
+
throw new PresignedUrlRejectedError({
|
|
31
|
+
code: "private_host_not_allowed",
|
|
32
|
+
message: `Refused https presigned URL with private/internal host: ${hostname}`,
|
|
33
|
+
url: redactPresignedUrlString(url),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (!isAwsS3Hostname(hostname)) {
|
|
37
|
+
throw new PresignedUrlRejectedError({
|
|
38
|
+
code: "host_not_allowed",
|
|
39
|
+
message: `Refused presigned URL whose host is not an AWS S3 endpoint: ${hostname}`,
|
|
40
|
+
url: redactPresignedUrlString(url),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* True when `hostname` is an AWS S3 object-storage endpoint:
|
|
46
|
+
* `*.amazonaws.com` with at least one label in
|
|
47
|
+
* {@link S3_OBJECT_LABELS}. Covers modern virtual-host, path-style,
|
|
48
|
+
* dualstack, accelerate, and FIPS URLs. Rejects the S3-named control
|
|
49
|
+
* planes (`s3-control`, `s3-outposts`, `s3-object-lambda`) and the
|
|
50
|
+
* legacy regional virtual-host form AWS deprecated in 2019, both of
|
|
51
|
+
* which would otherwise let a tampered presign issuer turn the sync
|
|
52
|
+
* client into a signed-request gadget against non-storage APIs.
|
|
53
|
+
*/
|
|
54
|
+
export function isAwsS3Hostname(hostname) {
|
|
55
|
+
const lowered = hostname.toLowerCase();
|
|
56
|
+
if (lowered !== "amazonaws.com" && !lowered.endsWith(".amazonaws.com")) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
const labels = lowered.split(".");
|
|
60
|
+
return labels.some(label => S3_OBJECT_LABELS.has(label));
|
|
61
|
+
}
|
|
62
|
+
const S3_OBJECT_LABELS = new Set(["s3", "s3-accelerate", "s3-fips"]);
|
|
63
|
+
/**
|
|
64
|
+
* Like {@link defaultPresignedUrlValidator} plus a case-insensitive
|
|
65
|
+
* exact-match check against `allowedHosts` (no subdomain wildcards).
|
|
66
|
+
*/
|
|
67
|
+
export function createHostAllowlistValidator(allowedHosts) {
|
|
68
|
+
const allowed = new Set(allowedHosts.map(host => host.toLowerCase()));
|
|
69
|
+
return (url) => {
|
|
70
|
+
defaultPresignedUrlValidator(url);
|
|
71
|
+
if (!allowed.has(url.hostname.toLowerCase())) {
|
|
72
|
+
throw new PresignedUrlRejectedError({
|
|
73
|
+
code: "host_not_allowed",
|
|
74
|
+
message: `Refused presigned URL whose host is not in the allowlist: ${url.hostname}`,
|
|
75
|
+
url: redactPresignedUrlString(url),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Virtual-host S3 endpoints for the production `agent-stores` bucket
|
|
82
|
+
* (matches backend `getAgentStoreBucket()` in
|
|
83
|
+
* `backend/server/src/agent-stores/utils/agentStoreS3.ts`, which presigns
|
|
84
|
+
* with a `us-east-1` `S3Client` and the SDK's default virtual-host
|
|
85
|
+
* addressing). Both the regional form emitted by modern AWS SDK v3 and
|
|
86
|
+
* the legacy global form are listed so a presign issuer upgrade or
|
|
87
|
+
* downgrade can't trip the allowlist. Path-style (`s3.amazonaws.com/agent-stores/…`)
|
|
88
|
+
* is intentionally not listed: the server never sets `forcePathStyle`,
|
|
89
|
+
* and admitting bare `s3.amazonaws.com` would re-open the "any bucket"
|
|
90
|
+
* gap this allowlist exists to close.
|
|
91
|
+
*/
|
|
92
|
+
export const BCS_AGENT_STORE_BUCKET_HOSTS = [
|
|
93
|
+
"agent-stores.s3.us-east-1.amazonaws.com",
|
|
94
|
+
"agent-stores.s3.amazonaws.com",
|
|
95
|
+
];
|
|
96
|
+
const PLAYGROUND_AGENT_STORE_BUCKET_HOSTS = [
|
|
97
|
+
"agent-stores-928182716709-us-west-2-an.s3.us-west-2.amazonaws.com",
|
|
98
|
+
"agent-stores-928182716709-us-west-2-an.s3.amazonaws.com",
|
|
99
|
+
];
|
|
100
|
+
/**
|
|
101
|
+
* Production validator for the BCS agent-store sync transport: strict
|
|
102
|
+
* default (https, S3 endpoint, no private hosts, no userinfo) plus the
|
|
103
|
+
* {@link BCS_AGENT_STORE_BUCKET_HOSTS} pin. Pre-built so callers don't
|
|
104
|
+
* accidentally pass {@link defaultPresignedUrlValidator}, which would
|
|
105
|
+
* accept any AWS S3 bucket on the internet and let a buggy or
|
|
106
|
+
* compromised presign issuer redirect sync traffic away from the real
|
|
107
|
+
* `agent-stores` bucket.
|
|
108
|
+
*/
|
|
109
|
+
export function createBcsPresignedUrlValidator() {
|
|
110
|
+
return createHostAllowlistValidator(BCS_AGENT_STORE_BUCKET_HOSTS);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* True when `backendUrl` targets a local dev backend (localhost or
|
|
114
|
+
* lclhst.build). Matches IDE checks in `cursor-always-local` /
|
|
115
|
+
* `cursorCredsService`.
|
|
116
|
+
*/
|
|
117
|
+
export function isLocalAgentStoreBackendUrl(backendUrl) {
|
|
118
|
+
const trimmed = backendUrl.trim();
|
|
119
|
+
if (trimmed === "") {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return trimmed.includes("localhost") || trimmed.includes("lclhst.build");
|
|
123
|
+
}
|
|
124
|
+
function isPlaygroundAgentStoreBackendUrl(backendUrl) {
|
|
125
|
+
try {
|
|
126
|
+
const hostname = new URL(backendUrl).hostname.toLowerCase();
|
|
127
|
+
return (hostname === "playground.cursor.sh" ||
|
|
128
|
+
hostname.endsWith(".playground.cursor.sh"));
|
|
129
|
+
}
|
|
130
|
+
catch (_a) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Presign validator for the sync client. Production/staging and playground
|
|
136
|
+
* backends are pinned to their respective agent-store buckets. For a local dev API (see
|
|
137
|
+
* {@link isLocalAgentStoreBackendUrl}), allow `http:` to loopback only
|
|
138
|
+
* (LocalStack) and still pin all other URLs to {@link BCS_AGENT_STORE_BUCKET_HOSTS}.
|
|
139
|
+
*/
|
|
140
|
+
export function createAgentStorePresignedUrlValidatorForBackend(backendUrl) {
|
|
141
|
+
if (isLocalAgentStoreBackendUrl(backendUrl)) {
|
|
142
|
+
return createLocalDevAgentStorePresignedUrlValidator();
|
|
143
|
+
}
|
|
144
|
+
if (isPlaygroundAgentStoreBackendUrl(backendUrl)) {
|
|
145
|
+
return createHostAllowlistValidator(PLAYGROUND_AGENT_STORE_BUCKET_HOSTS);
|
|
146
|
+
}
|
|
147
|
+
return createBcsPresignedUrlValidator();
|
|
148
|
+
}
|
|
149
|
+
function createLocalDevAgentStorePresignedUrlValidator() {
|
|
150
|
+
const bcsValidator = createBcsPresignedUrlValidator();
|
|
151
|
+
return (url) => {
|
|
152
|
+
assertSafeAuthority(url);
|
|
153
|
+
const hostname = stripIPv6Brackets(url.hostname);
|
|
154
|
+
if (url.protocol === "http:" && isLoopbackHostName(hostname)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
bcsValidator(url);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Like {@link defaultPresignedUrlValidator} plus `http://localhost` /
|
|
162
|
+
* `127.0.0.1` / `[::1]` (any port) for LocalStack-backed unit tests.
|
|
163
|
+
* Non-loopback `https:` URLs fall through to the strict default (any S3
|
|
164
|
+
* bucket). Do not use for IDE wiring — use
|
|
165
|
+
* {@link createAgentStorePresignedUrlValidatorForBackend} instead.
|
|
166
|
+
*/
|
|
167
|
+
export function localhostPermissivePresignedUrlValidator(url) {
|
|
168
|
+
assertSafeAuthority(url);
|
|
169
|
+
const hostname = stripIPv6Brackets(url.hostname);
|
|
170
|
+
if (url.protocol === "http:" && isLoopbackHostName(hostname)) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
defaultPresignedUrlValidator(url);
|
|
174
|
+
}
|
|
175
|
+
function assertSafeAuthority(url) {
|
|
176
|
+
if (url.username !== "" || url.password !== "") {
|
|
177
|
+
throw new PresignedUrlRejectedError({
|
|
178
|
+
code: "userinfo_not_allowed",
|
|
179
|
+
message: "Refused presigned URL with embedded userinfo",
|
|
180
|
+
url: redactPresignedUrlString(url),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Strip the query string and userinfo from a presigned URL so the AWS
|
|
186
|
+
* SigV4 signature never reaches error messages or telemetry.
|
|
187
|
+
*/
|
|
188
|
+
export function redactPresignedUrlString(url) {
|
|
189
|
+
try {
|
|
190
|
+
const parsed = typeof url === "string" ? new URL(url) : url;
|
|
191
|
+
return `${parsed.protocol}//${parsed.host}${parsed.pathname}`;
|
|
192
|
+
}
|
|
193
|
+
catch (_a) {
|
|
194
|
+
return "<unparseable-presigned-url>";
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Parse and validate a server-returned presigned URL before fetch. Uses
|
|
199
|
+
* {@link relPath} in error text (never the raw URL) so SigV4 credentials
|
|
200
|
+
* cannot leak into messages.
|
|
201
|
+
*/
|
|
202
|
+
export function assertPresignedUrlSafe(args) {
|
|
203
|
+
let parsed;
|
|
204
|
+
try {
|
|
205
|
+
parsed = new URL(args.rawUrl);
|
|
206
|
+
}
|
|
207
|
+
catch (_a) {
|
|
208
|
+
throw new Error(`Refusing unparseable presigned URL for ${args.relPath}`);
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
args.validatePresignedUrl(parsed);
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
throw new Error(`Refusing presigned URL for ${args.relPath}: ${error instanceof Error ? error.message : String(error)}`, { cause: error instanceof Error ? error : undefined });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function isLoopbackHostName(hostname) {
|
|
218
|
+
const lowered = hostname.toLowerCase();
|
|
219
|
+
return (lowered === "localhost" ||
|
|
220
|
+
lowered === "ip6-localhost" ||
|
|
221
|
+
lowered === "127.0.0.1" ||
|
|
222
|
+
lowered === "::1" ||
|
|
223
|
+
lowered === "0:0:0:0:0:0:0:1");
|
|
224
|
+
}
|
|
225
|
+
function isLocalOrInternalHost(hostname) {
|
|
226
|
+
if (hostname.length === 0) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
if (isLoopbackHostName(hostname)) {
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
if (isIPv4Address(hostname)) {
|
|
233
|
+
return isPrivateOrInternalIPv4(hostname);
|
|
234
|
+
}
|
|
235
|
+
if (isIPv6Address(hostname)) {
|
|
236
|
+
return isPrivateOrInternalIPv6(hostname);
|
|
237
|
+
}
|
|
238
|
+
// DNS hostnames can't be classified without resolving; the caller
|
|
239
|
+
// relies on transport-level allowlists for those.
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
function stripIPv6Brackets(hostname) {
|
|
243
|
+
return hostname.startsWith("[") && hostname.endsWith("]")
|
|
244
|
+
? hostname.slice(1, -1)
|
|
245
|
+
: hostname;
|
|
246
|
+
}
|
|
247
|
+
function isIPv4Address(hostname) {
|
|
248
|
+
const parts = hostname.split(".");
|
|
249
|
+
if (parts.length !== 4) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
return parts.every(part => {
|
|
253
|
+
if (part.length === 0 || part.length > 3) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
if (!/^\d+$/.test(part)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
const n = Number(part);
|
|
260
|
+
return Number.isInteger(n) && n >= 0 && n <= 255;
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function isPrivateOrInternalIPv4(hostname) {
|
|
264
|
+
const [a, b] = hostname.split(".").map(Number);
|
|
265
|
+
if (a === undefined || b === undefined) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
// RFC1918, loopback, link-local, multicast, unspecified, broadcast,
|
|
269
|
+
// carrier-grade NAT, and reserved blocks.
|
|
270
|
+
if (a === 0)
|
|
271
|
+
return true;
|
|
272
|
+
if (a === 10)
|
|
273
|
+
return true;
|
|
274
|
+
if (a === 127)
|
|
275
|
+
return true;
|
|
276
|
+
if (a === 169 && b === 254)
|
|
277
|
+
return true;
|
|
278
|
+
if (a === 172 && b >= 16 && b <= 31)
|
|
279
|
+
return true;
|
|
280
|
+
if (a === 192 && b === 168)
|
|
281
|
+
return true;
|
|
282
|
+
if (a === 100 && b >= 64 && b <= 127)
|
|
283
|
+
return true;
|
|
284
|
+
if (a >= 224 && a <= 239)
|
|
285
|
+
return true;
|
|
286
|
+
if (a >= 240)
|
|
287
|
+
return true;
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
function isIPv6Address(hostname) {
|
|
291
|
+
// Loose check — just enough to route the host to the IPv6 classifier.
|
|
292
|
+
return hostname.includes(":");
|
|
293
|
+
}
|
|
294
|
+
function isPrivateOrInternalIPv6(hostname) {
|
|
295
|
+
const lowered = hostname.toLowerCase();
|
|
296
|
+
if (lowered === "::" || lowered === "::1") {
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
// IPv4-mapped IPv6 (RFC4291) routes back through the IPv4 classifier
|
|
300
|
+
// so `[::ffff:169.254.169.254]` can't slip past the private-IP check.
|
|
301
|
+
const mapped = extractIPv4MappedAddress(lowered);
|
|
302
|
+
if (mapped !== undefined) {
|
|
303
|
+
return isPrivateOrInternalIPv4(mapped);
|
|
304
|
+
}
|
|
305
|
+
// ULA fc00::/7, link-local fe80::/10, multicast ff00::/8.
|
|
306
|
+
if (lowered.startsWith("fc") || lowered.startsWith("fd")) {
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
if (lowered.startsWith("fe8") || lowered.startsWith("fe9")) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
if (lowered.startsWith("fea") || lowered.startsWith("feb")) {
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
if (lowered.startsWith("ff")) {
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
// Convert an IPv4-mapped IPv6 literal (`::ffff:a.b.c.d` or
|
|
321
|
+
// `::ffff:hhhh:hhhh`) to its dotted-quad form. Returns undefined otherwise.
|
|
322
|
+
function extractIPv4MappedAddress(hostname) {
|
|
323
|
+
const dotted = hostname.match(/^(?:0:0:0:0:0|::):?ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/i);
|
|
324
|
+
if (dotted) {
|
|
325
|
+
return dotted[1];
|
|
326
|
+
}
|
|
327
|
+
if (hostname.startsWith("::ffff:")) {
|
|
328
|
+
const tail = hostname.slice("::ffff:".length);
|
|
329
|
+
if (isIPv4Address(tail)) {
|
|
330
|
+
return tail;
|
|
331
|
+
}
|
|
332
|
+
const hex = tail.match(/^([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);
|
|
333
|
+
if (hex) {
|
|
334
|
+
const high = Number.parseInt(hex[1], 16);
|
|
335
|
+
const low = Number.parseInt(hex[2], 16);
|
|
336
|
+
if (Number.isFinite(high) &&
|
|
337
|
+
Number.isFinite(low) &&
|
|
338
|
+
high >= 0 &&
|
|
339
|
+
high <= 0xffff &&
|
|
340
|
+
low >= 0 &&
|
|
341
|
+
low <= 0xffff) {
|
|
342
|
+
return `${(high >> 8) & 0xff}.${high & 0xff}.${(low >> 8) & 0xff}.${low & 0xff}`;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return undefined;
|
|
347
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor-managed durable files for hosted agents — the backend that puts
|
|
3
|
+
* `ctx.host.files` bytes in an Agent Store on S3.
|
|
4
|
+
*
|
|
5
|
+
* One credential throughout: the engine's pod `CURSOR_API_KEY`. It authorizes
|
|
6
|
+
* every call, and the bytes then move between this process and presigned S3
|
|
7
|
+
* URLs. File contents never transit the control plane, so a large artifact
|
|
8
|
+
* costs S3 bandwidth rather than backend memory.
|
|
9
|
+
*
|
|
10
|
+
* Everything goes through the public API under `/v0/agent-serve-files`, the same
|
|
11
|
+
* surface any API-key holder gets. This process is an ordinary client of it —
|
|
12
|
+
* there is no private endpoint, no second base URL, and nothing here that only
|
|
13
|
+
* works because the caller happens to be an Agent Serve engine. That matters
|
|
14
|
+
* beyond tidiness: a self-hosted deployment, a CI job, or a customer script can
|
|
15
|
+
* drive the same store with the same requests.
|
|
16
|
+
*
|
|
17
|
+
* Two things follow. There is no Agent Store token: a token narrows an identity
|
|
18
|
+
* to one store and one capability, which is what a caller that cannot hold a
|
|
19
|
+
* credential needs (an in-pod FUSE daemon). This process holds the credential
|
|
20
|
+
* the token would be minted from, so a token bought a round trip, an expiry to
|
|
21
|
+
* manage, and a second auth path, and no privilege reduction. And there is no
|
|
22
|
+
* direct call to the store service: the API layer owns the policy, and the
|
|
23
|
+
* engine never addresses it.
|
|
24
|
+
*
|
|
25
|
+
* There is also no store lookup. Every request names this deployment's file
|
|
26
|
+
* store by the `agentStoreSourceId` the deploy pipeline pinned into the pod
|
|
27
|
+
* env as `AGENT_SERVE_STORE_SOURCE_ID` — provisioning the store at the same
|
|
28
|
+
* time, so by boot the store exists and the id resolves. The id is an
|
|
29
|
+
* address, not a credential: the server maps it to a store and authorizes
|
|
30
|
+
* every call against the deployment's own live service account, so holding
|
|
31
|
+
* it grants nothing, and this process never learns a store id it could use
|
|
32
|
+
* to ask for anyone else's.
|
|
33
|
+
*
|
|
34
|
+
* Locally, point `CURSOR_API_BASE_URL` at a backend that serves
|
|
35
|
+
* `/v0/agent-serve-files` and use a deployment SA key; off hosting the
|
|
36
|
+
* local-disk sink is the default instead.
|
|
37
|
+
*
|
|
38
|
+
* Writes are conditional. The store rejects unconditional writes, so every
|
|
39
|
+
* `put` first learns the current etag: `new` for a path we believe is absent,
|
|
40
|
+
* `etag` to replace what we last observed. A raced write comes back 412 and
|
|
41
|
+
* surfaces as {@link FileConflictError}, which is why this backend reports
|
|
42
|
+
* `etags: true` and `host.files.capabilities.conflictDetection` is honestly
|
|
43
|
+
* true.
|
|
44
|
+
*/
|
|
45
|
+
import { type FileSink, type FileSinkBody } from "../files.js";
|
|
46
|
+
/**
|
|
47
|
+
* Pinned by the deploy pipeline for every Cursor-managed deployment — which
|
|
48
|
+
* provisions the file store it names in the same step — and reserved from
|
|
49
|
+
* user secrets. Its presence is the signal that a durable store exists and
|
|
50
|
+
* the hosted control plane is reachable; a deployment without one (no
|
|
51
|
+
* service account yet) has no store, and this backend is not selected.
|
|
52
|
+
*/
|
|
53
|
+
export declare const AGENT_SERVE_STORE_SOURCE_ID_ENV_VAR = "AGENT_SERVE_STORE_SOURCE_ID";
|
|
54
|
+
/**
|
|
55
|
+
* True on Cursor-managed hosting with a provisioned file store.
|
|
56
|
+
*
|
|
57
|
+
* Keyed on the store source id alone, deliberately: the credential is not part
|
|
58
|
+
* of the test. If it were, a missing or regressed `CURSOR_API_KEY` would
|
|
59
|
+
* silently select pod-local disk on a hosted pod and accept writes that vanish
|
|
60
|
+
* with the pod. Instead the store is detected, and a missing credential fails
|
|
61
|
+
* loudly when the sink is used.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isCursorHostedFilesAvailable(env?: NodeJS.ProcessEnv): boolean;
|
|
64
|
+
export interface CursorHostedFilesOptions {
|
|
65
|
+
/** Control-plane base URL (default: `CURSOR_API_BASE_URL`, else api.cursor.com). */
|
|
66
|
+
baseUrl?: string;
|
|
67
|
+
/** Bearer credential (default: `CURSOR_API_KEY`). */
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
/** File store to address (default: `AGENT_SERVE_STORE_SOURCE_ID`). */
|
|
70
|
+
storeSourceId?: string;
|
|
71
|
+
/** Test seam; defaults to global fetch. */
|
|
72
|
+
fetch?: typeof fetch;
|
|
73
|
+
}
|
|
74
|
+
type HostedFilesMethods = Omit<FileSink, "get"> & {
|
|
75
|
+
/** Narrower than {@link FileSink.get}: this backend always reports the etag. */
|
|
76
|
+
get(key: string): Promise<FileSinkBody | undefined>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Cursor-hosted {@link FileSink}, selected on Cursor-managed hosting.
|
|
80
|
+
*
|
|
81
|
+
* Stateless apart from the etag cache below: every request names this
|
|
82
|
+
* deployment's store by its pinned source id, so there is nothing to
|
|
83
|
+
* resolve, hold, or invalidate.
|
|
84
|
+
*/
|
|
85
|
+
export declare function cursorHostedFiles(options?: CursorHostedFilesOptions): HostedFilesMethods;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=cursor-hosted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor-hosted.d.ts","sourceRoot":"","sources":["../../src/files-backends/cursor-hosted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAWrB;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC,gCACjB,CAAC;AAgBhC;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAGT;AAED,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAuCD,KAAK,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG;IAChD,gFAAgF;IAChF,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,kBAAkB,CA8VpB"}
|