@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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Session workspace materialization. Each session gets its own working
|
|
3
3
|
* directory that the Cursor harness treats as the project: skills land in
|
|
4
4
|
* `.cursor/skills/<name>/SKILL.md`, agent-side tools land in
|
|
5
|
-
* `.agent-serve/tools/<name>.sh`, and `
|
|
5
|
+
* `.agent-serve/tools/<name>.sh`, and `bot/sandbox/workspace/**` seed files
|
|
6
6
|
* are mirrored in. The harness picks all of this up natively through its
|
|
7
7
|
* project setting source. Instructions are not written here: local turns
|
|
8
8
|
* deliver them as the harness system prompt ({@link buildAgentsMdContent}),
|
|
@@ -28,22 +28,20 @@ import { parseFrontmatter, serializeFrontmatter } from "./frontmatter.js";
|
|
|
28
28
|
import { buildIdentitySection } from "./prompt-context.js";
|
|
29
29
|
const execFileAsync = promisify(execFile);
|
|
30
30
|
/**
|
|
31
|
-
* First-turn preamble
|
|
32
|
-
* deployments: cloud VMs read the memory journal from the store mount.
|
|
31
|
+
* First-turn preamble for cloud sessions that read managed memory.
|
|
33
32
|
*/
|
|
34
33
|
export function buildCloudMemorySection(agentName) {
|
|
35
34
|
const dir = `${DEPLOYMENT_STORE_MOUNT_PATH}/${agentStoreKeys.memoryDir(agentName)}`;
|
|
36
35
|
return [
|
|
37
36
|
"## Shared session memory",
|
|
38
37
|
"",
|
|
39
|
-
`The cross-session memory journal (the \`memory/\` directory your instructions may reference)
|
|
38
|
+
`The cross-session memory journal (the \`memory/\` directory your instructions may reference) is available at \`${dir}\` on this machine. Read \`${dir}/journal.jsonl\` with your normal file tools.`,
|
|
40
39
|
].join("\n");
|
|
41
40
|
}
|
|
42
41
|
/**
|
|
43
42
|
* First-turn preamble section for cloud-runtime sessions with authored
|
|
44
|
-
* `
|
|
45
|
-
*
|
|
46
|
-
* `syncWorkspaceToStore`), so the model has to be told where they are.
|
|
43
|
+
* `bot/sandbox/workspace/**` seeds. The prompt names their managed storage
|
|
44
|
+
* path because cloud turns have no local materialized workspace.
|
|
47
45
|
*/
|
|
48
46
|
export function buildCloudWorkspaceSection(dir) {
|
|
49
47
|
return [
|
|
@@ -53,19 +51,16 @@ export function buildCloudWorkspaceSection(dir) {
|
|
|
53
51
|
].join("\n");
|
|
54
52
|
}
|
|
55
53
|
/**
|
|
56
|
-
* Per-turn preamble for cloud `workspaceFiles` after they
|
|
57
|
-
* session
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* Same shared Agent Store mount as authored seeds — the session path is
|
|
61
|
-
* replace-per-send / task-end wipe lifetime, not a separate mount ACL.
|
|
54
|
+
* Per-turn preamble for cloud `workspaceFiles` after they reach
|
|
55
|
+
* session-scoped storage. Omitted when the sync did not land. The session
|
|
56
|
+
* path is replaced on each send and removed when a task session ends.
|
|
62
57
|
*/
|
|
63
58
|
export function buildCloudSessionWorkspaceSection(dir, relPaths) {
|
|
64
59
|
const listed = relPaths.map(path => `\`${path}\``).join(", ");
|
|
65
60
|
return [
|
|
66
61
|
"## Session workspace files",
|
|
67
62
|
"",
|
|
68
|
-
`This turn's workspace files
|
|
63
|
+
`This turn's workspace files are available at \`${dir}\` on this machine (${listed}). Read them with your normal file tools. The session directory is replaced on the next send for this session, and task sessions remove it when they finish.`,
|
|
69
64
|
].join("\n");
|
|
70
65
|
}
|
|
71
66
|
/** Relative path of an agent-side tool script inside the session workspace. */
|
package/dist/memory.d.ts
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Session memory
|
|
2
|
+
* Session memory is a journal of what every session of this agent did, so
|
|
3
3
|
* later sessions can recall and build on past work.
|
|
4
4
|
*
|
|
5
5
|
* The write side is {@link memoryHook}, authored as a thin re-export at
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* usage) to `<stateRoot>/memory/journal.jsonl`.
|
|
6
|
+
* `bot/hooks/memory.ts`. After each turn it appends one record to
|
|
7
|
+
* `<stateRoot>/memory/journal.jsonl`.
|
|
9
8
|
*
|
|
10
9
|
* There is no read-side API. The framework symlinks `<stateRoot>/memory`
|
|
11
10
|
* into every session workspace as `memory/`, so agents read the journal
|
|
12
11
|
* with their normal file tools (`instructions.md` points them at it). That
|
|
13
12
|
* filesystem visibility is why memory does not route through
|
|
14
13
|
* `defineStorage` sinks, which are opaque to the model. A custom
|
|
15
|
-
* {@link MemoryBackend}
|
|
16
|
-
* path — typically a server tool under `agent/tools/`, which can resolve
|
|
17
|
-
* state via `ctx.stateRoot`.
|
|
14
|
+
* {@link MemoryBackend} supplies its own read path.
|
|
18
15
|
*
|
|
19
16
|
* On Cursor-managed hosting the default is {@link agentStoreMemoryBackend}:
|
|
20
|
-
* the journal
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* and mirrored to `<stateRoot>/memory/journal.jsonl` (hydrated per session
|
|
24
|
-
* via `memory.read`, appended locally per turn) so the workspace symlink
|
|
25
|
-
* read path keeps working for local-runtime turns. The
|
|
26
|
-
* `factory-api-v1` pin file exists only on hosted pods — plain local dev
|
|
27
|
-
* runs {@link fileMemoryBackend} and never sees the hosted lane.
|
|
17
|
+
* the journal survives deployment replacement and is mirrored locally so
|
|
18
|
+
* file tools keep the same read path. Local development uses
|
|
19
|
+
* {@link fileMemoryBackend}.
|
|
28
20
|
*/
|
|
29
21
|
import { type CursorHostedFilesOptions } from "./files-backends/cursor-hosted.js";
|
|
30
22
|
import { type StoreApiClient } from "./internal/cursor/store-api-client.js";
|
|
@@ -57,7 +49,7 @@ export interface MemoryBackend {
|
|
|
57
49
|
/**
|
|
58
50
|
* Optional session-start hook: bring the backend's local read path up to
|
|
59
51
|
* date before the session's first turn reads it. A freshness upgrade, not
|
|
60
|
-
* a correctness gate
|
|
52
|
+
* a correctness gate; implementations soft-fail and keep whatever read
|
|
61
53
|
* state already exists.
|
|
62
54
|
*/
|
|
63
55
|
prepareSession?(ctx: {
|
|
@@ -74,45 +66,27 @@ export interface FileMemoryBackendOptions {
|
|
|
74
66
|
}
|
|
75
67
|
/**
|
|
76
68
|
* Local default backend: append-only JSONL at `<stateRoot>/memory/journal.jsonl`
|
|
77
|
-
*
|
|
69
|
+
* in the directory the framework symlinks into session workspaces. Rotated
|
|
78
70
|
* segments stay alongside as `journal-<epoch-ms>.jsonl`.
|
|
79
71
|
*/
|
|
80
72
|
export declare function fileMemoryBackend(options?: FileMemoryBackendOptions): MemoryBackend;
|
|
81
73
|
export interface AgentStoreMemoryBackendOptions {
|
|
82
74
|
/**
|
|
83
75
|
* Local mirror rotation threshold, same meaning as
|
|
84
|
-
* {@link FileMemoryBackendOptions}.
|
|
85
|
-
*
|
|
76
|
+
* {@link FileMemoryBackendOptions}. Managed storage controls the durable
|
|
77
|
+
* journal's retention independently.
|
|
86
78
|
*/
|
|
87
79
|
maxJournalBytes?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Cursor-hosted transport overrides (tests): base URL, credential, store
|
|
90
|
-
* source id, protocol pin, fetch. Feeds the default
|
|
91
|
-
* {@link storeApiClient} and the lane-availability check.
|
|
92
|
-
*/
|
|
80
|
+
/** Cursor-managed storage overrides. */
|
|
93
81
|
hosted?: CursorHostedFilesOptions;
|
|
94
|
-
/**
|
|
95
|
-
* Domain-lane client override (tests). Defaults to
|
|
96
|
-
* {@link createStoreApiClient} over {@link hosted} — the module that owns
|
|
97
|
-
* the `memory.append` / `memory.read` transport, typed errors, and
|
|
98
|
-
* bounded backoff.
|
|
99
|
-
*/
|
|
82
|
+
/** Managed storage client override. */
|
|
100
83
|
storeApiClient?: StoreApiClient;
|
|
101
84
|
}
|
|
102
85
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* fixable in a backend deploy instead of a July release plus a rebake.
|
|
108
|
-
*
|
|
109
|
-
* There is no client-composed fallback. The read-modify-write CAS lane that
|
|
110
|
-
* predated the domain call (and caused the 2026-09-18 Agent Store read
|
|
111
|
-
* storm) was removed in 0.2.1 together with v2 hosting binding the
|
|
112
|
-
* `factory-api-v1` pin unconditionally and refusing artifacts frozen on an
|
|
113
|
-
* older July. A hosted pod without the pin is therefore a misconfiguration
|
|
114
|
-
* (a server predating the pin change, or a local env naming a hosted store
|
|
115
|
-
* without one): records are dropped loudly, never written client-side.
|
|
86
|
+
* Cursor-managed journal that survives deployment replacement. Managed
|
|
87
|
+
* storage owns append, read, and rotation. If managed storage is unavailable,
|
|
88
|
+
* records are dropped with an error instead of falling back to a second
|
|
89
|
+
* persistence path.
|
|
116
90
|
*/
|
|
117
91
|
export declare function agentStoreMemoryBackend(options?: AgentStoreMemoryBackendOptions): MemoryBackend;
|
|
118
92
|
export interface MemoryHookOptions {
|
package/dist/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAe,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEzE,sEAAsE;AACtE,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC5B,UAAU,CACR,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,CAAC,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E;AAED,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,aAAa,CA6BvF;AAED,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wCAAwC;IACxC,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAClC,uCAAuC;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,8BAAmC,GAC3C,aAAa,CA6Jf;AAgBD,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,cAAc,CAgG1E"}
|
package/dist/memory.js
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Session memory
|
|
2
|
+
* Session memory is a journal of what every session of this agent did, so
|
|
3
3
|
* later sessions can recall and build on past work.
|
|
4
4
|
*
|
|
5
5
|
* The write side is {@link memoryHook}, authored as a thin re-export at
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* usage) to `<stateRoot>/memory/journal.jsonl`.
|
|
6
|
+
* `bot/hooks/memory.ts`. After each turn it appends one record to
|
|
7
|
+
* `<stateRoot>/memory/journal.jsonl`.
|
|
9
8
|
*
|
|
10
9
|
* There is no read-side API. The framework symlinks `<stateRoot>/memory`
|
|
11
10
|
* into every session workspace as `memory/`, so agents read the journal
|
|
12
11
|
* with their normal file tools (`instructions.md` points them at it). That
|
|
13
12
|
* filesystem visibility is why memory does not route through
|
|
14
13
|
* `defineStorage` sinks, which are opaque to the model. A custom
|
|
15
|
-
* {@link MemoryBackend}
|
|
16
|
-
* path — typically a server tool under `agent/tools/`, which can resolve
|
|
17
|
-
* state via `ctx.stateRoot`.
|
|
14
|
+
* {@link MemoryBackend} supplies its own read path.
|
|
18
15
|
*
|
|
19
16
|
* On Cursor-managed hosting the default is {@link agentStoreMemoryBackend}:
|
|
20
|
-
* the journal
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* and mirrored to `<stateRoot>/memory/journal.jsonl` (hydrated per session
|
|
24
|
-
* via `memory.read`, appended locally per turn) so the workspace symlink
|
|
25
|
-
* read path keeps working for local-runtime turns. The
|
|
26
|
-
* `factory-api-v1` pin file exists only on hosted pods — plain local dev
|
|
27
|
-
* runs {@link fileMemoryBackend} and never sees the hosted lane.
|
|
17
|
+
* the journal survives deployment replacement and is mirrored locally so
|
|
18
|
+
* file tools keep the same read path. Local development uses
|
|
19
|
+
* {@link fileMemoryBackend}.
|
|
28
20
|
*/
|
|
29
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
30
22
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -46,7 +38,7 @@ import { createStoreApiClient, isStoreApiLaneEnabled, } from "./internal/cursor/
|
|
|
46
38
|
export const MEMORY_DIR_NAME = "memory";
|
|
47
39
|
/**
|
|
48
40
|
* Local default backend: append-only JSONL at `<stateRoot>/memory/journal.jsonl`
|
|
49
|
-
*
|
|
41
|
+
* in the directory the framework symlinks into session workspaces. Rotated
|
|
50
42
|
* segments stay alongside as `journal-<epoch-ms>.jsonl`.
|
|
51
43
|
*/
|
|
52
44
|
export function fileMemoryBackend(options = {}) {
|
|
@@ -56,7 +48,7 @@ export function fileMemoryBackend(options = {}) {
|
|
|
56
48
|
// sessions, so appends to the shared journal are chained per path. A
|
|
57
49
|
// failed append must not poison the chain for later turns.
|
|
58
50
|
const appendChains = new Map();
|
|
59
|
-
// Same-millisecond rotations must not reuse a segment name
|
|
51
|
+
// Same-millisecond rotations must not reuse a segment name; POSIX
|
|
60
52
|
// rename would silently replace the earlier archive.
|
|
61
53
|
let rotationSeq = 0;
|
|
62
54
|
return {
|
|
@@ -86,19 +78,10 @@ export function fileMemoryBackend(options = {}) {
|
|
|
86
78
|
};
|
|
87
79
|
}
|
|
88
80
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* fixable in a backend deploy instead of a July release plus a rebake.
|
|
94
|
-
*
|
|
95
|
-
* There is no client-composed fallback. The read-modify-write CAS lane that
|
|
96
|
-
* predated the domain call (and caused the 2026-09-18 Agent Store read
|
|
97
|
-
* storm) was removed in 0.2.1 together with v2 hosting binding the
|
|
98
|
-
* `factory-api-v1` pin unconditionally and refusing artifacts frozen on an
|
|
99
|
-
* older July. A hosted pod without the pin is therefore a misconfiguration
|
|
100
|
-
* (a server predating the pin change, or a local env naming a hosted store
|
|
101
|
-
* without one): records are dropped loudly, never written client-side.
|
|
81
|
+
* Cursor-managed journal that survives deployment replacement. Managed
|
|
82
|
+
* storage owns append, read, and rotation. If managed storage is unavailable,
|
|
83
|
+
* records are dropped with an error instead of falling back to a second
|
|
84
|
+
* persistence path.
|
|
102
85
|
*/
|
|
103
86
|
export function agentStoreMemoryBackend(options = {}) {
|
|
104
87
|
var _a, _b, _c;
|
|
@@ -108,23 +91,13 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
108
91
|
// fileMemoryBackend): hydration and appends on one agent's mirror never
|
|
109
92
|
// interleave, and a failed step must not poison the chain for later turns.
|
|
110
93
|
const appendChains = new Map();
|
|
111
|
-
//
|
|
112
|
-
// client; this module only decides which lane an append takes.
|
|
94
|
+
// The client owns retries and typed errors; this module owns memory policy.
|
|
113
95
|
const storeApiClient = (_c = options.storeApiClient) !== null && _c !== void 0 ? _c : createStoreApiClient(hosted);
|
|
114
96
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* on hosting the only writer of that file is this backend. So the lane
|
|
120
|
-
* keeps the mirror live without reintroducing the CAS read pattern:
|
|
121
|
-
* hydrate it once from the store when the file is absent (a fresh pod
|
|
122
|
-
* after a deploy), then append each successfully posted record locally,
|
|
123
|
-
* rotating at {@link maxJournalBytes} like {@link fileMemoryBackend}.
|
|
124
|
-
* Server-buffered records not yet flushed when a pod hydrates are the
|
|
125
|
-
* lane's documented staleness window (~30 s / 64 KiB), and other pods'
|
|
126
|
-
* appends surface on the next hydration — advisory memory, same envelope
|
|
127
|
-
* as the server side.
|
|
97
|
+
* Keep the local journal mirror available to file tools. Hydrate it when
|
|
98
|
+
* absent, then append each record only after managed storage accepts it.
|
|
99
|
+
* Memory is advisory, so another process's newest records may appear on
|
|
100
|
+
* the next hydration.
|
|
128
101
|
*/
|
|
129
102
|
const hydratedMirrors = new Set();
|
|
130
103
|
let mirrorRotationSeq = 0;
|
|
@@ -157,39 +130,30 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
157
130
|
yield appendFile(path, `${JSON.stringify(record)}\n`, "utf8");
|
|
158
131
|
});
|
|
159
132
|
/**
|
|
160
|
-
*
|
|
161
|
-
* journal. On success the record is also appended to the local mirror so
|
|
162
|
-
* the workspace symlink read path stays live (see
|
|
163
|
-
* {@link maintainLocalMirror}).
|
|
133
|
+
* Append one record to managed storage, then update the local mirror.
|
|
164
134
|
*
|
|
165
135
|
* Failure policy: log and give up for this record. Memory is advisory and
|
|
166
136
|
* the hook runner treats an append failure as non-fatal to the turn;
|
|
167
|
-
*
|
|
168
|
-
* storm under exactly the server brownout that makes this call fail. A
|
|
169
|
-
* failed POST also skips the mirror — the mirror must never show a record
|
|
170
|
-
* the durable journal will not have.
|
|
137
|
+
* a failed durable write also skips the mirror.
|
|
171
138
|
*/
|
|
172
139
|
const appendViaStoreApi = (record, ctx) => __awaiter(this, void 0, void 0, function* () {
|
|
173
140
|
try {
|
|
174
141
|
yield storeApiClient.memoryAppend({ agent: ctx.agentName, record });
|
|
175
142
|
}
|
|
176
143
|
catch (error) {
|
|
177
|
-
console.warn(`[
|
|
144
|
+
console.warn(`[bdk] memory.append dropped one record for "${ctx.agentName}": ${error instanceof Error ? error.message : String(error)}`);
|
|
178
145
|
return;
|
|
179
146
|
}
|
|
180
147
|
try {
|
|
181
148
|
yield maintainLocalMirror(record, ctx);
|
|
182
149
|
}
|
|
183
150
|
catch (error) {
|
|
184
|
-
console.warn(`[
|
|
151
|
+
console.warn(`[bdk] memory mirror update failed for "${ctx.agentName}" (journal record is durable): ${error instanceof Error ? error.message : String(error)}`);
|
|
185
152
|
}
|
|
186
153
|
});
|
|
187
154
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* first) and the mirror is rewritten to global state; the session then
|
|
191
|
-
* reads everything appended before it started. Soft-fail: a failed
|
|
192
|
-
* hydration keeps the existing mirror.
|
|
155
|
+
* Refresh the local mirror at session start. Soft-fail so an unavailable
|
|
156
|
+
* store does not erase the existing mirror.
|
|
193
157
|
*/
|
|
194
158
|
const hydrateMirror = (ctx) => __awaiter(this, void 0, void 0, function* () {
|
|
195
159
|
var _a;
|
|
@@ -200,12 +164,8 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
200
164
|
agent: ctx.agentName,
|
|
201
165
|
});
|
|
202
166
|
if (content !== undefined) {
|
|
203
|
-
// Never
|
|
204
|
-
//
|
|
205
|
-
// than the mirror means the server's flush-on-read was degraded (a
|
|
206
|
-
// busy lock, a Redis outage — the acked tail is still buffered) or
|
|
207
|
-
// the journal rotated. Keeping the richer mirror loses nothing;
|
|
208
|
-
// rewriting would hide records the agent has already seen.
|
|
167
|
+
// Never replace the local mirror with a shorter journal. Keeping the
|
|
168
|
+
// richer view avoids hiding records the agent has already seen.
|
|
209
169
|
const mirroredBytes = (_b = (_a = (yield stat(path).catch(() => undefined))) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;
|
|
210
170
|
if (content.byteLength >= mirroredBytes) {
|
|
211
171
|
yield mirrorJournalLocally(ctx.stateRoot, content);
|
|
@@ -216,17 +176,12 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
216
176
|
hydratedMirrors.add(path);
|
|
217
177
|
}
|
|
218
178
|
catch (error) {
|
|
219
|
-
console.warn(`[
|
|
179
|
+
console.warn(`[bdk] memory hydration failed for "${ctx.agentName}" (keeping the existing mirror): ${error instanceof Error ? error.message : String(error)}`);
|
|
220
180
|
}
|
|
221
181
|
});
|
|
222
|
-
/**
|
|
223
|
-
* Hosted pods carry the pin and a provisioned store by construction (v2
|
|
224
|
-
* hosting binds `factory-api-v1` unconditionally and refuses pre-0.2.1
|
|
225
|
-
* artifacts). Reaching this without them means a misconfigured
|
|
226
|
-
* environment; there is no client-side write to fall back to.
|
|
227
|
-
*/
|
|
182
|
+
/** Report a missing managed-storage binding without falling back locally. */
|
|
228
183
|
const refuseMisconfiguredLane = (agentName, verb) => {
|
|
229
|
-
console.error(`[
|
|
184
|
+
console.error(`[bdk] memory ${verb} for "${agentName}" dropped: the store API lane is unavailable (missing/foreign AGENT_SERVE_STORE_PROTOCOL pin or no provisioned store). This BDK version has no client-side journal fallback; fix the hosting pin.`);
|
|
230
185
|
};
|
|
231
186
|
return {
|
|
232
187
|
prepareSession(ctx) {
|
|
@@ -254,9 +209,8 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
254
209
|
var _a;
|
|
255
210
|
// Soft-fail by construction (appendViaStoreApi never throws), but
|
|
256
211
|
// still chained per journal key: the local mirror's hydrate-then-
|
|
257
|
-
// append must not interleave with itself.
|
|
258
|
-
//
|
|
259
|
-
// takes effect without a restart.
|
|
212
|
+
// append must not interleave with itself. Availability is resolved
|
|
213
|
+
// lazily for each append.
|
|
260
214
|
const key = agentStoreKeys.memoryJournal(ctx.agentName);
|
|
261
215
|
const prior = (_a = appendChains.get(key)) !== null && _a !== void 0 ? _a : Promise.resolve();
|
|
262
216
|
const next = prior
|
|
@@ -274,7 +228,7 @@ export function agentStoreMemoryBackend(options = {}) {
|
|
|
274
228
|
},
|
|
275
229
|
};
|
|
276
230
|
}
|
|
277
|
-
/** Atomic full rewrite of the local mirror
|
|
231
|
+
/** Atomic full rewrite of the local mirror. */
|
|
278
232
|
function mirrorJournalLocally(stateRoot, contents) {
|
|
279
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
280
234
|
const dir = join(stateRoot, MEMORY_DIR_NAME);
|
|
@@ -284,7 +238,7 @@ function mirrorJournalLocally(stateRoot, contents) {
|
|
|
284
238
|
yield rename(tmp, join(dir, "journal.jsonl"));
|
|
285
239
|
});
|
|
286
240
|
}
|
|
287
|
-
/**
|
|
241
|
+
/** Cursor-managed deployments use durable memory; local development uses files. */
|
|
288
242
|
function defaultMemoryBackend() {
|
|
289
243
|
return isCursorHostedFilesAvailable() ? agentStoreMemoryBackend() : fileMemoryBackend();
|
|
290
244
|
}
|
|
@@ -367,7 +321,7 @@ export function memoryHook(options = {}) {
|
|
|
367
321
|
});
|
|
368
322
|
}
|
|
369
323
|
catch (error) {
|
|
370
|
-
console.warn(`[
|
|
324
|
+
console.warn(`[bdk] memory hydration at session start failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
371
325
|
}
|
|
372
326
|
});
|
|
373
327
|
},
|