@cursor/bdk 0.2.6 → 0.2.7
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/dist/bin/agent-serve.js +52 -57
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +34 -8
- package/dist/channels/github/types.d.ts +6 -0
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +37 -29
- package/dist/channels/slack/external-policy.d.ts.map +1 -1
- package/dist/channels/slack/external-policy.js +6 -6
- package/dist/channels/slack/inbound.d.ts +5 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +13 -0
- package/dist/channels/slack/index.d.ts +3 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +3 -0
- package/dist/channels/slack/log.d.ts +1 -1
- package/dist/channels/slack/log.js +1 -1
- package/dist/channels/slack/self-identity.d.ts +15 -0
- package/dist/channels/slack/self-identity.d.ts.map +1 -0
- package/dist/channels/slack/self-identity.js +48 -0
- package/dist/channels/slack/sender-name.d.ts +17 -0
- package/dist/channels/slack/sender-name.d.ts.map +1 -0
- package/dist/channels/slack/sender-name.js +87 -0
- package/dist/channels/slack/setup.js +1 -1
- package/dist/channels/slack/user-info.d.ts +15 -0
- package/dist/channels/slack/user-info.d.ts.map +1 -0
- package/dist/channels/slack/user-info.js +57 -0
- package/dist/docs/404.html +2 -2
- package/dist/docs/assets/{app.CJLKDVza.js → app.oyjtOr3W.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.C25zYVuc.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.BW9mrQmq.js → VPLocalSearchBox.D0P6J_UJ.js} +1 -1
- package/dist/docs/assets/chunks/{arc.D8ZOvM1m.js → arc.B0LY1J1h.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.CXEKhLW-.js → architectureDiagram-Q4EWVU46.dPduLUxY.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.BJkVKblr.js → baseUniq.B_Ohm21h.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.DQDbHxor.js → blockDiagram-DXYQGD6D.B4zcanaJ.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.ByMD6LYM.js → c4Diagram-AHTNJAMY.D9Iw21nx.js} +1 -1
- package/dist/docs/assets/chunks/channel.CRUyWDV-.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.Dtq1aVI9.js → chunk-4BX2VUAB.DDVwRShI.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BL_XrkoQ.js → chunk-4TB4RGXK.DsYcdn1i.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BDPXu94_.js → chunk-55IACEB6.BzzQvcYp.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.DhGOQj4k.js → chunk-EDXVE4YY.BMiXZ7FX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.DSF5nr8v.js → chunk-FMBD7UC4.D_mBcLoc.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.Day7wayw.js → chunk-OYMX7WX6.CMVjWVMx.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.CpBEC0zA.js → chunk-QZHKN3VN.BG-FrPv9.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.X_7rY1rx.js → chunk-YZCP3GAM.CkFE1ap3.js} +1 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.CG_UObcQ.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.CG_UObcQ.js +1 -0
- package/dist/docs/assets/chunks/clone.NYSZ9qZN.js +1 -0
- package/dist/docs/assets/chunks/{cose-bilkent-S5V4N54A.BVRmi2ko.js → cose-bilkent-S5V4N54A.BVNnCTvY.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.Dei9oslB.js → dagre-KV5264BT.CDN5PR9l.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD._M-efGt7.js → diagram-5BDNPKRD.DQRUlT-i.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.D1Vmhfsj.js → diagram-G4DWMVQ6.CoeblYQT.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.cE1bmvAC.js → diagram-MMDJMWI5.DW3ymjl0.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.DkXAfznP.js → diagram-TYMM5635.BP0uN4Jw.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.DH_pSwPg.js → erDiagram-SMLLAGMA.DVFUWEn4.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.kAWVN9j1.js → flowDiagram-DWJPFMVM.HU-eHspv.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.8r0w49-p.js → ganttDiagram-T4ZO3ILL.DHNhXijY.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.BDa7Bi1i.js → gitGraphDiagram-UUTBAWPF.DkISXcO3.js} +1 -1
- package/dist/docs/assets/chunks/{graph.BMPXHz_B.js → graph.CCV0fuRR.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.BmlcqewS.js → infoDiagram-42DDH7IO.bgILzOoc.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A.CVSEQSul.js → ishikawaDiagram-UXIWVN3A.CuryXC0F.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.BpeWJ5n-.js → journeyDiagram-VCZTEJTY.BL1Pr-wu.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.DHbDXuxB.js → kanban-definition-6JOO6SKY.BbGjvk4l.js} +1 -1
- package/dist/docs/assets/chunks/{layout.CzrCDgkP.js → layout.C4PfdldS.js} +1 -1
- package/dist/docs/assets/chunks/{linear.HwBsflwN.js → linear.C3xD1T6X.js} +1 -1
- package/dist/docs/assets/chunks/{min.DqGHolT3.js → min.CzgRAQ9c.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.ZYGlOawh.js → mindmap-definition-QFDTVHPH.CA9rSWum.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.C2KRXlNR.js → pieDiagram-DEJITSTG.B8MprgJu.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.CHj3Qefp.js → quadrantDiagram-34T5L4WZ.DndDwbKT.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.B1L4Tf7k.js → requirementDiagram-MS252O5E.Zhfgwlnn.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.dNR2yi1B.js → sankeyDiagram-XADWPNL6.B6RRm6N5.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.BrvQ3C6m.js → sequenceDiagram-FGHM5R23.Bfmz-1PN.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.BtehEykA.js → stateDiagram-FHFEXIEX.gbrdNqgj.js} +1 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.DOOmulfQ.js +1 -0
- package/dist/docs/assets/chunks/{theme.BDHBZUkP.js → theme.gpWjytMh.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Bn7nhqEN.js → timeline-definition-GMOUNBTQ.Bl1l7M1f.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.DKhc38sz.js → vennDiagram-DHZGUBPP.Dfle4U0d.js} +1 -1
- package/dist/docs/assets/chunks/{wardley-RL74JXVD.DOXQ0w8J.js → wardley-RL74JXVD.BJrCW6xc.js} +1 -1
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.Bbq5B2Ic.js → wardleyDiagram-NUSXRM2D.CM_4lmvZ.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.B77HE1K8.js → xychartDiagram-5P7HB3ND.CHT5X28R.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.BsgDqYPh.js → reference_cli.md.GwugN3n-.js} +5 -5
- package/dist/docs/assets/reference_cli.md.GwugN3n-.lean.js +1 -0
- package/dist/docs/assets/{reference_skills.md.ClkMoQsV.js → reference_skills.md.C0guGcH0.js} +3 -3
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +35 -35
- package/dist/docs/guides/agent-to-agent.html +35 -35
- package/dist/docs/guides/bitbucket.html +35 -35
- package/dist/docs/guides/cloud-agents.html +35 -35
- package/dist/docs/guides/convert-automation.html +35 -35
- package/dist/docs/guides/github.html +35 -35
- package/dist/docs/guides/gitlab.html +35 -35
- package/dist/docs/guides/grokbot-agents.html +35 -35
- package/dist/docs/guides/hooks.html +35 -35
- package/dist/docs/guides/improve.html +35 -35
- package/dist/docs/guides/jev.html +35 -35
- package/dist/docs/guides/mcp-oauth.html +35 -35
- package/dist/docs/guides/opentelemetry.html +35 -35
- package/dist/docs/guides/slack.html +35 -35
- package/dist/docs/guides/webhooks.html +35 -35
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +35 -35
- package/dist/docs/index.html +35 -35
- package/dist/docs/llms-full.txt +20 -9
- package/dist/docs/quickstart.html +35 -35
- package/dist/docs/reference/agent-config.html +35 -35
- package/dist/docs/reference/artifacts.html +35 -35
- package/dist/docs/reference/channels.html +35 -35
- package/dist/docs/reference/cli.html +39 -39
- package/dist/docs/reference/cli.md +20 -9
- package/dist/docs/reference/connections.html +35 -35
- package/dist/docs/reference/evals.html +35 -35
- package/dist/docs/reference/extensions.html +35 -35
- package/dist/docs/reference/hooks.html +35 -35
- package/dist/docs/reference/http-api.html +35 -35
- package/dist/docs/reference/instructions.html +35 -35
- package/dist/docs/reference/playground.html +35 -35
- package/dist/docs/reference/project-layout.html +35 -35
- package/dist/docs/reference/prompt.html +35 -35
- package/dist/docs/reference/schedules.html +35 -35
- package/dist/docs/reference/sessions.html +35 -35
- package/dist/docs/reference/skills.html +38 -38
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +35 -35
- package/dist/docs/templates/grokbot-agents.html +35 -35
- package/dist/docs/templates/security-reviewer.html +35 -35
- package/dist/docs/templates/thermo-quality-review.html +35 -35
- package/dist/docs/templates/thermo-review.html +35 -35
- package/dist/docs/templates/triage.html +35 -35
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +14 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +99 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +19 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +71 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +9 -5
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +3 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +3 -2
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/files-backends/cursor-hosted.d.ts +22 -83
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +46 -160
- package/dist/files.d.ts +9 -32
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +7 -32
- package/dist/internal/artifacts-store.d.ts +13 -25
- package/dist/internal/artifacts-store.d.ts.map +1 -1
- package/dist/internal/artifacts-store.js +25 -46
- package/dist/internal/cli-ax.d.ts +10 -17
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +87 -155
- package/dist/internal/cli-bitbucket.js +5 -5
- package/dist/internal/cli-deploy.d.ts +4 -1
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +117 -20
- package/dist/internal/cli-github.js +13 -13
- package/dist/internal/cli-gitlab.js +5 -5
- package/dist/internal/continuation-identity.d.ts +2 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +4 -0
- package/dist/internal/conversation-mirror.d.ts +9 -38
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +62 -68
- package/dist/internal/cursor/account-mcp.d.ts +1 -1
- package/dist/internal/cursor/account-mcp.js +1 -1
- package/dist/internal/cursor/backend-client.js +1 -1
- package/dist/internal/cursor/github-credentials.js +3 -3
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +6 -2
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-bound-secrets.js +13 -2
- package/dist/internal/cursor/hosted-store-secrets.d.ts +13 -37
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +13 -37
- package/dist/internal/cursor/store-api-client.d.ts +17 -39
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -1
- package/dist/internal/cursor/store-api-client.js +15 -37
- package/dist/internal/cursor-deployment-relay.js +3 -3
- 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/deploy-client.d.ts +55 -63
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +48 -28
- package/dist/internal/discovery/agent.d.ts +1 -1
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +4 -0
- package/dist/internal/discovery/extensions.d.ts +2 -1
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +11 -1
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +1 -0
- package/dist/internal/distribution.d.ts +2 -2
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +2 -2
- package/dist/internal/docs-site.js +3 -3
- package/dist/internal/eval-run-store.js +8 -8
- package/dist/internal/framework-file-storage.d.ts +10 -34
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +12 -39
- package/dist/internal/framework-storage-selection.d.ts +10 -46
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +15 -64
- package/dist/internal/github-fanout.js +2 -2
- package/dist/internal/handleAgentServeTrigger.d.ts +5 -8
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -1
- package/dist/internal/handleAgentServeTrigger.js +5 -8
- package/dist/internal/host-files.js +6 -9
- package/dist/internal/host-platforms.js +5 -5
- package/dist/internal/hosted-catch.d.ts +3 -2
- package/dist/internal/hosted-catch.d.ts.map +1 -1
- package/dist/internal/hosted-catch.js +27 -9
- package/dist/internal/hosted-delivery-protocol.d.ts +31 -8
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +102 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +32 -12
- package/dist/internal/hosted-execution-diag.d.ts +13 -24
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +11 -20
- package/dist/internal/hosted-execution-flush.d.ts +22 -10
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -1
- package/dist/internal/hosted-execution-flush.js +45 -9
- package/dist/internal/hosted-managed-automation.js +5 -5
- package/dist/internal/hosting.d.ts +5 -10
- package/dist/internal/hosting.d.ts.map +1 -1
- package/dist/internal/hosting.js +5 -10
- package/dist/internal/legacy-command-guard.d.ts +1 -4
- package/dist/internal/legacy-command-guard.d.ts.map +1 -1
- package/dist/internal/legacy-command-guard.js +2 -11
- package/dist/internal/listen-port.js +1 -1
- package/dist/internal/local-control-plane.js +6 -6
- package/dist/internal/logs-client.d.ts +20 -1
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +89 -1
- package/dist/internal/mcp-endpoint.js +1 -1
- package/dist/internal/otel/collector.js +1 -1
- package/dist/internal/otel/runtime.js +13 -13
- package/dist/internal/platform-schedule-sync.js +2 -2
- package/dist/internal/playground/toolchain.js +6 -6
- package/dist/internal/process-memory-telemetry.js +2 -2
- package/dist/internal/reminder-runner.d.ts +8 -3
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +51 -52
- package/dist/internal/resolve-prod-target.d.ts +1 -12
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +2 -32
- package/dist/internal/resolved-connections.js +8 -8
- package/dist/internal/run-client.d.ts +4 -3
- package/dist/internal/run-client.d.ts.map +1 -1
- package/dist/internal/run-client.js +98 -61
- package/dist/internal/runtime-dispatch-runner.d.ts +1 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +7 -1
- package/dist/internal/schedule-runner.js +1 -1
- package/dist/internal/sdk-runner.d.ts +4 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +37 -22
- package/dist/internal/server.d.ts +2 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +39 -38
- package/dist/internal/session-engine.d.ts +31 -44
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +67 -83
- package/dist/internal/session-run-log.d.ts +10 -24
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +13 -27
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +6 -3
- package/dist/internal/skills-sync.d.ts +3 -5
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +3 -5
- package/dist/internal/start-log-store.d.ts +7 -18
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +47 -24
- package/dist/internal/storage-coordinator.d.ts +7 -10
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +18 -20
- package/dist/internal/storage-roles.d.ts +5 -0
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/store-api-protocol.d.ts +12 -33
- package/dist/internal/store-api-protocol.d.ts.map +1 -1
- package/dist/internal/store-api-protocol.js +6 -22
- package/dist/internal/store-mirror.d.ts +4 -5
- package/dist/internal/store-mirror.d.ts.map +1 -1
- package/dist/internal/store-mirror.js +6 -8
- package/dist/internal/turn-lease-store.d.ts +12 -5
- package/dist/internal/turn-lease-store.d.ts.map +1 -1
- package/dist/internal/turn-lease-store.js +61 -8
- package/dist/internal/v2-hosting.d.ts +4 -7
- package/dist/internal/v2-hosting.d.ts.map +1 -1
- package/dist/internal/v2-hosting.js +4 -7
- package/dist/internal/workspace-sync.d.ts +3 -6
- package/dist/internal/workspace-sync.d.ts.map +1 -1
- package/dist/internal/workspace-sync.js +3 -6
- package/dist/internal/workspace.d.ts +10 -16
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +9 -14
- package/dist/memory.d.ts +17 -43
- package/dist/memory.d.ts.map +1 -1
- package/dist/memory.js +34 -80
- package/dist/playground/assets/index-DPKLl4C_.css +1 -0
- package/dist/playground/assets/index-MijLHTbB.js +71 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +8 -36
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted-v2.js +9 -37
- package/dist/storage-backends/cursor-hosted.d.ts +17 -30
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +14 -27
- package/dist/storage-protocol.d.ts +13 -38
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +14 -39
- package/dist/types.d.ts +29 -30
- package/dist/types.d.ts.map +1 -1
- package/docs/reference/cli.md +20 -9
- package/package.json +1 -1
- package/templates/pr-autofixer/bot/instructions.md +3 -3
- package/dist/docs/assets/chunks/@localSearchIndexroot.Bq-pxRXm.js +0 -1
- package/dist/docs/assets/chunks/channel.DCU8W1RP.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DwpXsM06.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DwpXsM06.js +0 -1
- package/dist/docs/assets/chunks/clone.DH6Mx2zB.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.kzD0-U89.js +0 -1
- package/dist/docs/assets/reference_cli.md.BsgDqYPh.lean.js +0 -1
- package/dist/playground/assets/index-6BbTPnaT.css +0 -1
- package/dist/playground/assets/index-CI7FAmOP.js +0 -71
- /package/dist/docs/assets/{reference_skills.md.ClkMoQsV.lean.js → reference_skills.md.C0guGcH0.lean.js} +0 -0
|
@@ -1,51 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cursor-managed durable files for hosted agents
|
|
3
|
-
* `ctx.host.files` bytes in an Agent Store on S3.
|
|
2
|
+
* Cursor-managed durable files for hosted agents.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Requests use the control-plane proxy and deployment pod credential, which
|
|
5
|
+
* scopes access to the deployment. Authors access these files through
|
|
6
|
+
* `ctx.host.files`; Cursor manages the storage bindings, so do not add their
|
|
7
|
+
* names to `hosting.secretNames`.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* store with the same requests. Cursor-managed v2 pods can instead be pinned
|
|
14
|
-
* (per deployment, at task-time bind) onto the engine-facing factory store API
|
|
15
|
-
* under `/internal/agentsdk/store`: same host, same credential, same stores
|
|
16
|
-
* and S3 objects, but flush-shaped — one control-plane request settles a whole
|
|
17
|
-
* `putMany` batch or a conditional delete, where `/v0` costs a presign POST
|
|
18
|
-
* plus stat GETs and a delete POST. The pin fails safe: an absent or
|
|
19
|
-
* unrecognized protocol value, or a source id that maps to neither deployment
|
|
20
|
-
* store role, keeps `/v0`.
|
|
21
|
-
*
|
|
22
|
-
* Two things follow. There is no Agent Store token: a token narrows an identity
|
|
23
|
-
* to one store and one capability, which is what a caller that cannot hold a
|
|
24
|
-
* credential needs (an in-pod FUSE daemon). This process holds the credential
|
|
25
|
-
* the token would be minted from, so a token bought a round trip, an expiry to
|
|
26
|
-
* manage, and a second auth path, and no privilege reduction. And there is no
|
|
27
|
-
* direct call to the store service: the API layer owns the policy, and the
|
|
28
|
-
* engine never addresses it.
|
|
29
|
-
*
|
|
30
|
-
* There is also no store lookup. Every request names this deployment's file
|
|
31
|
-
* store by the `agentStoreSourceId` the deploy pipeline pinned into the pod
|
|
32
|
-
* env as `AGENT_SERVE_STORE_SOURCE_ID` — provisioning the store at the same
|
|
33
|
-
* time, so by boot the store exists and the id resolves. The id is an
|
|
34
|
-
* address, not a credential: the server maps it to a store and authorizes
|
|
35
|
-
* every call against the deployment's own live service account, so holding
|
|
36
|
-
* it grants nothing, and this process never learns a store id it could use
|
|
37
|
-
* to ask for anyone else's.
|
|
38
|
-
*
|
|
39
|
-
* Locally, point `CURSOR_API_BASE_URL` at a backend that serves
|
|
40
|
-
* `/v0/agent-serve-files` and use a deployment SA key; off hosting the
|
|
41
|
-
* local-disk sink is the default instead.
|
|
42
|
-
*
|
|
43
|
-
* Writes are conditional. The store rejects unconditional writes, so every
|
|
44
|
-
* `put` first learns the current etag: `new` for a path we believe is absent,
|
|
45
|
-
* `etag` to replace what we last observed. A raced write comes back 412 and
|
|
46
|
-
* surfaces as {@link FileConflictError}, which is why this backend reports
|
|
47
|
-
* `etags: true` and `host.files.capabilities.conflictDetection` is honestly
|
|
48
|
-
* true.
|
|
9
|
+
* Writes use conditional etags. A raced write surfaces as
|
|
10
|
+
* {@link FileConflictError}, and the backend reports
|
|
11
|
+
* `host.files.capabilities.conflictDetection`.
|
|
49
12
|
*/
|
|
50
13
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
51
14
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -64,51 +27,25 @@ import { resolveCursorApiBaseUrl, resolveCursorApiFetch, resolveCursorApiKey, }
|
|
|
64
27
|
import { resolveDeploymentStoreSourceIdSync, resolveFrameworkStoreSourceIdSync, resolveStoreProtocolSync, storeProtocolEnablesFactoryFlush, } from "../internal/cursor/hosted-store-secrets.js";
|
|
65
28
|
import { createAgentStorePresignedUrlValidatorForBackend } from "./agent-store-presigned-url.js";
|
|
66
29
|
const AGENT_SERVE_FILES_PATH = "/v0/agent-serve-files";
|
|
67
|
-
/**
|
|
68
|
-
* Engine-facing store API on the factory service — same host, different path
|
|
69
|
-
* family. Selected per pod by the task-bound protocol pin
|
|
70
|
-
* ({@link resolveStoreProtocolSync}); the server resolves the deployment and
|
|
71
|
-
* its stores from the pod credential, so requests carry a store *role*
|
|
72
|
-
* (`deployment` | `framework`), never a store id. One flush request replaces
|
|
73
|
-
* the presign POST plus the stat GETs and delete POST a turn costs on `/v0`.
|
|
74
|
-
*/
|
|
30
|
+
/** Managed endpoint for batched file operations. */
|
|
75
31
|
const AGENTSDK_STORE_PATH = "/internal/agentsdk/store";
|
|
76
32
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* user secrets. Its presence is the signal that a durable store exists and
|
|
80
|
-
* the hosted control plane is reachable; a deployment without one (no
|
|
81
|
-
* service account yet) has no store, and this backend is not selected.
|
|
33
|
+
* Platform-managed identifier for the author-facing file store. Do not add
|
|
34
|
+
* it to `hosting.secretNames`.
|
|
82
35
|
*/
|
|
83
36
|
export const AGENT_SERVE_STORE_SOURCE_ID_ENV_VAR = "AGENT_SERVE_STORE_SOURCE_ID";
|
|
84
37
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* (`ctx.host.files`, skills, memory, artifacts) and is browsable and
|
|
88
|
-
* mountable; the framework store carries engine-owned session state —
|
|
89
|
-
* session records, event transcripts, hosted-execution run logs,
|
|
90
|
-
* continuation index, and the SDK conversation mirror — and is never
|
|
91
|
-
* exposed to authors or models.
|
|
92
|
-
* Provisioned by the v2 deploy pipeline alongside the user store; v1
|
|
93
|
-
* deployments have only the user store.
|
|
38
|
+
* Platform-managed identifier for framework-owned state. Authors and models
|
|
39
|
+
* cannot access this storage through `host.files` or `host.kv`.
|
|
94
40
|
*/
|
|
95
41
|
export const AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID_ENV_VAR = "AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID";
|
|
96
42
|
/** Cap on the per-process etag cache; a miss costs a lookup, not correctness. */
|
|
97
43
|
const MAX_REMEMBERED_ETAGS = 1000;
|
|
98
44
|
/** Bounded directory page for point lookups. */
|
|
99
45
|
const DIRECTORY_PAGE_SIZE = 1000;
|
|
100
|
-
/**
|
|
101
|
-
* Paths per presign call in {@link FileSink.getMany}, matching the factory
|
|
102
|
-
* `/read` route's server-side `MAX_READ_PATHS`. The whole point of the batch:
|
|
103
|
-
* the factory wire's per-deployment rate limiter counts requests, not files,
|
|
104
|
-
* so a restore that used to spend N `/read` calls now spends ceil(N/100).
|
|
105
|
-
*/
|
|
46
|
+
/** Paths requested in each {@link FileSink.getMany} batch. */
|
|
106
47
|
const READ_PRESIGN_BATCH_MAX = 100;
|
|
107
|
-
/**
|
|
108
|
-
* Concurrent presigned-URL downloads inside one {@link FileSink.getMany}
|
|
109
|
-
* batch — the S3 fan-out, not the control-plane call count. Matches the
|
|
110
|
-
* conversation mirror's historical `HYDRATE_DOWNLOAD_CONCURRENCY`.
|
|
111
|
-
*/
|
|
48
|
+
/** Concurrent downloads inside one {@link FileSink.getMany} batch. */
|
|
112
49
|
const GET_MANY_DOWNLOAD_CONCURRENCY = 8;
|
|
113
50
|
/** Stop paging a pathological directory rather than scanning forever. */
|
|
114
51
|
const MAX_DIRECTORY_PAGES = 20;
|
|
@@ -121,28 +58,23 @@ const MAX_LIST_WALK_PAGES = 1000;
|
|
|
121
58
|
/**
|
|
122
59
|
* True on Cursor-managed hosting with a provisioned file store.
|
|
123
60
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* with the pod. Instead the store is detected, and a missing credential fails
|
|
128
|
-
* loudly when the sink is used.
|
|
61
|
+
* Availability depends on the storage binding rather than the credential.
|
|
62
|
+
* A missing credential therefore fails loudly instead of selecting local
|
|
63
|
+
* storage for a managed deployment.
|
|
129
64
|
*/
|
|
130
65
|
export function isCursorHostedFilesAvailable(env = process.env) {
|
|
131
66
|
return resolveDeploymentStoreSourceIdSync(env) !== undefined;
|
|
132
67
|
}
|
|
133
68
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* and must not take this path — they own the deployment store instead.
|
|
69
|
+
* True when local commands can use the signed-in user's file store. Managed
|
|
70
|
+
* deployments always use their deployment-scoped store instead.
|
|
137
71
|
*/
|
|
138
72
|
export function isCursorUserStoreFilesAvailable(env = process.env) {
|
|
139
73
|
var _a;
|
|
140
74
|
if (isCursorHostedFilesAvailable(env)) {
|
|
141
75
|
return false;
|
|
142
76
|
}
|
|
143
|
-
//
|
|
144
|
-
// keys; skip it in the test runner so `pnpm test` cannot poison
|
|
145
|
-
// `agent-serve/<agent>/skills/` on the caller's USER store.
|
|
77
|
+
// Avoid durable writes from credentials inherited by a test process.
|
|
146
78
|
if (env.VITEST === "true") {
|
|
147
79
|
return false;
|
|
148
80
|
}
|
|
@@ -152,9 +84,7 @@ export function isCursorUserStoreFilesAvailable(env = process.env) {
|
|
|
152
84
|
/**
|
|
153
85
|
* Cursor-hosted {@link FileSink}, selected on Cursor-managed hosting.
|
|
154
86
|
*
|
|
155
|
-
* Stateless apart from
|
|
156
|
-
* deployment's store by its pinned source id, so there is nothing to
|
|
157
|
-
* resolve, hold, or invalidate.
|
|
87
|
+
* Stateless apart from its bounded etag cache.
|
|
158
88
|
*/
|
|
159
89
|
export function cursorHostedFiles(options = {}) {
|
|
160
90
|
/**
|
|
@@ -176,12 +106,8 @@ export function cursorHostedFiles(options = {}) {
|
|
|
176
106
|
/**
|
|
177
107
|
* Run `call` against this deployment's files.
|
|
178
108
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* on every request. Resolved per call rather than once at construction so a
|
|
182
|
-
* misconfigured environment fails where the operation is, not where the
|
|
183
|
-
* sink was created — and so a protocol pin bound after serve start takes
|
|
184
|
-
* effect without a restart.
|
|
109
|
+
* Storage bindings and transport selection are resolved for each operation
|
|
110
|
+
* so platform updates do not require recreating the sink.
|
|
185
111
|
*/
|
|
186
112
|
function withFiles(call) {
|
|
187
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -190,10 +116,8 @@ export function cursorHostedFiles(options = {}) {
|
|
|
190
116
|
const sourceId = resolveStoreSourceId(options);
|
|
191
117
|
const protocol = (_b = (_a = options.resolveStoreProtocol) === null || _a === void 0 ? void 0 : _a.call(options)) !== null && _b !== void 0 ? _b : resolveStoreProtocolSync();
|
|
192
118
|
if (storeProtocolEnablesFactoryFlush(protocol)) {
|
|
193
|
-
// The
|
|
194
|
-
//
|
|
195
|
-
// local-dev override) has no role there and stays on `/v0`, as does any
|
|
196
|
-
// protocol value this runtime does not recognize.
|
|
119
|
+
// The batched transport addresses managed stores by role. An unknown
|
|
120
|
+
// store or transport stays on the compatibility path.
|
|
197
121
|
if (sourceId === resolveFrameworkStoreSourceIdSync()) {
|
|
198
122
|
return yield call({ wire: "flush", store: "framework" });
|
|
199
123
|
}
|
|
@@ -243,7 +167,7 @@ export function cursorHostedFiles(options = {}) {
|
|
|
243
167
|
return Object.assign({ body: new Uint8Array(yield response.arrayBuffer()) }, (etag === undefined ? {} : { etag }));
|
|
244
168
|
});
|
|
245
169
|
}
|
|
246
|
-
/** One page of
|
|
170
|
+
/** One page of a directory listing. */
|
|
247
171
|
function directoryPage(files, directory, pageToken) {
|
|
248
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
249
173
|
if (files.wire === "flush") {
|
|
@@ -259,7 +183,7 @@ export function cursorHostedFiles(options = {}) {
|
|
|
259
183
|
return yield storeGet(options, files.path(`?${query.toString()}`));
|
|
260
184
|
});
|
|
261
185
|
}
|
|
262
|
-
/** The unscoped whole-store listing
|
|
186
|
+
/** The unscoped whole-store listing. */
|
|
263
187
|
function unscopedListing(files) {
|
|
264
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
265
189
|
if (files.wire === "flush") {
|
|
@@ -390,10 +314,8 @@ export function cursorHostedFiles(options = {}) {
|
|
|
390
314
|
});
|
|
391
315
|
}
|
|
392
316
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* list (an outcome without a `url` — an oversize refusal — surfaces exactly
|
|
396
|
-
* like a `/v0` multipart answer: no single-part instruction for that key).
|
|
317
|
+
* Resolve upload instructions for one attempt. A response without a URL
|
|
318
|
+
* reports that the file cannot use the single-part upload path.
|
|
397
319
|
*/
|
|
398
320
|
function presignUploads(files, specs) {
|
|
399
321
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -418,9 +340,9 @@ export function cursorHostedFiles(options = {}) {
|
|
|
418
340
|
}
|
|
419
341
|
/**
|
|
420
342
|
* One presign call covering every spec, then parallel presigned PUTs.
|
|
421
|
-
* Outcomes are per spec: a
|
|
422
|
-
*
|
|
423
|
-
*
|
|
343
|
+
* Outcomes are per spec: a conflict or failed upload for one key never
|
|
344
|
+
* disturbs its batch siblings. Resolving the instructions is shared, so
|
|
345
|
+
* that request failing rejects the whole attempt.
|
|
424
346
|
*/
|
|
425
347
|
function attemptUploads(files, specs) {
|
|
426
348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -548,11 +470,7 @@ export function cursorHostedFiles(options = {}) {
|
|
|
548
470
|
}
|
|
549
471
|
// Unconditional write to a key this process has never observed:
|
|
550
472
|
// create-only first, learning the current etag only on conflict. Most
|
|
551
|
-
// such writes are
|
|
552
|
-
// per flush), and the old stat-before-every-put shape made the
|
|
553
|
-
// precondition lookup the single largest source of `agent-serve-files`
|
|
554
|
-
// list traffic — every fresh pod re-listed a directory per key before
|
|
555
|
-
// its first write.
|
|
473
|
+
// such writes are new, so avoid a read before every first write.
|
|
556
474
|
return { precondition: { new: true }, cachedEtagUsed: false };
|
|
557
475
|
}
|
|
558
476
|
return {
|
|
@@ -622,10 +540,7 @@ export function cursorHostedFiles(options = {}) {
|
|
|
622
540
|
return __awaiter(this, void 0, void 0, function* () {
|
|
623
541
|
return yield withFiles((files) => __awaiter(this, void 0, void 0, function* () {
|
|
624
542
|
var _a, _b;
|
|
625
|
-
//
|
|
626
|
-
// written, or deleted and now holding a tombstone — is a 404 on `/v0`
|
|
627
|
-
// and an absent entry on the flush wire. Either is absence, which
|
|
628
|
-
// `read()` reports as undefined, not a failure.
|
|
543
|
+
// A path with no live object is absent, not a storage failure.
|
|
629
544
|
let presigned;
|
|
630
545
|
try {
|
|
631
546
|
presigned =
|
|
@@ -660,12 +575,8 @@ export function cursorHostedFiles(options = {}) {
|
|
|
660
575
|
const bodies = yield withFiles((files) => __awaiter(this, void 0, void 0, function* () {
|
|
661
576
|
var _a;
|
|
662
577
|
if (files.wire !== "flush") {
|
|
663
|
-
//
|
|
664
|
-
//
|
|
665
|
-
// Bounded per-key gets keep the `/v0` absence semantics exact; the
|
|
666
|
-
// batch win belongs to the flush wire, whose contract is "an absent
|
|
667
|
-
// path is an absent entry" — and whose per-deployment rate limiter
|
|
668
|
-
// is the reason to spend fewer requests in the first place.
|
|
578
|
+
// This transport cannot distinguish one missing key from a failed
|
|
579
|
+
// batch, so preserve exact absence semantics with bounded reads.
|
|
669
580
|
return yield mapBounded([...keys], GET_MANY_DOWNLOAD_CONCURRENCY, (key) => __awaiter(this, void 0, void 0, function* () {
|
|
670
581
|
var _a, _b;
|
|
671
582
|
const presigned = yield storePost(options, files.path("/download"), { paths: [key] }).catch((error) => {
|
|
@@ -833,23 +744,11 @@ export function cursorHostedFiles(options = {}) {
|
|
|
833
744
|
};
|
|
834
745
|
}
|
|
835
746
|
/**
|
|
836
|
-
* Refuse
|
|
837
|
-
* bucket.
|
|
747
|
+
* Refuse an upload or download URL outside trusted storage hosts.
|
|
838
748
|
*
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
* address would otherwise steer file bytes somewhere the caller never chose.
|
|
843
|
-
* Same pin as the sibling sync client: production backends allow only the
|
|
844
|
-
* agent-stores bucket hosts, playground its bucket, and a local dev backend
|
|
845
|
-
* additionally admits loopback http for LocalStack.
|
|
846
|
-
*
|
|
847
|
-
* `CURSOR_HOSTED_FILES_DEV_PRESIGN_HOSTS` (comma-separated hostnames) admits
|
|
848
|
-
* extra https hosts. A laptop backend hosting agents on a shared cluster
|
|
849
|
-
* fronts its LocalStack with a public tunnel and exports this in the pod's
|
|
850
|
-
* start script; production start scripts never set it. Read once at module
|
|
851
|
-
* load, so authored agent code sharing this process cannot widen the list
|
|
852
|
-
* by mutating `process.env` later.
|
|
749
|
+
* This prevents a malformed service response from redirecting file bytes to
|
|
750
|
+
* another reachable host. Development additions are fixed at process start
|
|
751
|
+
* so authored agent code cannot widen the allowlist.
|
|
853
752
|
*/
|
|
854
753
|
function assertPresignedUrlSafe(options, raw) {
|
|
855
754
|
let url;
|
|
@@ -874,11 +773,8 @@ function assertPresignedUrlSafe(options, raw) {
|
|
|
874
773
|
return url.toString();
|
|
875
774
|
}
|
|
876
775
|
/**
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
*
|
|
880
|
-
* Fails loudly rather than defaulting: with no source id there is no store to
|
|
881
|
-
* address, and writing somewhere else silently is worse than not writing.
|
|
776
|
+
* Resolve the deployment-scoped file store. A missing binding fails instead
|
|
777
|
+
* of silently writing to another location.
|
|
882
778
|
*/
|
|
883
779
|
function resolveStoreSourceId(options) {
|
|
884
780
|
var _a, _b;
|
|
@@ -893,11 +789,7 @@ const DEV_PRESIGN_HOSTS = new Set(((_a = process.env.CURSOR_HOSTED_FILES_DEV_PRE
|
|
|
893
789
|
.split(",")
|
|
894
790
|
.map(host => host.trim().toLowerCase())
|
|
895
791
|
.filter(host => host.length > 0));
|
|
896
|
-
/**
|
|
897
|
-
* Public agent-serve-files API call. The pod credential is the whole authorization:
|
|
898
|
-
* the API forwards this caller's identity to the store service, which checks it
|
|
899
|
-
* against the store's live owner. There is no second, narrower credential.
|
|
900
|
-
*/
|
|
792
|
+
/** Send a file request with the deployment pod credential. */
|
|
901
793
|
function storePost(options, path, body) {
|
|
902
794
|
return __awaiter(this, void 0, void 0, function* () {
|
|
903
795
|
return yield postJson(options, `${resolveCursorApiBaseUrl(options)}${AGENT_SERVE_FILES_PATH}${path}`, body);
|
|
@@ -908,13 +800,7 @@ function storeGet(options, path) {
|
|
|
908
800
|
return yield sendJson(options, `${resolveCursorApiBaseUrl(options)}${AGENT_SERVE_FILES_PATH}${path}`, "GET");
|
|
909
801
|
});
|
|
910
802
|
}
|
|
911
|
-
/**
|
|
912
|
-
* Factory store API call — same base URL and pod credential as
|
|
913
|
-
* {@link storePost}, different path family. The server resolves the
|
|
914
|
-
* deployment (and the addressed store role) from the credential. The
|
|
915
|
-
* domain-call lane one path family deeper is NOT here: it belongs to the
|
|
916
|
-
* store API client (`../internal/cursor/store-api-client.ts`).
|
|
917
|
-
*/
|
|
803
|
+
/** Send a batched file request with the deployment pod credential. */
|
|
918
804
|
function flushPost(options, path, body) {
|
|
919
805
|
return __awaiter(this, void 0, void 0, function* () {
|
|
920
806
|
return yield postJson(options, `${resolveCursorApiBaseUrl(options)}${AGENTSDK_STORE_PATH}${path}`, body);
|
|
@@ -968,7 +854,7 @@ function describeError(parsed, status) {
|
|
|
968
854
|
}
|
|
969
855
|
return `HTTP ${status}`;
|
|
970
856
|
}
|
|
971
|
-
/**
|
|
857
|
+
/** Normalize quoted etags before comparison. */
|
|
972
858
|
function normalizeEtag(raw) {
|
|
973
859
|
if (raw === null) {
|
|
974
860
|
return undefined;
|
package/dist/files.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface FileSink {
|
|
|
77
77
|
}): Promise<FileSinkPutResult | void>;
|
|
78
78
|
/**
|
|
79
79
|
* Write several values in one round trip where the backend can (one
|
|
80
|
-
*
|
|
80
|
+
* request instead of one per key). Optional; callers fall back to
|
|
81
81
|
* sequential {@link put}. Outcomes are settled per entry, index-aligned
|
|
82
82
|
* with the input: one key's conflict or failure never rejects its batch
|
|
83
83
|
* siblings. Per-key semantics (preconditions, conflict errors, etag
|
|
@@ -94,10 +94,10 @@ export interface FileSink {
|
|
|
94
94
|
get(key: string): Promise<FileSinkBody | Uint8Array | undefined>;
|
|
95
95
|
/**
|
|
96
96
|
* Read several values in few round trips where the backend can (one
|
|
97
|
-
*
|
|
97
|
+
* request per batch instead of one per key). Optional; callers fall
|
|
98
98
|
* back to bounded per-key {@link get}. The result is index-aligned with
|
|
99
99
|
* `keys`; a miss is `undefined`, matching {@link get}. Any transport or
|
|
100
|
-
* download failure rejects the whole call
|
|
100
|
+
* download failure rejects the whole call; a partial result is never
|
|
101
101
|
* returned, so a caller cannot mistake a failed batch for absence.
|
|
102
102
|
*/
|
|
103
103
|
getMany?(keys: readonly string[]): Promise<Array<FileSinkBody | Uint8Array | undefined>>;
|
|
@@ -137,29 +137,14 @@ export declare const fileKeys: {
|
|
|
137
137
|
readonly sessionPrefix: (agent: string, sessionId: string) => string;
|
|
138
138
|
};
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
141
|
-
* Mirrors `AGENT_SERVE_USER_STORE_FILES_SOURCE_ID` in `@anysphere/constants`
|
|
142
|
-
* (not a dependency of this published package).
|
|
140
|
+
* Stable identifier for the signed-in user's file store.
|
|
143
141
|
*/
|
|
144
142
|
export declare const AGENT_SERVE_USER_STORE_FILES_SOURCE_ID = "user";
|
|
145
|
-
/**
|
|
146
|
-
* Store-root prefix for Agent Serve data on a USER store. Mirrors
|
|
147
|
-
* `AGENT_SERVE_USER_STORE_KEY_PREFIX` in `@anysphere/constants`.
|
|
148
|
-
*/
|
|
143
|
+
/** Store-root prefix for agent data in a user file store. */
|
|
149
144
|
export declare const AGENT_SERVE_USER_STORE_KEY_PREFIX = "agent-serve";
|
|
150
145
|
/**
|
|
151
|
-
* Framework-owned keys for
|
|
152
|
-
*
|
|
153
|
-
* skills and workspace seeds synced for cloud turns, and the cross-session
|
|
154
|
-
* memory journal. Kept out of `files/` so author listings never see
|
|
155
|
-
* framework rows.
|
|
156
|
-
*
|
|
157
|
-
* Skills sit at store-root `skills/<name>/…` so exec-daemon's
|
|
158
|
-
* `--agent-store-skills-dir` walk finds them the same way it finds user-store
|
|
159
|
-
* skills. Workspace seeds sit at store-root `workspace/…` so the mount path
|
|
160
|
-
* the first cloud prompt names stays short. Per-turn `workspaceFiles` sit at
|
|
161
|
-
* `sessions/<sessionId>/workspace/…` on that same shared mount. Memory and
|
|
162
|
-
* artifacts stay under {@link STORAGE_KEY_ROOT}.
|
|
146
|
+
* Framework-owned keys for artifacts, skills, workspace seeds, memory, and
|
|
147
|
+
* conversation checkpoints. They stay outside author `host.files` listings.
|
|
163
148
|
*/
|
|
164
149
|
declare function createAgentStoreKeys(root: string): {
|
|
165
150
|
readonly artifactRow: (agent: string, id: string) => string;
|
|
@@ -185,17 +170,9 @@ declare function createAgentStoreKeys(root: string): {
|
|
|
185
170
|
export type AgentStoreKeys = ReturnType<typeof createAgentStoreKeys>;
|
|
186
171
|
export declare const agentStoreKeys: AgentStoreKeys;
|
|
187
172
|
export declare const agentSdkAgentStoreKeys: AgentStoreKeys;
|
|
188
|
-
/**
|
|
189
|
-
* Deployment store FUSE mount on cloud-runtime VMs. Mirrors
|
|
190
|
-
* `AGENT_STORE_MOUNT_ROOT` / `AGENT_SERVE_DEPLOYMENT_STORE_MOUNT_NAME` in
|
|
191
|
-
* `@anysphere/constants` (not a dependency of this published package).
|
|
192
|
-
*/
|
|
173
|
+
/** Mounted path for deployment files when the host exposes one. */
|
|
193
174
|
export declare const DEPLOYMENT_STORE_MOUNT_PATH = "/cursor/stores/deployment";
|
|
194
|
-
/**
|
|
195
|
-
* USER store FUSE mount on personal-key cloud-runtime VMs. Mirrors
|
|
196
|
-
* `AGENT_STORE_MOUNT_ROOT` / `AGENT_STORE_USER_MOUNT_NAME` in
|
|
197
|
-
* `@anysphere/constants`.
|
|
198
|
-
*/
|
|
175
|
+
/** Mounted path for user files when the host exposes one. */
|
|
199
176
|
export declare const USER_STORE_MOUNT_PATH = "/cursor/stores/user";
|
|
200
177
|
/** Errors raised by the file surface. Thrown by sinks and by the framework. */
|
|
201
178
|
export declare class FileConflictError extends Error {
|
package/dist/files.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/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AAM,EACZ,QAAQ,EAAE,MAAM,EAI1B;CACF"}
|
package/dist/files.js
CHANGED
|
@@ -48,29 +48,14 @@ export const fileKeys = {
|
|
|
48
48
|
sessionPrefix: (agent, sessionId) => `${STORAGE_KEY_ROOT}/${agent}/files/sessions/${sessionId}/`,
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* Mirrors `AGENT_SERVE_USER_STORE_FILES_SOURCE_ID` in `@anysphere/constants`
|
|
53
|
-
* (not a dependency of this published package).
|
|
51
|
+
* Stable identifier for the signed-in user's file store.
|
|
54
52
|
*/
|
|
55
53
|
export const AGENT_SERVE_USER_STORE_FILES_SOURCE_ID = "user";
|
|
56
|
-
/**
|
|
57
|
-
* Store-root prefix for Agent Serve data on a USER store. Mirrors
|
|
58
|
-
* `AGENT_SERVE_USER_STORE_KEY_PREFIX` in `@anysphere/constants`.
|
|
59
|
-
*/
|
|
54
|
+
/** Store-root prefix for agent data in a user file store. */
|
|
60
55
|
export const AGENT_SERVE_USER_STORE_KEY_PREFIX = "agent-serve";
|
|
61
56
|
/**
|
|
62
|
-
* Framework-owned keys for
|
|
63
|
-
*
|
|
64
|
-
* skills and workspace seeds synced for cloud turns, and the cross-session
|
|
65
|
-
* memory journal. Kept out of `files/` so author listings never see
|
|
66
|
-
* framework rows.
|
|
67
|
-
*
|
|
68
|
-
* Skills sit at store-root `skills/<name>/…` so exec-daemon's
|
|
69
|
-
* `--agent-store-skills-dir` walk finds them the same way it finds user-store
|
|
70
|
-
* skills. Workspace seeds sit at store-root `workspace/…` so the mount path
|
|
71
|
-
* the first cloud prompt names stays short. Per-turn `workspaceFiles` sit at
|
|
72
|
-
* `sessions/<sessionId>/workspace/…` on that same shared mount. Memory and
|
|
73
|
-
* artifacts stay under {@link STORAGE_KEY_ROOT}.
|
|
57
|
+
* Framework-owned keys for artifacts, skills, workspace seeds, memory, and
|
|
58
|
+
* conversation checkpoints. They stay outside author `host.files` listings.
|
|
74
59
|
*/
|
|
75
60
|
function createAgentStoreKeys(root) {
|
|
76
61
|
return {
|
|
@@ -91,26 +76,16 @@ function createAgentStoreKeys(root) {
|
|
|
91
76
|
memoryDir: (agent) => `${root}/${agent}/memory`,
|
|
92
77
|
memoryJournal: (agent) => `${root}/${agent}/memory/journal.jsonl`,
|
|
93
78
|
memoryJournalRotated: (agent, stamp) => `${root}/${agent}/memory/journal-${stamp}.jsonl`,
|
|
94
|
-
//
|
|
95
|
-
// store APIs): one manifest per SDK agent id plus its content-addressed
|
|
96
|
-
// checkpoint blobs. See internal/conversation-mirror.ts.
|
|
79
|
+
// One conversation manifest plus its content-addressed checkpoint blobs.
|
|
97
80
|
conversationManifest: (agent, sdkAgentId) => `${root}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/manifest.json`,
|
|
98
81
|
conversationBlob: (agent, sdkAgentId, blobId) => `${root}/${agent}/conversations/${encodeURIComponent(sdkAgentId)}/blobs/${encodeURIComponent(blobId)}`,
|
|
99
82
|
};
|
|
100
83
|
}
|
|
101
84
|
export const agentStoreKeys = createAgentStoreKeys(STORAGE_KEY_ROOT);
|
|
102
85
|
export const agentSdkAgentStoreKeys = createAgentStoreKeys(AGENTSDK_STORAGE_KEY_ROOT);
|
|
103
|
-
/**
|
|
104
|
-
* Deployment store FUSE mount on cloud-runtime VMs. Mirrors
|
|
105
|
-
* `AGENT_STORE_MOUNT_ROOT` / `AGENT_SERVE_DEPLOYMENT_STORE_MOUNT_NAME` in
|
|
106
|
-
* `@anysphere/constants` (not a dependency of this published package).
|
|
107
|
-
*/
|
|
86
|
+
/** Mounted path for deployment files when the host exposes one. */
|
|
108
87
|
export const DEPLOYMENT_STORE_MOUNT_PATH = "/cursor/stores/deployment";
|
|
109
|
-
/**
|
|
110
|
-
* USER store FUSE mount on personal-key cloud-runtime VMs. Mirrors
|
|
111
|
-
* `AGENT_STORE_MOUNT_ROOT` / `AGENT_STORE_USER_MOUNT_NAME` in
|
|
112
|
-
* `@anysphere/constants`.
|
|
113
|
-
*/
|
|
88
|
+
/** Mounted path for user files when the host exposes one. */
|
|
114
89
|
export const USER_STORE_MOUNT_PATH = "/cursor/stores/user";
|
|
115
90
|
/** Errors raised by the file surface. Thrown by sinks and by the framework. */
|
|
116
91
|
export class FileConflictError extends Error {
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* Durable artifact rows and payloads behind `ctx.artifacts`
|
|
3
3
|
* ({@link ArtifactsApi}).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* deploys and are visible on cloud VMs under the store mount); otherwise
|
|
8
|
-
* they land under `--state-root/artifacts` on local disk.
|
|
5
|
+
* Cursor-managed hosting preserves artifacts across deployment replacement.
|
|
6
|
+
* Self-hosted agents store them under `--state-root/artifacts`.
|
|
9
7
|
*/
|
|
10
8
|
import { type FileSink } from "../files.js";
|
|
11
9
|
import type { ArtifactListFilter, ArtifactPage, ArtifactPageOptions, ArtifactRecord, ArtifactsConfig, ArtifactTagInput } from "../types.js";
|
|
@@ -22,8 +20,8 @@ export interface CreateArtifactsStoreOptions {
|
|
|
22
20
|
sink?: FileSink;
|
|
23
21
|
/**
|
|
24
22
|
* Whether `tag` enforces {@link ArtifactsConfig.max} by listing and
|
|
25
|
-
* deleting. Default true.
|
|
26
|
-
*
|
|
23
|
+
* deleting. Default true. Managed architecture v2 passes false so tagging
|
|
24
|
+
* never performs a full artifact listing.
|
|
27
25
|
*/
|
|
28
26
|
enforceCap?: () => boolean;
|
|
29
27
|
}
|
|
@@ -60,7 +58,7 @@ export declare class ArtifactsStore {
|
|
|
60
58
|
list(filter?: ArtifactListFilter): Promise<ArtifactRecord[]>;
|
|
61
59
|
/**
|
|
62
60
|
* Bounded cursor pagination, newest-updated first. On a store whose
|
|
63
|
-
* listing tracks mtimes
|
|
61
|
+
* listing tracks mtimes, a page hydrates only
|
|
64
62
|
* the rows it examines — roughly `limit` bodies, never the whole store.
|
|
65
63
|
* Row-body order is the listing's mtime order (upserts rewrite the row,
|
|
66
64
|
* so mtime tracks `updatedAt`; same argument as eviction). The
|
|
@@ -68,15 +66,15 @@ export declare class ArtifactsStore {
|
|
|
68
66
|
* exactly by `updatedAt`.
|
|
69
67
|
*
|
|
70
68
|
* `matches` is a host-side *visibility* predicate composed with the
|
|
71
|
-
* public filter
|
|
69
|
+
* public filter. The engine passes session ownership through it. Its
|
|
72
70
|
* presence forces the exact hydrated lane: the metadata lane's cursor
|
|
73
|
-
* and
|
|
74
|
-
*
|
|
71
|
+
* and short-page continuation include hidden records. Returning them to a
|
|
72
|
+
* caller who cannot see those records would create a
|
|
75
73
|
* side channel (existence, count within the scan budget, boundary
|
|
76
74
|
* mtimes and cohort depths of hidden rows) that the pre-pagination
|
|
77
75
|
* filtered list never had. The exact lane's cursor names only a record
|
|
78
76
|
* the caller received, and continues only while more *visible* records
|
|
79
|
-
* remain
|
|
77
|
+
* remain, at the bounded cost of hydrating the full set.
|
|
80
78
|
*/
|
|
81
79
|
page(options?: ArtifactPageOptions & {
|
|
82
80
|
matches?: (record: ArtifactRecord) => boolean;
|
|
@@ -106,21 +104,11 @@ export declare class ArtifactsStore {
|
|
|
106
104
|
/**
|
|
107
105
|
* Trim toward the retention cap from listing metadata alone. Past the
|
|
108
106
|
* cap this runs on every new-row insert, so it must not hydrate row
|
|
109
|
-
* bodies
|
|
110
|
-
*
|
|
111
|
-
* 2026-09-18 read storm on the security-reviewer deployment. The store
|
|
112
|
-
* listing carries last-modified metadata, and a row is rewritten on
|
|
113
|
-
* every upsert, so listing mtime orders rows the same way their
|
|
114
|
-
* `updatedAt` does.
|
|
107
|
+
* bodies. The listing carries last-modified metadata, and each upsert
|
|
108
|
+
* rewrites its row, so listing mtime orders rows like `updatedAt`.
|
|
115
109
|
*
|
|
116
|
-
* Deletes are capped per pass
|
|
117
|
-
*
|
|
118
|
-
* store far past the cap (evictions failed during the 2026-09-19 read
|
|
119
|
-
* throttling and the backlog grew unchecked) must drain amortized
|
|
120
|
-
* across inserts, not wedge one insert deleting the whole backlog — on
|
|
121
|
-
* 2026-09-20 an uncapped pass held security-reviewer tags for hours and
|
|
122
|
-
* tripled review stage durations. Steady state (excess of 1) is
|
|
123
|
-
* unaffected.
|
|
110
|
+
* Deletes are capped per pass so a store far past the cap drains across
|
|
111
|
+
* inserts instead of delaying one insert for the entire backlog.
|
|
124
112
|
*/
|
|
125
113
|
private evictPastCap;
|
|
126
114
|
/** The `excess` oldest row ids, cheapest available ordering first. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts-store.d.ts","sourceRoot":"","sources":["../../src/internal/artifacts-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"artifacts-store.d.ts","sourceRoot":"","sources":["../../src/internal/artifacts-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5D,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AAGrB,2EAA2E;AAC3E,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAChD,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AA4D9C,MAAM,WAAW,2BAA2B;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;CAC5B;AAED,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAEhD;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC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