@cursor/bdk 0.2.6 → 0.2.8
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 +32 -8
- 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/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 +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 +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 +40 -44
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +108 -97
- 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-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +31 -18
- 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
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
/>
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
10
|
<title>agent-serve playground</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-MijLHTbB.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DPKLl4C_.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -1,37 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor-managed durable KV for hosted **architecture v2** agents.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* account (factorydb `agentsdk_deployment`) and persists rows in factorydb
|
|
8
|
-
* `agentsdk_kv` — v1's Bugbot-backed `/internal/agent-serve/storage/*`
|
|
9
|
-
* routes cannot resolve a v2 pod credential at all.
|
|
4
|
+
* Reads return opaque version tokens. Writes support unconditional updates,
|
|
5
|
+
* create-if-absent, and compare-and-swap. Lists use stable key pagination,
|
|
6
|
+
* and this client drains every page before returning.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - `POST /internal/agentsdk/kv/get`
|
|
14
|
-
* `{ key }` → `{ found, value, version }` — reads always carry the CAS
|
|
15
|
-
* version token ({@link KvV2GetResponse}).
|
|
16
|
-
* - `POST /internal/agentsdk/kv/put`
|
|
17
|
-
* `{ key, value, ifAbsent? | ifVersion? }` → `{ ok, version, current }`
|
|
18
|
-
* ({@link KvV2PutResponse}) — one write primitive: last-write-wins when
|
|
19
|
-
* unconditional (still bumps the token), atomic create-if-absent with
|
|
20
|
-
* `ifAbsent: true`, atomic compare-and-swap with `ifVersion`.
|
|
21
|
-
* - `POST /internal/agentsdk/kv/delete` `{ key }` → `{ ok }`.
|
|
22
|
-
* - `POST /internal/agentsdk/kv/list`
|
|
23
|
-
* `{ prefix, limit?, cursor?, keysOnly? }` → `{ entries, nextCursor }`
|
|
24
|
-
* ({@link KvV2ListResponse}) — ascending key order with keyset
|
|
25
|
-
* pagination. `list` / `listKeys` below drain every page, so the v1
|
|
26
|
-
* truncated-scan failure mode does not exist here.
|
|
27
|
-
*
|
|
28
|
-
* Eval runs still ride the v1 storage proxy's dedicated table (`evals`
|
|
29
|
-
* below); moving them to factorydb is a separate follow-up from the KV
|
|
30
|
-
* cutover.
|
|
31
|
-
*
|
|
32
|
-
* This backend is platform-selected for architecture v2
|
|
33
|
-
* (framework-storage-selection.ts) — authors never import it; `agent/storage.ts`
|
|
34
|
-
* is rejected on v2.
|
|
8
|
+
* This backend is selected automatically for architecture v2. Authors do
|
|
9
|
+
* not import it, and `agent/storage.ts` is rejected on v2.
|
|
35
10
|
*/
|
|
36
11
|
import type { StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
|
|
37
12
|
import type { JsonValue } from "../types.js";
|
|
@@ -70,12 +45,9 @@ type CursorHostedStorageV2Methods = Required<Pick<StorageConfig, "put" | "get" |
|
|
|
70
45
|
evals: StorageEvalsTable;
|
|
71
46
|
};
|
|
72
47
|
/**
|
|
73
|
-
* Architecture-v2
|
|
74
|
-
* `
|
|
75
|
-
*
|
|
76
|
-
* on the framework file store, so the only consumer of write-time ordering
|
|
77
|
-
* never reaches this backend and the engine's `list` fallback covers the
|
|
78
|
-
* rest.
|
|
48
|
+
* Architecture-v2 managed storage methods. The platform spreads these into
|
|
49
|
+
* `defineStorage({...})`. Session history uses the framework file store, so
|
|
50
|
+
* this backend does not need write-time ordering.
|
|
79
51
|
*/
|
|
80
52
|
export declare function cursorHostedStorageV2(options?: CursorHostedStorageOptions): CursorHostedStorageV2Methods;
|
|
81
53
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-hosted-v2.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted-v2.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cursor-hosted-v2.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted-v2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EAEb,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAiC,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB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
|
7
|
-
* account (factorydb `agentsdk_deployment`) and persists rows in factorydb
|
|
8
|
-
* `agentsdk_kv` — v1's Bugbot-backed `/internal/agent-serve/storage/*`
|
|
9
|
-
* routes cannot resolve a v2 pod credential at all.
|
|
4
|
+
* Reads return opaque version tokens. Writes support unconditional updates,
|
|
5
|
+
* create-if-absent, and compare-and-swap. Lists use stable key pagination,
|
|
6
|
+
* and this client drains every page before returning.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - `POST /internal/agentsdk/kv/get`
|
|
14
|
-
* `{ key }` → `{ found, value, version }` — reads always carry the CAS
|
|
15
|
-
* version token ({@link KvV2GetResponse}).
|
|
16
|
-
* - `POST /internal/agentsdk/kv/put`
|
|
17
|
-
* `{ key, value, ifAbsent? | ifVersion? }` → `{ ok, version, current }`
|
|
18
|
-
* ({@link KvV2PutResponse}) — one write primitive: last-write-wins when
|
|
19
|
-
* unconditional (still bumps the token), atomic create-if-absent with
|
|
20
|
-
* `ifAbsent: true`, atomic compare-and-swap with `ifVersion`.
|
|
21
|
-
* - `POST /internal/agentsdk/kv/delete` `{ key }` → `{ ok }`.
|
|
22
|
-
* - `POST /internal/agentsdk/kv/list`
|
|
23
|
-
* `{ prefix, limit?, cursor?, keysOnly? }` → `{ entries, nextCursor }`
|
|
24
|
-
* ({@link KvV2ListResponse}) — ascending key order with keyset
|
|
25
|
-
* pagination. `list` / `listKeys` below drain every page, so the v1
|
|
26
|
-
* truncated-scan failure mode does not exist here.
|
|
27
|
-
*
|
|
28
|
-
* Eval runs still ride the v1 storage proxy's dedicated table (`evals`
|
|
29
|
-
* below); moving them to factorydb is a separate follow-up from the KV
|
|
30
|
-
* cutover.
|
|
31
|
-
*
|
|
32
|
-
* This backend is platform-selected for architecture v2
|
|
33
|
-
* (framework-storage-selection.ts) — authors never import it; `agent/storage.ts`
|
|
34
|
-
* is rejected on v2.
|
|
8
|
+
* This backend is selected automatically for architecture v2. Authors do
|
|
9
|
+
* not import it, and `agent/storage.ts` is rejected on v2.
|
|
35
10
|
*/
|
|
36
11
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
12
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -84,15 +59,12 @@ function listAllPages(options, body) {
|
|
|
84
59
|
});
|
|
85
60
|
}
|
|
86
61
|
/**
|
|
87
|
-
* Architecture-v2
|
|
88
|
-
* `
|
|
89
|
-
*
|
|
90
|
-
* on the framework file store, so the only consumer of write-time ordering
|
|
91
|
-
* never reaches this backend and the engine's `list` fallback covers the
|
|
92
|
-
* rest.
|
|
62
|
+
* Architecture-v2 managed storage methods. The platform spreads these into
|
|
63
|
+
* `defineStorage({...})`. Session history uses the framework file store, so
|
|
64
|
+
* this backend does not need write-time ordering.
|
|
93
65
|
*/
|
|
94
66
|
export function cursorHostedStorageV2(options = {}) {
|
|
95
|
-
// Eval runs
|
|
67
|
+
// Eval runs use the managed eval-storage path.
|
|
96
68
|
const v1 = cursorHostedStorage(options);
|
|
97
69
|
return {
|
|
98
70
|
[CURSOR_HOSTED_STORAGE]: true,
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor-managed durable storage for hosted agents.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* deployment's rows.
|
|
9
|
-
*
|
|
10
|
-
* On Cursor-managed hosting the start script pins `CURSOR_API_BASE_URL` to
|
|
11
|
-
* `https://api.cursor.com` (where the proxy is mounted). Locally, point
|
|
12
|
-
* `CURSOR_API_BASE_URL` at a backend that mounts Agent Serve routes and use
|
|
13
|
-
* a deployment SA key, or use `@cursor/bdk/internal/file-kv` instead.
|
|
14
|
-
* Wiring it into a storage sink is internal-only `defineStorage`
|
|
15
|
-
* territory (see `storage.ts`).
|
|
4
|
+
* Uses the control-plane storage proxy with the deployment pod credential.
|
|
5
|
+
* The proxy scopes each request to the authenticated deployment, and the
|
|
6
|
+
* engine never receives a database URL. Cursor manages its storage
|
|
7
|
+
* environment variables; do not add them to `hosting.secretNames`.
|
|
16
8
|
*/
|
|
17
9
|
import type { StorageCasTable, StorageConfig, StorageEvalsTable } from "../storage.js";
|
|
18
10
|
import type { JsonValue } from "../types.js";
|
|
19
11
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
12
|
+
* Deployment identifier for diagnostics and self-hosted compatibility.
|
|
13
|
+
* The proxy scopes managed-storage requests by pod credential.
|
|
22
14
|
*/
|
|
23
15
|
export declare const AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR: "AGENT_SERVE_DEPLOYMENT_ID";
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* receive a database URL.
|
|
17
|
+
* Environment variables reserved for Cursor-managed storage. Do not include
|
|
18
|
+
* these names in `hosting.secretNames`.
|
|
28
19
|
*/
|
|
29
20
|
export declare const CURSOR_HOSTED_STORAGE_ENV_VARS: readonly [typeof AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR];
|
|
30
21
|
export interface CursorHostedStorageOptions {
|
|
@@ -37,18 +28,16 @@ export interface CursorHostedStorageOptions {
|
|
|
37
28
|
apiKey?: string;
|
|
38
29
|
/**
|
|
39
30
|
* Lazy credential, re-resolved on every call and preferred over
|
|
40
|
-
* {@link apiKey}
|
|
41
|
-
* key file after serve start, so a value captured at construct time
|
|
42
|
-
* would be permanently absent. Used by the platform-selected v2
|
|
43
|
-
* defaults; kept separate so `apiKey` stays a plain string for authors.
|
|
31
|
+
* {@link apiKey}.
|
|
44
32
|
*/
|
|
45
33
|
resolveApiKey?: () => string | undefined;
|
|
46
|
-
/**
|
|
34
|
+
/** Custom fetch implementation. */
|
|
47
35
|
fetch?: typeof fetch;
|
|
48
36
|
}
|
|
49
37
|
/**
|
|
50
38
|
* Marker stamped on {@link cursorHostedStorage} so the engine can prefer
|
|
51
|
-
* durable
|
|
39
|
+
* Cursor-managed durable state for session listing. It survives a
|
|
40
|
+
* `defineStorage` spread.
|
|
52
41
|
* Explicit `unique symbol` annotation required for `--isolatedDeclarations`
|
|
53
42
|
* (TS9010).
|
|
54
43
|
*/
|
|
@@ -81,8 +70,8 @@ export interface KvCasResponse {
|
|
|
81
70
|
export interface KvListKeysResponse {
|
|
82
71
|
keys: string[];
|
|
83
72
|
/**
|
|
84
|
-
* Set when
|
|
85
|
-
*
|
|
73
|
+
* Set when `keys` is incomplete. Older servers may omit it, which is
|
|
74
|
+
* treated as `false`.
|
|
86
75
|
*/
|
|
87
76
|
truncated?: boolean;
|
|
88
77
|
}
|
|
@@ -93,14 +82,12 @@ export declare class StorageRpcError extends Error {
|
|
|
93
82
|
constructor(message: string, reasonCode: string, status: number);
|
|
94
83
|
}
|
|
95
84
|
/**
|
|
96
|
-
*
|
|
97
|
-
* architecture-v2 backend (`cursor-hosted-v2.ts`), which speaks a different
|
|
98
|
-
* route family over the same transport and credential chain.
|
|
85
|
+
* Send one authenticated request through the control-plane proxy.
|
|
99
86
|
*/
|
|
100
87
|
export declare function storageRpc<T>(options: CursorHostedStorageOptions, path: string, body: Record<string, unknown>): Promise<T>;
|
|
101
88
|
/**
|
|
102
|
-
* Cursor-
|
|
103
|
-
*
|
|
89
|
+
* Cursor-managed durable storage methods. Requests use the control-plane
|
|
90
|
+
* proxy and deployment pod credential. Spread into `defineStorage({...})`.
|
|
104
91
|
*/
|
|
105
92
|
export declare function cursorHostedStorage(options?: CursorHostedStorageOptions): CursorHostedStorageMethods;
|
|
106
93
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-hosted.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cursor-hosted.d.ts","sourceRoot":"","sources":["../../src/storage-backends/cursor-hosted.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,eA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;IACjE,OAAO,EAAE;QAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC9D;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAaD,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAK9D;CACF;AAuCD;;GAEG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,0BAA0B,EACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CA8CZ;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,0BAA0B,CAiH5B"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor-managed durable storage for hosted agents.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* deployment's rows.
|
|
9
|
-
*
|
|
10
|
-
* On Cursor-managed hosting the start script pins `CURSOR_API_BASE_URL` to
|
|
11
|
-
* `https://api.cursor.com` (where the proxy is mounted). Locally, point
|
|
12
|
-
* `CURSOR_API_BASE_URL` at a backend that mounts Agent Serve routes and use
|
|
13
|
-
* a deployment SA key, or use `@cursor/bdk/internal/file-kv` instead.
|
|
14
|
-
* Wiring it into a storage sink is internal-only `defineStorage`
|
|
15
|
-
* territory (see `storage.ts`).
|
|
4
|
+
* Uses the control-plane storage proxy with the deployment pod credential.
|
|
5
|
+
* The proxy scopes each request to the authenticated deployment, and the
|
|
6
|
+
* engine never receives a database URL. Cursor manages its storage
|
|
7
|
+
* environment variables; do not add them to `hosting.secretNames`.
|
|
16
8
|
*/
|
|
17
9
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
10
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -26,28 +18,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
26
18
|
import { injectActiveTraceContext } from "../otel.js";
|
|
27
19
|
/**
|
|
28
20
|
* Same default as {@link cursorExternalApiUrl} in the CLI credentials module,
|
|
29
|
-
*
|
|
30
|
-
* Hosted monorepo examples load this file from `packages/agent-serve/src`
|
|
31
|
-
* while `npm install` runs in the example package — a credentials import
|
|
32
|
-
* would resolve `zod` from the wrong `node_modules` tree and crash serve.
|
|
21
|
+
* kept local so this storage entrypoint does not import CLI dependencies.
|
|
33
22
|
*/
|
|
34
23
|
const DEFAULT_CURSOR_EXTERNAL_API_URL = "https://api.cursor.com";
|
|
35
24
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
25
|
+
* Deployment identifier for diagnostics and self-hosted compatibility.
|
|
26
|
+
* The proxy scopes managed-storage requests by pod credential.
|
|
38
27
|
*/
|
|
39
28
|
export const AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR = "AGENT_SERVE_DEPLOYMENT_ID";
|
|
40
29
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* receive a database URL.
|
|
30
|
+
* Environment variables reserved for Cursor-managed storage. Do not include
|
|
31
|
+
* these names in `hosting.secretNames`.
|
|
44
32
|
*/
|
|
45
33
|
export const CURSOR_HOSTED_STORAGE_ENV_VARS = [
|
|
46
34
|
AGENT_SERVE_DEPLOYMENT_ID_ENV_VAR,
|
|
47
35
|
];
|
|
48
36
|
/**
|
|
49
37
|
* Marker stamped on {@link cursorHostedStorage} so the engine can prefer
|
|
50
|
-
* durable
|
|
38
|
+
* Cursor-managed durable state for session listing. It survives a
|
|
39
|
+
* `defineStorage` spread.
|
|
51
40
|
* Explicit `unique symbol` annotation required for `--isolatedDeclarations`
|
|
52
41
|
* (TS9010).
|
|
53
42
|
*/
|
|
@@ -109,9 +98,7 @@ function resolveBaseUrl(options) {
|
|
|
109
98
|
return raw.endsWith("/") ? raw.slice(0, -1) : raw;
|
|
110
99
|
}
|
|
111
100
|
/**
|
|
112
|
-
*
|
|
113
|
-
* architecture-v2 backend (`cursor-hosted-v2.ts`), which speaks a different
|
|
114
|
-
* route family over the same transport and credential chain.
|
|
101
|
+
* Send one authenticated request through the control-plane proxy.
|
|
115
102
|
*/
|
|
116
103
|
export function storageRpc(options, path, body) {
|
|
117
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -162,8 +149,8 @@ export function storageRpc(options, path, body) {
|
|
|
162
149
|
});
|
|
163
150
|
}
|
|
164
151
|
/**
|
|
165
|
-
* Cursor-
|
|
166
|
-
*
|
|
152
|
+
* Cursor-managed durable storage methods. Requests use the control-plane
|
|
153
|
+
* proxy and deployment pod credential. Spread into `defineStorage({...})`.
|
|
167
154
|
*/
|
|
168
155
|
export function cursorHostedStorage(options = {}) {
|
|
169
156
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Durable session KV contract: key families plus a tolerant SessionRecord
|
|
3
|
-
* decoder.
|
|
4
|
-
*
|
|
3
|
+
* decoder. Both hosted architectures use the same key shape under their
|
|
4
|
+
* versioned roots.
|
|
5
5
|
*
|
|
6
|
-
* Additive JSON only
|
|
6
|
+
* Additive JSON only: unknown fields are ignored.
|
|
7
7
|
*/
|
|
8
8
|
/** Legacy architecture-v1 storage root. */
|
|
9
9
|
export declare const STORAGE_KEY_ROOT: "agentkit/v1";
|
|
@@ -16,39 +16,18 @@ export declare const AGENTSDK_STORAGE_KEY_ROOT: "agentsdk/v1";
|
|
|
16
16
|
* Build the framework-owned key scheme under one versioned root. Channel ids
|
|
17
17
|
* and continuation tokens are URI-encoded, and oversized segments are
|
|
18
18
|
* replaced by a deterministic `sha256:…` digest.
|
|
19
|
-
*
|
|
20
|
-
* | Key | Value |
|
|
21
|
-
* | --- | --- |
|
|
22
|
-
* | `{root}/{agent}/session/{sessionId}` | `SessionRecord` |
|
|
23
|
-
* | `{root}/{agent}/session-events/{sessionId}/{index}` | `SessionEvent[]` chunk (index = first event's index, zero-padded) |
|
|
24
|
-
* | `{root}/{agent}/session-runs/{sessionPublicId}` | One session-level hosted-execution log (executions[] + lastFailure) |
|
|
25
|
-
* | `{root}/{agent}/logs/{logId}` | Hosted engine stdout/stderr tee (on-disk `start.log`; `ses_…` after send, `wf:{workflowId}` on admission failure) |
|
|
26
|
-
* | `{root}/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
|
|
27
|
-
* | `{root}/{agent}/kv/{key}` | Author JSON via `HostContext.kv` |
|
|
28
|
-
*
|
|
29
|
-
* The `eval-runs` family is minted only by the table `defineStorage`
|
|
30
|
-
* derives over the KV core; a backend that authors a dedicated
|
|
31
|
-
* `StorageConfig.evals` group never sees it.
|
|
32
19
|
*/
|
|
33
20
|
declare function createStorageKeys(root: string): {
|
|
34
21
|
readonly session: (agent: string, sessionId: string) => string;
|
|
35
22
|
readonly sessionPrefix: (agent: string) => string;
|
|
36
23
|
readonly sessionEvents: (agent: string, sessionId: string, firstIndex: number) => string;
|
|
37
24
|
readonly sessionEventsPrefix: (agent: string, sessionId: string) => string;
|
|
38
|
-
/**
|
|
39
|
-
* One session-level hosted-execution log (v2 only). `sessionPublicId` is
|
|
40
|
-
* the factory `ses_…` so a throw that never minted a July session still
|
|
41
|
-
* lands under a stable key. Per-execution rows live inside the document.
|
|
42
|
-
*/
|
|
25
|
+
/** One session-level hosted execution log. */
|
|
43
26
|
readonly sessionRun: (agent: string, sessionPublicId: string) => string;
|
|
44
27
|
readonly sessionRunsPrefix: (agent: string) => string;
|
|
45
28
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* `wf:{workflowId}` / `wf:{workflowId}/{runId}` when admission fails
|
|
49
|
-
* before a session exists. Skip/task admissions do not write this key.
|
|
50
|
-
* Stored as raw UTF-8, not JSON — the file store accepts 64 MiB
|
|
51
|
-
* objects, and this key is flushed in snapshots, not per line.
|
|
29
|
+
* Hosted execution output, keyed by session or by workflow when no
|
|
30
|
+
* session exists.
|
|
52
31
|
*/
|
|
53
32
|
readonly log: (agent: string, logId: string) => string;
|
|
54
33
|
readonly logsPrefix: (agent: string) => string;
|
|
@@ -59,7 +38,7 @@ declare function createStorageKeys(root: string): {
|
|
|
59
38
|
*/
|
|
60
39
|
readonly kv: (agent: string, key: string) => string;
|
|
61
40
|
readonly kvPrefix: (agent: string) => string;
|
|
62
|
-
/** One playground eval-run snapshot
|
|
41
|
+
/** One playground eval-run snapshot. */
|
|
63
42
|
readonly evalRun: (agent: string, runId: string) => string;
|
|
64
43
|
readonly evalRunsPrefix: (agent: string) => string;
|
|
65
44
|
};
|
|
@@ -71,18 +50,14 @@ export declare const agentSdkStorageKeys: StorageKeys;
|
|
|
71
50
|
export declare function storageKeysForArchitecture(architecture: "v1" | "v2" | undefined): StorageKeys;
|
|
72
51
|
/**
|
|
73
52
|
* Max bytes a caller-controlled key segment may occupy after URI-encoding.
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* replaced by their SHA-256 digest, keeping every minted key bounded.
|
|
53
|
+
* Longer segments use their SHA-256 digest so every minted key stays within
|
|
54
|
+
* supported storage limits.
|
|
77
55
|
*/
|
|
78
56
|
export declare const MAX_KEY_SEGMENT_BYTES = 256;
|
|
79
57
|
/**
|
|
80
|
-
* Stable
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* (`wf:{workflowId}` or `wf:{workflowId}/{runId}`) so the object joins
|
|
84
|
-
* the Temporal UI. A successful skip/task writes nothing — there is no
|
|
85
|
-
* customer log.
|
|
58
|
+
* Stable execution-log id. Prefer the session id, then use the workflow
|
|
59
|
+
* identity for failures before a session exists. Successful work without a
|
|
60
|
+
* session writes no log.
|
|
86
61
|
*/
|
|
87
62
|
export declare function frameworkStartLogId(args: {
|
|
88
63
|
sessionPublicId?: string | null;
|
|
@@ -135,7 +110,7 @@ export declare function summarizeDurableSessionRecord(args: {
|
|
|
135
110
|
}): DurableSessionSummary;
|
|
136
111
|
/**
|
|
137
112
|
* Golden persisted record: required list fields plus extras a future engine
|
|
138
|
-
* might write.
|
|
113
|
+
* might write. Package and service decoders must both accept it.
|
|
139
114
|
*/
|
|
140
115
|
export declare const GOLDEN_DURABLE_SESSION_RECORD: Record<string, unknown>;
|
|
141
116
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage-protocol.d.ts","sourceRoot":"","sources":["../src/storage-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,EAAG,aAAsB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAG,aAAsB,CAAC;AAQhE
|
|
1
|
+
{"version":3,"file":"storage-protocol.d.ts","sourceRoot":"","sources":["../src/storage-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,EAAG,aAAsB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAG,aAAsB,CAAC;AAQhE;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM;aAEnC,OAAO,UAAU,MAAM,aAAa,MAAM,KAAG,MAAM;aACnD,aAAa,UAAU,MAAM,KAAG,MAAM;aACtC,aAAa,UAAU,MAAM,aAAa,MAAM,cAAc,MAAM,KAAG,MAAM;aAE7E,mBAAmB,UAAU,MAAM,aAAa,MAAM,KAAG,MAAM;IAE/D,8CA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AAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B,CAAC;AAMF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CAuC1F;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,qBAAqB,CAYxB;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAYjE,CAAC"}
|
package/dist/storage-protocol.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Durable session KV contract: key families plus a tolerant SessionRecord
|
|
3
|
-
* decoder.
|
|
4
|
-
*
|
|
3
|
+
* decoder. Both hosted architectures use the same key shape under their
|
|
4
|
+
* versioned roots.
|
|
5
5
|
*
|
|
6
|
-
* Additive JSON only
|
|
6
|
+
* Additive JSON only: unknown fields are ignored.
|
|
7
7
|
*/
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { isRecord } from "./internal/is-record.js";
|
|
@@ -16,26 +16,13 @@ export const STORAGE_KEY_ROOT = "agentkit/v1";
|
|
|
16
16
|
export const AGENTSDK_STORAGE_KEY_ROOT = "agentsdk/v1";
|
|
17
17
|
/**
|
|
18
18
|
* Exact session-record keys: `{agentkit|agentsdk}/v1/{agent}/session/{sessionId}`.
|
|
19
|
-
* Rejects `session-events/` and the
|
|
19
|
+
* Rejects `session-events/` and the reserved `_cp` agent name.
|
|
20
20
|
*/
|
|
21
21
|
const DURABLE_SESSION_RECORD_KEY_RE = /^(agentkit|agentsdk)\/v1\/([^/]+)\/session\/([^/]+)$/;
|
|
22
22
|
/**
|
|
23
23
|
* Build the framework-owned key scheme under one versioned root. Channel ids
|
|
24
24
|
* and continuation tokens are URI-encoded, and oversized segments are
|
|
25
25
|
* replaced by a deterministic `sha256:…` digest.
|
|
26
|
-
*
|
|
27
|
-
* | Key | Value |
|
|
28
|
-
* | --- | --- |
|
|
29
|
-
* | `{root}/{agent}/session/{sessionId}` | `SessionRecord` |
|
|
30
|
-
* | `{root}/{agent}/session-events/{sessionId}/{index}` | `SessionEvent[]` chunk (index = first event's index, zero-padded) |
|
|
31
|
-
* | `{root}/{agent}/session-runs/{sessionPublicId}` | One session-level hosted-execution log (executions[] + lastFailure) |
|
|
32
|
-
* | `{root}/{agent}/logs/{logId}` | Hosted engine stdout/stderr tee (on-disk `start.log`; `ses_…` after send, `wf:{workflowId}` on admission failure) |
|
|
33
|
-
* | `{root}/{agent}/continuation/{channelId}/{token}` | `{ sessionId }` |
|
|
34
|
-
* | `{root}/{agent}/kv/{key}` | Author JSON via `HostContext.kv` |
|
|
35
|
-
*
|
|
36
|
-
* The `eval-runs` family is minted only by the table `defineStorage`
|
|
37
|
-
* derives over the KV core; a backend that authors a dedicated
|
|
38
|
-
* `StorageConfig.evals` group never sees it.
|
|
39
26
|
*/
|
|
40
27
|
function createStorageKeys(root) {
|
|
41
28
|
return {
|
|
@@ -43,20 +30,12 @@ function createStorageKeys(root) {
|
|
|
43
30
|
sessionPrefix: (agent) => `${root}/${agent}/session/`,
|
|
44
31
|
sessionEvents: (agent, sessionId, firstIndex) => `${root}/${agent}/session-events/${sessionId}/${String(firstIndex).padStart(8, "0")}`,
|
|
45
32
|
sessionEventsPrefix: (agent, sessionId) => `${root}/${agent}/session-events/${sessionId}/`,
|
|
46
|
-
/**
|
|
47
|
-
* One session-level hosted-execution log (v2 only). `sessionPublicId` is
|
|
48
|
-
* the factory `ses_…` so a throw that never minted a July session still
|
|
49
|
-
* lands under a stable key. Per-execution rows live inside the document.
|
|
50
|
-
*/
|
|
33
|
+
/** One session-level hosted execution log. */
|
|
51
34
|
sessionRun: (agent, sessionPublicId) => `${root}/${agent}/session-runs/${keySegment(sessionPublicId)}`,
|
|
52
35
|
sessionRunsPrefix: (agent) => `${root}/${agent}/session-runs/`,
|
|
53
36
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `wf:{workflowId}` / `wf:{workflowId}/{runId}` when admission fails
|
|
57
|
-
* before a session exists. Skip/task admissions do not write this key.
|
|
58
|
-
* Stored as raw UTF-8, not JSON — the file store accepts 64 MiB
|
|
59
|
-
* objects, and this key is flushed in snapshots, not per line.
|
|
37
|
+
* Hosted execution output, keyed by session or by workflow when no
|
|
38
|
+
* session exists.
|
|
60
39
|
*/
|
|
61
40
|
log: (agent, logId) => `${root}/${agent}/logs/${keySegment(logId)}`,
|
|
62
41
|
logsPrefix: (agent) => `${root}/${agent}/logs/`,
|
|
@@ -67,7 +46,7 @@ function createStorageKeys(root) {
|
|
|
67
46
|
*/
|
|
68
47
|
kv: (agent, key) => `${root}/${agent}/kv/${keySegment(key)}`,
|
|
69
48
|
kvPrefix: (agent) => `${root}/${agent}/kv/`,
|
|
70
|
-
/** One playground eval-run snapshot
|
|
49
|
+
/** One playground eval-run snapshot. */
|
|
71
50
|
evalRun: (agent, runId) => `${root}/${agent}/eval-runs/${keySegment(runId)}`,
|
|
72
51
|
evalRunsPrefix: (agent) => `${root}/${agent}/eval-runs/`,
|
|
73
52
|
};
|
|
@@ -81,18 +60,14 @@ export function storageKeysForArchitecture(architecture) {
|
|
|
81
60
|
}
|
|
82
61
|
/**
|
|
83
62
|
* Max bytes a caller-controlled key segment may occupy after URI-encoding.
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* replaced by their SHA-256 digest, keeping every minted key bounded.
|
|
63
|
+
* Longer segments use their SHA-256 digest so every minted key stays within
|
|
64
|
+
* supported storage limits.
|
|
87
65
|
*/
|
|
88
66
|
export const MAX_KEY_SEGMENT_BYTES = 256;
|
|
89
67
|
/**
|
|
90
|
-
* Stable
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* (`wf:{workflowId}` or `wf:{workflowId}/{runId}`) so the object joins
|
|
94
|
-
* the Temporal UI. A successful skip/task writes nothing — there is no
|
|
95
|
-
* customer log.
|
|
68
|
+
* Stable execution-log id. Prefer the session id, then use the workflow
|
|
69
|
+
* identity for failures before a session exists. Successful work without a
|
|
70
|
+
* session writes no log.
|
|
96
71
|
*/
|
|
97
72
|
export function frameworkStartLogId(args) {
|
|
98
73
|
var _a, _b, _c;
|
|
@@ -184,7 +159,7 @@ export function summarizeDurableSessionRecord(args) {
|
|
|
184
159
|
}
|
|
185
160
|
/**
|
|
186
161
|
* Golden persisted record: required list fields plus extras a future engine
|
|
187
|
-
* might write.
|
|
162
|
+
* might write. Package and service decoders must both accept it.
|
|
188
163
|
*/
|
|
189
164
|
export const GOLDEN_DURABLE_SESSION_RECORD = {
|
|
190
165
|
sessionId: "ses_aaaaaaaaaaaaaaaaaaaaaaaa",
|