@cursor/bdk 0.2.5 → 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 +55 -54
- package/dist/channels/github/github-channel.d.ts +4 -4
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +39 -13
- 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/eval-directive.js +1 -1
- 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.94Iu5dyD.js → app.oyjtOr3W.js} +4 -4
- package/dist/docs/assets/chunks/@localSearchIndexroot.C25zYVuc.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DTKFDlBr.js → VPLocalSearchBox.D0P6J_UJ.js} +1 -1
- package/dist/docs/assets/chunks/{arc.DuzwHEeg.js → arc.B0LY1J1h.js} +1 -1
- package/dist/docs/assets/chunks/{architectureDiagram-Q4EWVU46.C6lyhLs0.js → architectureDiagram-Q4EWVU46.dPduLUxY.js} +1 -1
- package/dist/docs/assets/chunks/{baseUniq.DUNEWlY8.js → baseUniq.B_Ohm21h.js} +1 -1
- package/dist/docs/assets/chunks/{blockDiagram-DXYQGD6D.CXOQGI0O.js → blockDiagram-DXYQGD6D.B4zcanaJ.js} +1 -1
- package/dist/docs/assets/chunks/{c4Diagram-AHTNJAMY.BYdPE-Oe.js → c4Diagram-AHTNJAMY.D9Iw21nx.js} +1 -1
- package/dist/docs/assets/chunks/channel.CRUyWDV-.js +1 -0
- package/dist/docs/assets/chunks/{chunk-4BX2VUAB.YIV9HeX0.js → chunk-4BX2VUAB.DDVwRShI.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-4TB4RGXK.BG80DEOc.js → chunk-4TB4RGXK.DsYcdn1i.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-55IACEB6.BDKJSZQc.js → chunk-55IACEB6.BzzQvcYp.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-EDXVE4YY.CtYnQqts.js → chunk-EDXVE4YY.BMiXZ7FX.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-FMBD7UC4.CityOth-.js → chunk-FMBD7UC4.D_mBcLoc.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-OYMX7WX6.CMD22CQX.js → chunk-OYMX7WX6.CMVjWVMx.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-QZHKN3VN.WWpc3ND0.js → chunk-QZHKN3VN.BG-FrPv9.js} +1 -1
- package/dist/docs/assets/chunks/{chunk-YZCP3GAM.BMg-yhj3.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.Buu_LC5q.js → cose-bilkent-S5V4N54A.BVNnCTvY.js} +1 -1
- package/dist/docs/assets/chunks/{dagre-KV5264BT.DW7onj6E.js → dagre-KV5264BT.CDN5PR9l.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-5BDNPKRD.B3NxIbEV.js → diagram-5BDNPKRD.DQRUlT-i.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-G4DWMVQ6.BJvN6Vkv.js → diagram-G4DWMVQ6.CoeblYQT.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-MMDJMWI5.wfRWrexs.js → diagram-MMDJMWI5.DW3ymjl0.js} +1 -1
- package/dist/docs/assets/chunks/{diagram-TYMM5635.7QtjSYio.js → diagram-TYMM5635.BP0uN4Jw.js} +1 -1
- package/dist/docs/assets/chunks/{erDiagram-SMLLAGMA.jxPgDH1t.js → erDiagram-SMLLAGMA.DVFUWEn4.js} +1 -1
- package/dist/docs/assets/chunks/{flowDiagram-DWJPFMVM.BhDWA-TO.js → flowDiagram-DWJPFMVM.HU-eHspv.js} +1 -1
- package/dist/docs/assets/chunks/{ganttDiagram-T4ZO3ILL.Ijq8iYKv.js → ganttDiagram-T4ZO3ILL.DHNhXijY.js} +1 -1
- package/dist/docs/assets/chunks/{gitGraphDiagram-UUTBAWPF.DXpfW4YG.js → gitGraphDiagram-UUTBAWPF.DkISXcO3.js} +1 -1
- package/dist/docs/assets/chunks/{graph.CoPlssRl.js → graph.CCV0fuRR.js} +1 -1
- package/dist/docs/assets/chunks/{infoDiagram-42DDH7IO.eJuv_EOz.js → infoDiagram-42DDH7IO.bgILzOoc.js} +1 -1
- package/dist/docs/assets/chunks/{ishikawaDiagram-UXIWVN3A._OEzenCR.js → ishikawaDiagram-UXIWVN3A.CuryXC0F.js} +1 -1
- package/dist/docs/assets/chunks/{journeyDiagram-VCZTEJTY.CwlTjirB.js → journeyDiagram-VCZTEJTY.BL1Pr-wu.js} +1 -1
- package/dist/docs/assets/chunks/{kanban-definition-6JOO6SKY.DSp_C8cZ.js → kanban-definition-6JOO6SKY.BbGjvk4l.js} +1 -1
- package/dist/docs/assets/chunks/{layout.Bms9s7uB.js → layout.C4PfdldS.js} +1 -1
- package/dist/docs/assets/chunks/{linear.BjnmB4je.js → linear.C3xD1T6X.js} +1 -1
- package/dist/docs/assets/chunks/{min.CKkYlMsn.js → min.CzgRAQ9c.js} +1 -1
- package/dist/docs/assets/chunks/{mindmap-definition-QFDTVHPH.T2d0vJ7X.js → mindmap-definition-QFDTVHPH.CA9rSWum.js} +1 -1
- package/dist/docs/assets/chunks/{pieDiagram-DEJITSTG.DU0RoCvx.js → pieDiagram-DEJITSTG.B8MprgJu.js} +1 -1
- package/dist/docs/assets/chunks/{quadrantDiagram-34T5L4WZ.9QZjM-x0.js → quadrantDiagram-34T5L4WZ.DndDwbKT.js} +1 -1
- package/dist/docs/assets/chunks/{requirementDiagram-MS252O5E.CZpylJMd.js → requirementDiagram-MS252O5E.Zhfgwlnn.js} +1 -1
- package/dist/docs/assets/chunks/{sankeyDiagram-XADWPNL6.CnFdfW95.js → sankeyDiagram-XADWPNL6.B6RRm6N5.js} +1 -1
- package/dist/docs/assets/chunks/{sequenceDiagram-FGHM5R23.-jC0PP1t.js → sequenceDiagram-FGHM5R23.Bfmz-1PN.js} +1 -1
- package/dist/docs/assets/chunks/{stateDiagram-FHFEXIEX.DG7yBRUU.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.B3O9koXV.js → theme.gpWjytMh.js} +2 -2
- package/dist/docs/assets/chunks/{timeline-definition-GMOUNBTQ.Bf9u4Ebb.js → timeline-definition-GMOUNBTQ.Bl1l7M1f.js} +1 -1
- package/dist/docs/assets/chunks/{vennDiagram-DHZGUBPP.BjhbbYE6.js → vennDiagram-DHZGUBPP.Dfle4U0d.js} +1 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.BJrCW6xc.js +162 -0
- package/dist/docs/assets/chunks/{wardleyDiagram-NUSXRM2D.8fRb4Nb5.js → wardleyDiagram-NUSXRM2D.CM_4lmvZ.js} +1 -1
- package/dist/docs/assets/chunks/{xychartDiagram-5P7HB3ND.DoOP3zZM.js → xychartDiagram-5P7HB3ND.CHT5X28R.js} +1 -1
- package/dist/docs/assets/{evals.md.LRCSn6Ik.js → evals.md.C851kViu.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/{templates_agentic-owners.md.vtjfwxbf.js → templates_agentic-owners.md.CvmABtia.js} +1 -1
- package/dist/docs/assets/{templates_agentic-owners.md.vtjfwxbf.lean.js → templates_agentic-owners.md.CvmABtia.lean.js} +1 -1
- package/dist/docs/assets/{templates_security-reviewer.md.CX9l9bcg.js → templates_security-reviewer.md.Gh6EF9Us.js} +3 -2
- package/dist/docs/assets/{templates_security-reviewer.md.CX9l9bcg.lean.js → templates_security-reviewer.md.Gh6EF9Us.lean.js} +1 -1
- package/dist/docs/assets/{templates_thermo-quality-review.md.95qmTmr1.js → templates_thermo-quality-review.md.B77UyTrX.js} +1 -1
- package/dist/docs/assets/{templates_thermo-review.md.DQh6Q0C-.js → templates_thermo-review.md.DRJ7mC5U.js} +1 -1
- package/dist/docs/assets/{templates_triage.md.BFlQhWXf.js → templates_triage.md.CNN6b0JZ.js} +3 -3
- package/dist/docs/assets/{templates_triage.md.BFlQhWXf.lean.js → templates_triage.md.CNN6b0JZ.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +35 -35
- package/dist/docs/deployment.html +35 -35
- package/dist/docs/evals.html +37 -37
- package/dist/docs/evals.md +2 -2
- 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 +41 -24
- 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 +35 -35
- package/dist/docs/reference/subagents.html +35 -35
- package/dist/docs/reference/tools.html +35 -35
- package/dist/docs/templates/agentic-owners.html +37 -37
- package/dist/docs/templates/agentic-owners.md +2 -0
- package/dist/docs/templates/grokbot-agents.html +35 -35
- package/dist/docs/templates/security-reviewer.html +38 -37
- package/dist/docs/templates/security-reviewer.md +7 -8
- package/dist/docs/templates/thermo-quality-review.html +37 -37
- package/dist/docs/templates/thermo-quality-review.md +2 -2
- package/dist/docs/templates/thermo-review.html +37 -37
- package/dist/docs/templates/thermo-review.md +2 -2
- package/dist/docs/templates/triage.html +38 -38
- package/dist/docs/templates/triage.md +6 -1
- package/dist/docs/troubleshooting.html +35 -35
- package/dist/evals.d.ts +2 -2
- 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 +92 -153
- 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/eval-runner.js +7 -4
- 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/init-interview.d.ts +0 -1
- package/dist/internal/init-interview.d.ts.map +1 -1
- package/dist/internal/init-interview.js +15 -24
- 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/platform-timers.d.ts +8 -1
- package/dist/internal/platform-timers.d.ts.map +1 -1
- package/dist/internal/platform-timers.js +10 -2
- package/dist/internal/playground/toolchain.js +6 -6
- package/dist/internal/process-memory-telemetry.js +2 -2
- package/dist/internal/reminder-control-plane-protocol.d.ts +8 -1
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -1
- package/dist/internal/reminder-runner.d.ts +13 -3
- package/dist/internal/reminder-runner.d.ts.map +1 -1
- package/dist/internal/reminder-runner.js +78 -53
- package/dist/internal/resolve-prod-target.d.ts +1 -9
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +1 -30
- package/dist/internal/resolved-connections.js +8 -8
- package/dist/internal/run-client.d.ts +11 -1
- package/dist/internal/run-client.d.ts.map +1 -1
- package/dist/internal/run-client.js +197 -59
- 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 +8 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +58 -45
- 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-links.d.ts.map +1 -1
- package/dist/internal/session-links.js +8 -7
- 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 +1 -0
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +8 -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/evals.md +2 -2
- package/docs/reference/cli.md +20 -9
- package/docs/templates/agentic-owners.md +2 -0
- package/docs/templates/security-reviewer.md +7 -8
- package/docs/templates/thermo-quality-review.md +2 -2
- package/docs/templates/thermo-review.md +2 -2
- package/docs/templates/triage.md +6 -1
- package/package.json +1 -1
- package/templates/agents-md/evals/agents.eval.ts +1 -0
- package/templates/code-wiki/bot/instructions.md +4 -4
- package/templates/pr-autofixer/bot/instructions.md +3 -3
- package/templates/security-reviewer/README.md +5 -3
- package/templates/security-reviewer/bot/tools/post_findings.ts +8 -8
- package/templates/thermo-quality-review/bot/tools/post_findings.ts +8 -8
- package/templates/thermo-review/bot/tools/post_findings.ts +8 -8
- package/dist/docs/assets/chunks/@localSearchIndexroot.BITLoOQa.js +0 -1
- package/dist/docs/assets/chunks/channel.B46uXH41.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.0cmCFsSf.js +0 -1
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.0cmCFsSf.js +0 -1
- package/dist/docs/assets/chunks/clone.1vTOFZT1.js +0 -1
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.CbsZcOOu.js +0 -1
- package/dist/docs/assets/chunks/wardley-RL74JXVD.DEA21akR.js +0 -162
- 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/{evals.md.LRCSn6Ik.lean.js → evals.md.C851kViu.lean.js} +0 -0
- /package/dist/docs/assets/{templates_thermo-quality-review.md.95qmTmr1.lean.js → templates_thermo-quality-review.md.B77UyTrX.lean.js} +0 -0
- /package/dist/docs/assets/{templates_thermo-review.md.DQh6Q0C-.lean.js → templates_thermo-review.md.DRJ7mC5U.lean.js} +0 -0
|
@@ -53,13 +53,15 @@ export function listSessionsWithSource(args) {
|
|
|
53
53
|
}
|
|
54
54
|
export function fetchSessionEvents(args) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
var _a;
|
|
56
|
+
var _a, _b;
|
|
57
|
+
var _c;
|
|
57
58
|
const baseUrl = args.baseUrl.replace(/\/$/, "");
|
|
58
|
-
const fetchImpl = (
|
|
59
|
+
const fetchImpl = (_c = args.fetchImpl) !== null && _c !== void 0 ? _c : fetch;
|
|
59
60
|
const path = `/v1/session/${encodeURIComponent(args.sessionId)}/events`;
|
|
60
61
|
try {
|
|
61
62
|
const jsonResp = yield fetchImpl(`${baseUrl}${path}?format=json`, {
|
|
62
63
|
headers: mergeRequestHeaders(args.auth),
|
|
64
|
+
signal: args.signal,
|
|
63
65
|
});
|
|
64
66
|
if (jsonResp.ok) {
|
|
65
67
|
const body = (yield jsonResp.json());
|
|
@@ -75,6 +77,7 @@ export function fetchSessionEvents(args) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
catch (error) {
|
|
80
|
+
(_a = args.signal) === null || _a === void 0 ? void 0 : _a.throwIfAborted();
|
|
78
81
|
if (error instanceof Error && error.message.startsWith("Session ")) {
|
|
79
82
|
throw error;
|
|
80
83
|
}
|
|
@@ -83,6 +86,7 @@ export function fetchSessionEvents(args) {
|
|
|
83
86
|
try {
|
|
84
87
|
const resp = yield fetchImpl(`${baseUrl}${path}`, {
|
|
85
88
|
headers: mergeRequestHeaders(args.auth),
|
|
89
|
+
signal: args.signal,
|
|
86
90
|
});
|
|
87
91
|
if (resp.status === 404) {
|
|
88
92
|
throw new Error(`Session ${args.sessionId} not found.`);
|
|
@@ -102,13 +106,14 @@ export function fetchSessionEvents(args) {
|
|
|
102
106
|
try {
|
|
103
107
|
events.push(JSON.parse(line));
|
|
104
108
|
}
|
|
105
|
-
catch (
|
|
109
|
+
catch (_d) {
|
|
106
110
|
// skip malformed lines
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
return events;
|
|
110
114
|
}
|
|
111
115
|
catch (error) {
|
|
116
|
+
(_b = args.signal) === null || _b === void 0 ? void 0 : _b.throwIfAborted();
|
|
112
117
|
if (error instanceof Error && error.message.startsWith("Session ")) {
|
|
113
118
|
throw error;
|
|
114
119
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sync authored skills
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `serve`/`run` with `runtime: "cloud"` writes
|
|
6
|
-
* `agent-serve/<agent>/skills/<name>/…` on the USER store.
|
|
2
|
+
* Sync authored skills to cloud-turn storage for native discovery. Managed
|
|
3
|
+
* deployments use deployment-scoped storage; local cloud turns use
|
|
4
|
+
* user-scoped storage namespaced by agent.
|
|
7
5
|
*/
|
|
8
6
|
import { type FileSink } from "../files.js";
|
|
9
7
|
import type { DiscoveredSkill } from "../types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-sync.d.ts","sourceRoot":"","sources":["../../src/internal/skills-sync.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skills-sync.d.ts","sourceRoot":"","sources":["../../src/internal/skills-sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AASpE;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sync authored skills
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `serve`/`run` with `runtime: "cloud"` writes
|
|
6
|
-
* `agent-serve/<agent>/skills/<name>/…` on the USER store.
|
|
2
|
+
* Sync authored skills to cloud-turn storage for native discovery. Managed
|
|
3
|
+
* deployments use deployment-scoped storage; local cloud turns use
|
|
4
|
+
* user-scoped storage namespaced by agent.
|
|
7
5
|
*/
|
|
8
6
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
7
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Durable
|
|
2
|
+
* Durable process output for managed architecture-v2 agents.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
* callers snapshot the local buffer and PUT once. The Temporal host does
|
|
7
|
-
* a last catch-up at the end of the delivery so the object is complete
|
|
8
|
-
* after park/discard.
|
|
9
|
-
*
|
|
10
|
-
* Same flush moments as `hosted-execution.json` and session-runs —
|
|
11
|
-
* see `hosted-execution-flush.ts`. Keys: {@link agentSdkStorageKeys.log}.
|
|
12
|
-
* Values are raw UTF-8, not JSON.
|
|
4
|
+
* The host persists a bounded snapshot of stdout and stderr after masking
|
|
5
|
+
* credential tokens. Writes happen at flush boundaries rather than per line.
|
|
13
6
|
*/
|
|
14
7
|
import type { FileSink } from "../files.js";
|
|
15
8
|
import type { AgentProject } from "../types.js";
|
|
16
|
-
/**
|
|
17
|
-
* Last N bytes flushed to the store. Matches the Temporal catch-up cap
|
|
18
|
-
* so guest snapshots and host catch-up stay interchangeable. The store
|
|
19
|
-
* allows 64 MiB; this keeps the dashboard snapshot bounded.
|
|
20
|
-
*/
|
|
9
|
+
/** Maximum bytes retained in each persisted output snapshot. */
|
|
21
10
|
export declare const START_LOG_STORE_MAX_BYTES: number;
|
|
22
|
-
/**
|
|
11
|
+
/** Default local output path. */
|
|
23
12
|
export declare const DEFAULT_ENGINE_START_LOG_PATH = "/workspace/.agent-serve/start.log";
|
|
24
13
|
export interface StartLogStore {
|
|
25
14
|
persist(startLogId: string, contents: string): Promise<void>;
|
|
@@ -49,8 +38,8 @@ export declare function selectStartLogStore(input: {
|
|
|
49
38
|
env?: Record<string, string | undefined>;
|
|
50
39
|
}): StartLogStore | undefined;
|
|
51
40
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
41
|
+
* Flushes on one store run one at a time, each reading the tee when its turn
|
|
42
|
+
* comes, so a slow earlier put cannot land over a later, longer snapshot.
|
|
54
43
|
*/
|
|
55
44
|
export declare function flushLocalStartLog(args: {
|
|
56
45
|
store: StartLogStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-log-store.d.ts","sourceRoot":"","sources":["../../src/internal/start-log-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"start-log-store.d.ts","sourceRoot":"","sources":["../../src/internal/start-log-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,MAAwB,CAAC;AAEjE,iCAAiC;AACjC,eAAO,MAAM,6BAA6B,sCAAsC,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,UAAU,EAAE,MAA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
|
+
* Durable process output for managed architecture-v2 agents.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
* callers snapshot the local buffer and PUT once. The Temporal host does
|
|
7
|
-
* a last catch-up at the end of the delivery so the object is complete
|
|
8
|
-
* after park/discard.
|
|
9
|
-
*
|
|
10
|
-
* Same flush moments as `hosted-execution.json` and session-runs —
|
|
11
|
-
* see `hosted-execution-flush.ts`. Keys: {@link agentSdkStorageKeys.log}.
|
|
12
|
-
* Values are raw UTF-8, not JSON.
|
|
4
|
+
* The host persists a bounded snapshot of stdout and stderr after masking
|
|
5
|
+
* credential tokens. Writes happen at flush boundaries rather than per line.
|
|
13
6
|
*/
|
|
14
7
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
8
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -26,13 +19,9 @@ import { agentSdkStorageKeys } from "../storage-protocol.js";
|
|
|
26
19
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
27
20
|
import { describeError } from "./describe-error.js";
|
|
28
21
|
import { resolveAgentV2Hosting } from "./v2-hosting.js";
|
|
29
|
-
/**
|
|
30
|
-
* Last N bytes flushed to the store. Matches the Temporal catch-up cap
|
|
31
|
-
* so guest snapshots and host catch-up stay interchangeable. The store
|
|
32
|
-
* allows 64 MiB; this keeps the dashboard snapshot bounded.
|
|
33
|
-
*/
|
|
22
|
+
/** Maximum bytes retained in each persisted output snapshot. */
|
|
34
23
|
export const START_LOG_STORE_MAX_BYTES = 2 * 1024 * 1024;
|
|
35
|
-
/**
|
|
24
|
+
/** Default local output path. */
|
|
36
25
|
export const DEFAULT_ENGINE_START_LOG_PATH = "/workspace/.agent-serve/start.log";
|
|
37
26
|
function decodeSinkBody(body) {
|
|
38
27
|
return body instanceof Uint8Array ? body : body.body;
|
|
@@ -44,6 +33,26 @@ export function tailStartLogText(raw, maxBytes) {
|
|
|
44
33
|
}
|
|
45
34
|
return new TextDecoder().decode(encoded.subarray(encoded.byteLength - maxBytes));
|
|
46
35
|
}
|
|
36
|
+
/** Each character literally or percent-encoded, as tokens appear in URLs. */
|
|
37
|
+
function encodable(text) {
|
|
38
|
+
return Array.from(text, char => {
|
|
39
|
+
const lower = char.charCodeAt(0).toString(16).padStart(2, "0");
|
|
40
|
+
const upper = char.toUpperCase().charCodeAt(0).toString(16).padStart(2, "0");
|
|
41
|
+
return lower === upper ? `(?:${char}|%${lower})` : `(?:${char}|%${lower}|%${upper})`;
|
|
42
|
+
}).join("");
|
|
43
|
+
}
|
|
44
|
+
const HEX = String.raw `(?:[a-f0-9]|%(?:3[0-9]|[46][1-6]))`;
|
|
45
|
+
const TOKEN_MASKS = [
|
|
46
|
+
[new RegExp(`${encodable("grok_")}${HEX}{32}${encodable("_")}${HEX}{64}`, "gi"), "grok_…"],
|
|
47
|
+
[new RegExp(`${encodable("crsr_")}(?:[a-z0-9_-]|%[0-9a-f]{2})+`, "gi"), "crsr_…"],
|
|
48
|
+
[/\bghs_[A-Za-z0-9_]+\b/g, "ghs_…"],
|
|
49
|
+
[/\bgho_[A-Za-z0-9_]+\b/g, "gho_…"],
|
|
50
|
+
[/\bxox[baprs]-[A-Za-z0-9-]+\b/g, "xox…"],
|
|
51
|
+
];
|
|
52
|
+
/** Mask credential tokens before persisting a snapshot. */
|
|
53
|
+
function maskStartLogTokens(text) {
|
|
54
|
+
return TOKEN_MASKS.reduce((masked, [pattern, mask]) => masked.replace(pattern, mask), text);
|
|
55
|
+
}
|
|
47
56
|
export function resolveEngineStartLogPath(env = process.env) {
|
|
48
57
|
var _a;
|
|
49
58
|
const configured = (_a = env.AGENT_SERVE_ENGINE_START_LOG_PATH) === null || _a === void 0 ? void 0 : _a.trim();
|
|
@@ -82,16 +91,23 @@ export function createStartLogStore(input) {
|
|
|
82
91
|
var _a;
|
|
83
92
|
const { sink, agentName } = input;
|
|
84
93
|
const logger = (_a = input.logger) !== null && _a !== void 0 ? _a : (() => { });
|
|
94
|
+
// Flush moments often find the tee unchanged (a quiet turn, the claim then
|
|
95
|
+
// the stamp); skip a put that would store the same bytes again.
|
|
96
|
+
let stored;
|
|
85
97
|
return {
|
|
86
98
|
persist(startLogId, contents) {
|
|
87
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
100
|
const key = agentSdkStorageKeys.log(agentName, startLogId);
|
|
89
|
-
const body = tailStartLogText(contents, START_LOG_STORE_MAX_BYTES);
|
|
101
|
+
const body = maskStartLogTokens(tailStartLogText(contents, START_LOG_STORE_MAX_BYTES));
|
|
102
|
+
if ((stored === null || stored === void 0 ? void 0 : stored.key) === key && stored.body === body) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
90
105
|
try {
|
|
91
106
|
yield sink.put(key, new TextEncoder().encode(body));
|
|
107
|
+
stored = { key, body };
|
|
92
108
|
}
|
|
93
109
|
catch (error) {
|
|
94
|
-
logger(`[
|
|
110
|
+
logger(`[bdk] start-log: persist failed for ${startLogId} (${describeError(error)})`);
|
|
95
111
|
}
|
|
96
112
|
});
|
|
97
113
|
},
|
|
@@ -107,7 +123,7 @@ export function createStartLogStore(input) {
|
|
|
107
123
|
return text.length === 0 ? undefined : text;
|
|
108
124
|
}
|
|
109
125
|
catch (error) {
|
|
110
|
-
logger(`[
|
|
126
|
+
logger(`[bdk] start-log: read failed for ${startLogId} (${describeError(error)})`);
|
|
111
127
|
return undefined;
|
|
112
128
|
}
|
|
113
129
|
});
|
|
@@ -138,12 +154,19 @@ export function selectStartLogStore(input) {
|
|
|
138
154
|
* Snapshot the local tee into the store. No-op when the file is missing
|
|
139
155
|
* or empty. Soft-fail inside {@link StartLogStore.persist}.
|
|
140
156
|
*/
|
|
157
|
+
const flushing = new WeakMap();
|
|
158
|
+
/**
|
|
159
|
+
* Flushes on one store run one at a time, each reading the tee when its turn
|
|
160
|
+
* comes, so a slow earlier put cannot land over a later, longer snapshot.
|
|
161
|
+
*/
|
|
141
162
|
export function flushLocalStartLog(args) {
|
|
142
|
-
|
|
163
|
+
var _a;
|
|
164
|
+
const run = ((_a = flushing.get(args.store)) !== null && _a !== void 0 ? _a : Promise.resolve()).then(() => __awaiter(this, void 0, void 0, function* () {
|
|
143
165
|
const contents = yield readLocalStartLogText(args.path === undefined ? undefined : { path: args.path });
|
|
144
|
-
if (contents
|
|
145
|
-
|
|
166
|
+
if (contents !== undefined) {
|
|
167
|
+
yield args.store.persist(args.startLogId, contents);
|
|
146
168
|
}
|
|
147
|
-
|
|
148
|
-
|
|
169
|
+
}));
|
|
170
|
+
flushing.set(args.store, run.catch(() => undefined));
|
|
171
|
+
return run;
|
|
149
172
|
}
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
* failures — a throwing sink is logged and its write dropped; storage
|
|
11
11
|
* must never stall or fail a turn.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* go to their dedicated `evals` table. Reminder documents live on the
|
|
15
|
-
* control plane. Everything shares one bounded, serialized queue.
|
|
13
|
+
* Session and eval writes share one bounded, serialized queue.
|
|
16
14
|
*
|
|
17
15
|
* It does three unrelated jobs, declared separately as
|
|
18
16
|
* {@link FrameworkSessionStore}, {@link AuthorKvStore}, and
|
|
@@ -95,12 +93,12 @@ export declare class StorageCoordinator implements FrameworkSessionStore, Author
|
|
|
95
93
|
eventDispatched(event: SessionEvent): void;
|
|
96
94
|
/** Flush everything buffered for one session (ordered: events, record). */
|
|
97
95
|
flushSession(sessionId: string, reason?: StorageContext["reason"]): void;
|
|
96
|
+
flushSessionExact(sessionId: string): void;
|
|
98
97
|
private flushSessionInternal;
|
|
99
98
|
/**
|
|
100
99
|
* One queued op covering every put of a flush. When the sink offers
|
|
101
|
-
* `putMany`, the whole flush is one backend round trip
|
|
102
|
-
*
|
|
103
|
-
* puts run sequentially, exactly as before. Failures stay per-key —
|
|
100
|
+
* `putMany`, the whole flush is one backend round trip; otherwise the
|
|
101
|
+
* puts run sequentially. Failures stay per-key,
|
|
104
102
|
* logged and dropped (at-most-once), never failing batch siblings.
|
|
105
103
|
*/
|
|
106
104
|
private putsOp;
|
|
@@ -116,8 +114,8 @@ export declare class StorageCoordinator implements FrameworkSessionStore, Author
|
|
|
116
114
|
/** Whether the sink can serve the startup bulk restore (`list`). */
|
|
117
115
|
get canBulkRestore(): boolean;
|
|
118
116
|
/**
|
|
119
|
-
* True when the
|
|
120
|
-
*
|
|
117
|
+
* True when the configured sink uses Cursor-managed durable storage.
|
|
118
|
+
* `GET /v1/sessions` prefers this durable list.
|
|
121
119
|
*/
|
|
122
120
|
get isCursorHosted(): boolean;
|
|
123
121
|
/**
|
|
@@ -187,8 +185,7 @@ export declare class StorageCoordinator implements FrameworkSessionStore, Author
|
|
|
187
185
|
evalRuns(): EvalRunStorage | undefined;
|
|
188
186
|
/**
|
|
189
187
|
* Flush all buffers and drain the queue, giving the sink at most
|
|
190
|
-
* {@link CLOSE_DRAIN_TIMEOUT_MS}
|
|
191
|
-
* past the pod grace period. Called from engine close.
|
|
188
|
+
* {@link CLOSE_DRAIN_TIMEOUT_MS}. Called from engine close.
|
|
192
189
|
*/
|
|
193
190
|
close(): Promise<void>;
|
|
194
191
|
/** Pending deliveries (exposed for tests and drain instrumentation). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-coordinator.d.ts","sourceRoot":"","sources":["../../src/internal/storage-coordinator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"storage-coordinator.d.ts","sourceRoot":"","sources":["../../src/internal/storage-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC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,EACjB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAqCpC;IAMD;;;OAGG;IACH,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED;;;OAGG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAQ7D;IAED;;;OAGG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9D;IAED,oEAAoE;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C;IAMD;;;;OAIG;IACH,QAAQ,IAAI,cAAc,GAAG,SAAS,CAyCrC;IAMD;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA6B3B;IAED,wEAAwE;IACxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAExB;IAED,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,WAAW;IAYnB,2EAA2E;YAC7D,OAAO;IAcrB,OAAO,CAAC,OAAO;IA4Bf,OAAO,CAAC,OAAO;CAGhB"}
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
* failures — a throwing sink is logged and its write dropped; storage
|
|
11
11
|
* must never stall or fail a turn.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
* go to their dedicated `evals` table. Reminder documents live on the
|
|
15
|
-
* control plane. Everything shares one bounded, serialized queue.
|
|
13
|
+
* Session and eval writes share one bounded, serialized queue.
|
|
16
14
|
*
|
|
17
15
|
* It does three unrelated jobs, declared separately as
|
|
18
16
|
* {@link FrameworkSessionStore}, {@link AuthorKvStore}, and
|
|
@@ -57,8 +55,7 @@ const TERMINAL_SESSION_EVENTS = new Set([
|
|
|
57
55
|
const MAX_PENDING_OPS = 1000;
|
|
58
56
|
/**
|
|
59
57
|
* How long {@link StorageCoordinator.close} waits for the sink to
|
|
60
|
-
* drain before giving up. Keeps a hung sink
|
|
61
|
-
* the pod grace period (where a SIGKILL would lose the flush anyway).
|
|
58
|
+
* drain before giving up. Keeps a hung sink within the shutdown budget.
|
|
62
59
|
*/
|
|
63
60
|
const CLOSE_DRAIN_TIMEOUT_MS = 10000;
|
|
64
61
|
/** Debounced event batching flushes early past this many buffered events. */
|
|
@@ -182,6 +179,9 @@ export class StorageCoordinator {
|
|
|
182
179
|
// volatile-only diff.
|
|
183
180
|
this.flushSessionInternal(sessionId, reason, reason !== "policy");
|
|
184
181
|
}
|
|
182
|
+
flushSessionExact(sessionId) {
|
|
183
|
+
this.flushSessionInternal(sessionId, "policy", true);
|
|
184
|
+
}
|
|
185
185
|
flushSessionInternal(sessionId, reason, exactRecord) {
|
|
186
186
|
var _a, _b;
|
|
187
187
|
const buffer = this.buffers.get(sessionId);
|
|
@@ -253,9 +253,8 @@ export class StorageCoordinator {
|
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
255
|
* One queued op covering every put of a flush. When the sink offers
|
|
256
|
-
* `putMany`, the whole flush is one backend round trip
|
|
257
|
-
*
|
|
258
|
-
* puts run sequentially, exactly as before. Failures stay per-key —
|
|
256
|
+
* `putMany`, the whole flush is one backend round trip; otherwise the
|
|
257
|
+
* puts run sequentially. Failures stay per-key,
|
|
259
258
|
* logged and dropped (at-most-once), never failing batch siblings.
|
|
260
259
|
*/
|
|
261
260
|
putsOp(puts, recordAck) {
|
|
@@ -295,7 +294,7 @@ export class StorageCoordinator {
|
|
|
295
294
|
if (result.key === recordKey) {
|
|
296
295
|
recordFailed = true;
|
|
297
296
|
}
|
|
298
|
-
this.logger(`[
|
|
297
|
+
this.logger(`[bdk] storage put(${result.key}) failed: ${describeError(result.error)}`);
|
|
299
298
|
}
|
|
300
299
|
settleRecord(recordFailed);
|
|
301
300
|
}),
|
|
@@ -313,7 +312,7 @@ export class StorageCoordinator {
|
|
|
313
312
|
if (entry.key === recordKey) {
|
|
314
313
|
recordFailed = true;
|
|
315
314
|
}
|
|
316
|
-
this.logger(`[
|
|
315
|
+
this.logger(`[bdk] storage put(${entry.key}) failed: ${describeError(error)}`);
|
|
317
316
|
}
|
|
318
317
|
}
|
|
319
318
|
settleRecord(recordFailed);
|
|
@@ -364,8 +363,8 @@ export class StorageCoordinator {
|
|
|
364
363
|
return this.definition.list !== undefined;
|
|
365
364
|
}
|
|
366
365
|
/**
|
|
367
|
-
* True when the
|
|
368
|
-
*
|
|
366
|
+
* True when the configured sink uses Cursor-managed durable storage.
|
|
367
|
+
* `GET /v1/sessions` prefers this durable list.
|
|
369
368
|
*/
|
|
370
369
|
get isCursorHosted() {
|
|
371
370
|
return isCursorHostedStorage(this.definition);
|
|
@@ -492,7 +491,7 @@ export class StorageCoordinator {
|
|
|
492
491
|
// Index entry without its record (e.g. the record write was shed
|
|
493
492
|
// under at-most-once). The session is unrecoverable; treat as a miss
|
|
494
493
|
// so the conversation can continue rather than failing forever.
|
|
495
|
-
this.logger(`[
|
|
494
|
+
this.logger(`[bdk] storage continuation entry points at missing session ${sessionId}; treating as a miss`);
|
|
496
495
|
return undefined;
|
|
497
496
|
}
|
|
498
497
|
// The sink must answer for the exact key it was asked about — a
|
|
@@ -586,7 +585,7 @@ export class StorageCoordinator {
|
|
|
586
585
|
return Array.isArray(runs) ? runs : [];
|
|
587
586
|
}
|
|
588
587
|
catch (error) {
|
|
589
|
-
this.logger(`[
|
|
588
|
+
this.logger(`[bdk] storage evals.list() failed: ${describeError(error)}`);
|
|
590
589
|
return [];
|
|
591
590
|
}
|
|
592
591
|
}),
|
|
@@ -597,8 +596,7 @@ export class StorageCoordinator {
|
|
|
597
596
|
// ==========================================================================
|
|
598
597
|
/**
|
|
599
598
|
* Flush all buffers and drain the queue, giving the sink at most
|
|
600
|
-
* {@link CLOSE_DRAIN_TIMEOUT_MS}
|
|
601
|
-
* past the pod grace period. Called from engine close.
|
|
599
|
+
* {@link CLOSE_DRAIN_TIMEOUT_MS}. Called from engine close.
|
|
602
600
|
*/
|
|
603
601
|
close() {
|
|
604
602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -627,7 +625,7 @@ export class StorageCoordinator {
|
|
|
627
625
|
]);
|
|
628
626
|
clearTimeout(timer);
|
|
629
627
|
if (!drained) {
|
|
630
|
-
this.logger(`[
|
|
628
|
+
this.logger(`[bdk] storage shutdown drain timed out after ${CLOSE_DRAIN_TIMEOUT_MS}ms with ${this.pending} write(s) undelivered`);
|
|
631
629
|
}
|
|
632
630
|
});
|
|
633
631
|
}
|
|
@@ -667,7 +665,7 @@ export class StorageCoordinator {
|
|
|
667
665
|
return Array.isArray(entries) ? entries : [];
|
|
668
666
|
}
|
|
669
667
|
catch (error) {
|
|
670
|
-
this.logger(`[
|
|
668
|
+
this.logger(`[bdk] storage list(${prefix}) failed: ${describeError(error)}`);
|
|
671
669
|
return [];
|
|
672
670
|
}
|
|
673
671
|
});
|
|
@@ -679,7 +677,7 @@ export class StorageCoordinator {
|
|
|
679
677
|
if (this.pending + ops.length > MAX_PENDING_OPS) {
|
|
680
678
|
this.dropped += ops.length;
|
|
681
679
|
if (this.dropped <= ops.length || this.dropped % 1000 < ops.length) {
|
|
682
|
-
this.logger(`[
|
|
680
|
+
this.logger(`[bdk] storage queue full (${MAX_PENDING_OPS} pending writes); dropped ${this.dropped} write(s) so far — the sink is too slow for the traffic`);
|
|
683
681
|
}
|
|
684
682
|
return;
|
|
685
683
|
}
|
|
@@ -691,7 +689,7 @@ export class StorageCoordinator {
|
|
|
691
689
|
yield op.run(ctx);
|
|
692
690
|
}
|
|
693
691
|
catch (error) {
|
|
694
|
-
this.logger(`[
|
|
692
|
+
this.logger(`[bdk] storage ${op.label} failed: ${describeError(error)}`);
|
|
695
693
|
}
|
|
696
694
|
finally {
|
|
697
695
|
this.pending -= 1;
|
|
@@ -42,6 +42,11 @@ export interface FrameworkSessionStore {
|
|
|
42
42
|
eventDispatched(event: SessionEvent): void;
|
|
43
43
|
/** Flush everything buffered for one session (ordered: events, record). */
|
|
44
44
|
flushSession(sessionId: string, reason?: StorageContext["reason"]): void;
|
|
45
|
+
/**
|
|
46
|
+
* {@link flushSession} that writes the exact record, repairing volatile-only
|
|
47
|
+
* skips. For a lifecycle edge the process may not outlive.
|
|
48
|
+
*/
|
|
49
|
+
flushSessionExact(sessionId: string): void;
|
|
45
50
|
/** True when the backend can list every session in one bulk read. */
|
|
46
51
|
readonly canBulkRestore: boolean;
|
|
47
52
|
/** True when the backend is the Cursor-hosted one rather than an authored sink. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-roles.d.ts","sourceRoot":"","sources":["../../src/internal/storage-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3C,uEAAuE;IACvE,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,kEAAkE;IAClE,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3C,2EAA2E;IAC3E,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"storage-roles.d.ts","sourceRoot":"","sources":["../../src/internal/storage-roles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAA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QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACnC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IACzD,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,mDAAmD;AACnD,MAAM,WAAW,SAAS;IACxB,QAAQ,IAAI,cAAc,GAAG,SAAS,CAAC;CACxC"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `POST /internal/agentsdk/store/api/<call>` carrying a versioned JSON
|
|
4
|
-
* envelope `{ v, call, payload }`. This is the lane where the **server** owns
|
|
5
|
-
* the storage pattern (journal sharding, rotation, compaction), so a
|
|
6
|
-
* pathological pattern is fixable in a backend deploy instead of a July
|
|
7
|
-
* release plus a rebake of every deployment. The verb lane (`/flush`,
|
|
8
|
-
* `/read`, `/list`) keeps carrying bulk presigned file IO.
|
|
9
|
-
*
|
|
10
|
-
* Deliberately duplicated on the backend
|
|
11
|
-
* (`backend/server/src/factory/agent-sdk/agentsdkStoreApiProtocol.ts`): this
|
|
12
|
-
* package is published to npm, so the backend cannot depend on it and it
|
|
13
|
-
* cannot depend on backend packages. A backend drift test compares the two
|
|
14
|
-
* sources — same shape as the hosted-delivery protocol twins — which is why
|
|
15
|
-
* every exported constant here stays a single `export const NAME = <literal>;`
|
|
16
|
-
* line and every schema field stays on its own line.
|
|
2
|
+
* Versioned wire contract for Cursor-managed store operations.
|
|
17
3
|
*
|
|
18
4
|
* Evolution rules (the compat contract): additive optional fields only; no
|
|
19
5
|
* renames, no retypes, no semantic reuse of an old field; unknown fields are
|
|
@@ -23,26 +9,23 @@
|
|
|
23
9
|
*/
|
|
24
10
|
import { z } from "zod";
|
|
25
11
|
export declare const STORE_API_PROTOCOL_VERSION = 1;
|
|
26
|
-
/**
|
|
12
|
+
/** Managed storage endpoint, with one trailing segment per call. */
|
|
27
13
|
export declare const STORE_API_PATH = "/internal/agentsdk/store/api";
|
|
28
14
|
export declare const STORE_API_MEMORY_APPEND_CALL = "memory.append";
|
|
29
15
|
/**
|
|
30
16
|
* Semantic cap on one serialized memory record. Text fields are truncated
|
|
31
17
|
* client-side (`memoryHook` default 2000 chars per field), so a well-formed
|
|
32
18
|
* record is a few KiB; 16 KiB is generous headroom, not a target. The cap is
|
|
33
|
-
* part of the wire contract but
|
|
34
|
-
*
|
|
35
|
-
* client (`cursor/store-api-client.ts`) pre-checks it before spending a
|
|
36
|
-
* doomed request.
|
|
19
|
+
* part of the wire contract but not the schema. The service enforces it as a
|
|
20
|
+
* typed 4xx, and the client checks it before sending a request.
|
|
37
21
|
*/
|
|
38
22
|
export declare const MEMORY_APPEND_MAX_RECORD_BYTES: number;
|
|
39
23
|
/** Serialized size of a record, as counted against the byte cap. */
|
|
40
24
|
export declare function serializedRecordBytes(record: unknown): number;
|
|
41
25
|
/**
|
|
42
|
-
* One turn's memory record as it crosses the wire
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* verbatim rather than stripped by an older server.
|
|
26
|
+
* One turn's memory record as it crosses the wire. The extra-key record
|
|
27
|
+
* mirrors the schema's `.passthrough()`: a newer client's additive optional
|
|
28
|
+
* fields are journaled verbatim rather than stripped by an older server.
|
|
46
29
|
*/
|
|
47
30
|
export type TurnMemoryRecordWire = {
|
|
48
31
|
at: string;
|
|
@@ -69,8 +52,8 @@ export type MemoryAppendPayload = {
|
|
|
69
52
|
/**
|
|
70
53
|
* `memory.append` payload shape. The agent name becomes a store key segment
|
|
71
54
|
* on the server, so it must be exactly one segment. Unknown payload fields
|
|
72
|
-
* are stripped (= ignored), per the evolution rules. The
|
|
73
|
-
*
|
|
55
|
+
* are stripped (= ignored), per the evolution rules. The service owns the
|
|
56
|
+
* byte cap because it is a semantic limit rather than part of the shape.
|
|
74
57
|
*/
|
|
75
58
|
export declare const memoryAppendPayloadSchema: z.ZodType<MemoryAppendPayload>;
|
|
76
59
|
/** The versioned request body for the `memory.append` call. */
|
|
@@ -110,13 +93,9 @@ export type MemoryReadEnvelope = {
|
|
|
110
93
|
/** The whole request body. Unknown envelope fields are stripped (= ignored). */
|
|
111
94
|
export declare const memoryReadEnvelopeSchema: z.ZodType<MemoryReadEnvelope>;
|
|
112
95
|
/**
|
|
113
|
-
* `memory.read` success body. The
|
|
114
|
-
*
|
|
115
|
-
* the
|
|
116
|
-
* read; a busy flush lock, a buffer outage, or an oversized backlog
|
|
117
|
-
* degrades to the already-flushed state (callers must not regress their
|
|
118
|
-
* local view on a shorter download). `journal` is null while the agent has
|
|
119
|
-
* no journal at all.
|
|
96
|
+
* `memory.read` success body. The snapshot is best-effort and may lag
|
|
97
|
+
* accepted appends, so callers retain a longer local view. `journal` is null
|
|
98
|
+
* while the agent has no journal.
|
|
120
99
|
*/
|
|
121
100
|
export type MemoryReadResponse = {
|
|
122
101
|
v: typeof STORE_API_PROTOCOL_VERSION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-api-protocol.d.ts","sourceRoot":"","sources":["../../src/internal/store-api-protocol.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store-api-protocol.d.ts","sourceRoot":"","sources":["../../src/internal/store-api-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,cAAc,iCAAiC,CAAC;AAE7D,eAAO,MAAM,4BAA4B,kBAAkB,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAkB,CAAC;AAEhE,oEAAoE;AACpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,O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AAC,oBAAoB,CAGrE,CAAC;AAEH,eAAO,MAAM,0BAA0B,gBAAgB,CAAC;AAExD,uCAAuC;AACvC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAQ/D,CAAC;AAEH,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,OAAO,0BAA0B,CAAC;IACrC,IAAI,EAAE,OAAO,0BAA0B,CAAC;IACxC,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAIjE,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,OAAO,0BAA0B,CAAC;IACrC,EAAE,EAAE,IAAI,CAAC;IACT,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI,CAAC;CACV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CASjE,CAAC"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* `POST /internal/agentsdk/store/api/<call>` carrying a versioned JSON
|
|
4
|
-
* envelope `{ v, call, payload }`. This is the lane where the **server** owns
|
|
5
|
-
* the storage pattern (journal sharding, rotation, compaction), so a
|
|
6
|
-
* pathological pattern is fixable in a backend deploy instead of a July
|
|
7
|
-
* release plus a rebake of every deployment. The verb lane (`/flush`,
|
|
8
|
-
* `/read`, `/list`) keeps carrying bulk presigned file IO.
|
|
9
|
-
*
|
|
10
|
-
* Deliberately duplicated on the backend
|
|
11
|
-
* (`backend/server/src/factory/agent-sdk/agentsdkStoreApiProtocol.ts`): this
|
|
12
|
-
* package is published to npm, so the backend cannot depend on it and it
|
|
13
|
-
* cannot depend on backend packages. A backend drift test compares the two
|
|
14
|
-
* sources — same shape as the hosted-delivery protocol twins — which is why
|
|
15
|
-
* every exported constant here stays a single `export const NAME = <literal>;`
|
|
16
|
-
* line and every schema field stays on its own line.
|
|
2
|
+
* Versioned wire contract for Cursor-managed store operations.
|
|
17
3
|
*
|
|
18
4
|
* Evolution rules (the compat contract): additive optional fields only; no
|
|
19
5
|
* renames, no retypes, no semantic reuse of an old field; unknown fields are
|
|
@@ -23,17 +9,15 @@
|
|
|
23
9
|
*/
|
|
24
10
|
import { z } from "zod";
|
|
25
11
|
export const STORE_API_PROTOCOL_VERSION = 1;
|
|
26
|
-
/**
|
|
12
|
+
/** Managed storage endpoint, with one trailing segment per call. */
|
|
27
13
|
export const STORE_API_PATH = "/internal/agentsdk/store/api";
|
|
28
14
|
export const STORE_API_MEMORY_APPEND_CALL = "memory.append";
|
|
29
15
|
/**
|
|
30
16
|
* Semantic cap on one serialized memory record. Text fields are truncated
|
|
31
17
|
* client-side (`memoryHook` default 2000 chars per field), so a well-formed
|
|
32
18
|
* record is a few KiB; 16 KiB is generous headroom, not a target. The cap is
|
|
33
|
-
* part of the wire contract but
|
|
34
|
-
*
|
|
35
|
-
* client (`cursor/store-api-client.ts`) pre-checks it before spending a
|
|
36
|
-
* doomed request.
|
|
19
|
+
* part of the wire contract but not the schema. The service enforces it as a
|
|
20
|
+
* typed 4xx, and the client checks it before sending a request.
|
|
37
21
|
*/
|
|
38
22
|
export const MEMORY_APPEND_MAX_RECORD_BYTES = 16 * 1024;
|
|
39
23
|
/** Serialized size of a record, as counted against the byte cap. */
|
|
@@ -61,8 +45,8 @@ export const turnMemoryRecordWireSchema = z
|
|
|
61
45
|
/**
|
|
62
46
|
* `memory.append` payload shape. The agent name becomes a store key segment
|
|
63
47
|
* on the server, so it must be exactly one segment. Unknown payload fields
|
|
64
|
-
* are stripped (= ignored), per the evolution rules. The
|
|
65
|
-
*
|
|
48
|
+
* are stripped (= ignored), per the evolution rules. The service owns the
|
|
49
|
+
* byte cap because it is a semantic limit rather than part of the shape.
|
|
66
50
|
*/
|
|
67
51
|
export const memoryAppendPayloadSchema = z.object({
|
|
68
52
|
agent: z
|