@cursor/july 0.1.99 → 0.1.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -2
- package/dist/bin/agent-serve.js +3 -2
- package/dist/channels/deployments/deployments-channel.d.ts +41 -5
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +88 -8
- package/dist/channels/deployments/types.d.ts +4 -3
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +28 -3
- package/dist/channels/github/progress.d.ts +7 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +111 -0
- package/dist/channels/origin/index.d.ts +2 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +2 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -1
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +24 -3
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +23 -0
- package/dist/channels/origin/types.d.ts +23 -1
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +16 -7
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +31 -14
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +168 -0
- package/dist/channels/slack/constants.d.ts +6 -0
- package/dist/channels/slack/constants.d.ts.map +1 -1
- package/dist/channels/slack/constants.js +6 -0
- package/dist/channels/slack/defaults.d.ts +9 -4
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +154 -76
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +3 -3
- package/dist/channels/slack/inbound.d.ts +9 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +14 -0
- package/dist/channels/slack/index.d.ts +2 -0
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +2 -0
- package/dist/channels/slack/live-delivery.d.ts +5 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +116 -21
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +104 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +40 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +150 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +8 -4
- package/dist/channels/slack/stream.d.ts +22 -10
- package/dist/channels/slack/stream.d.ts.map +1 -1
- package/dist/channels/slack/stream.js +9 -16
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +178 -0
- package/dist/channels/slack/types.d.ts +145 -6
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/connections.d.ts +18 -2
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +18 -2
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +6 -6
- package/dist/docs/ab.md +1 -1
- package/dist/docs/assets/{ab.md.DJo5r4R-.js → ab.md.mlVgqvSk.js} +1 -1
- package/dist/docs/assets/{app.BplEAZ3S.js → app.BASO9Kih.js} +1 -1
- package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.js → building-with-agents.md.CUSWxlP_.js} +2 -2
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.CHXyv4wP.js → VPLocalSearchBox.DwkqxoE0.js} +1 -1
- package/dist/docs/assets/chunks/{theme.BTcsZmjQ.js → theme.CCil_13e.js} +2 -2
- package/dist/docs/assets/{evals.md.lfJoEVc8.js → evals.md.CPzDAwoH.js} +1 -1
- package/dist/docs/assets/{guides_github.md.Cnh2mL4a.js → guides_github.md.BtPr9GaP.js} +1 -1
- package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.js → guides_mcp-oauth.md.Dp6cDP7f.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.js → guides_opentelemetry.md.BVTXDCRg.js} +2 -2
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.js → guides_slack.md.9oHPye9o.js} +19 -3
- package/dist/docs/assets/{guides_slack.md.VDXQV3ja.lean.js → guides_slack.md.9oHPye9o.lean.js} +1 -1
- package/dist/docs/assets/hillclimbing.md.CpTGTCle.js +4 -0
- package/dist/docs/assets/{index.md.CVeRUOeZ.js → index.md.Bb4k8kUm.js} +1 -1
- package/dist/docs/assets/{quickstart.md.Nj_LjW_a.js → quickstart.md.DdQOF7Y8.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.js → reference_connections.md.Di6jJAXF.js} +13 -3
- package/dist/docs/assets/{reference_connections.md.DxldvyIB.lean.js → reference_connections.md.Di6jJAXF.lean.js} +1 -1
- package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.js → reference_http-api.md.oySXBO8o.js} +1 -1
- package/dist/docs/assets/scaffolding-agents.md.em43xlY1.js +1 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.js +26 -0
- package/dist/docs/assets/skills_ab.md.CsFNatVx.lean.js +1 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.js +8 -0
- package/dist/docs/assets/skills_create-agent.md.BVoWPcan.lean.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.js +1 -0
- package/dist/docs/assets/skills_debug.md.CDbPhHfg.lean.js +1 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.js +25 -0
- package/dist/docs/assets/skills_evals.md.723kpUmA.lean.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +1 -0
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.lean.js +1 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.js +16 -0
- package/dist/docs/assets/skills_github.md.D0JahM8c.lean.js +1 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.js +7 -0
- package/dist/docs/assets/skills_hillclimb.md.B_zJerxA.lean.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.js +1 -0
- package/dist/docs/assets/skills_index.md.DKwIxzGg.lean.js +1 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.js +18 -0
- package/dist/docs/assets/skills_mcp-auth.md.DGvFP3HE.lean.js +1 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.js +8 -0
- package/dist/docs/assets/skills_otel.md.CgiZryR3.lean.js +1 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.js +20 -0
- package/dist/docs/assets/skills_setup-slack.md.BBgx8lUz.lean.js +1 -0
- package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.js → troubleshooting.md.Cus_YZga.js} +1 -1
- package/dist/docs/building-with-agents.html +6 -6
- package/dist/docs/building-with-agents.md +14 -11
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +1 -1
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +4 -4
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +5 -5
- package/dist/docs/guides/github.md +1 -1
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +5 -5
- package/dist/docs/guides/mcp-oauth.md +1 -1
- package/dist/docs/guides/opentelemetry.html +7 -7
- package/dist/docs/guides/opentelemetry.md +2 -2
- package/dist/docs/guides/slack.html +22 -6
- package/dist/docs/guides/slack.md +80 -1
- package/dist/docs/guides/webhooks.html +5 -5
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +6 -6
- package/dist/docs/hillclimbing.md +5 -5
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +1 -1
- package/dist/docs/llms-full.txt +1073 -31
- package/dist/docs/llms.txt +14 -0
- package/dist/docs/quickstart.html +5 -5
- package/dist/docs/quickstart.md +1 -1
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +4 -4
- package/dist/docs/reference/connections.html +17 -7
- package/dist/docs/reference/connections.md +32 -1
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +6 -6
- package/dist/docs/reference/http-api.md +1 -1
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +5 -5
- package/dist/docs/scaffolding-agents.md +3 -3
- package/dist/docs/skills/ab.html +52 -0
- package/dist/docs/skills/ab.md +50 -0
- package/dist/docs/skills/create-agent.html +34 -0
- package/dist/docs/skills/create-agent.md +160 -0
- package/dist/docs/skills/debug.html +27 -0
- package/dist/docs/skills/debug.md +36 -0
- package/dist/docs/skills/evals.html +51 -0
- package/dist/docs/skills/evals.md +99 -0
- package/dist/docs/skills/framework-map.html +27 -0
- package/dist/docs/skills/framework-map.md +95 -0
- package/dist/docs/skills/github.html +42 -0
- package/dist/docs/skills/github.md +93 -0
- package/dist/docs/skills/hillclimb.html +33 -0
- package/dist/docs/skills/hillclimb.md +55 -0
- package/dist/docs/skills/index.html +27 -0
- package/dist/docs/skills/index.md +21 -0
- package/dist/docs/skills/mcp-auth.html +44 -0
- package/dist/docs/skills/mcp-auth.md +76 -0
- package/dist/docs/skills/otel.html +34 -0
- package/dist/docs/skills/otel.md +48 -0
- package/dist/docs/skills/setup-slack.html +46 -0
- package/dist/docs/skills/setup-slack.md +141 -0
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +4 -4
- package/dist/docs/templates/code-wiki.html +4 -4
- package/dist/docs/templates/demo.html +4 -4
- package/dist/docs/templates/pr-autofixer.html +4 -4
- package/dist/docs/templates/security-help.html +4 -4
- package/dist/docs/templates/security-reviewer.html +4 -4
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +55 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +64 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +30 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +45 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +85 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +55 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.js +37 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +83 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +36 -0
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/status.js +41 -0
- package/dist/extensions.d.ts +49 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +75 -0
- package/dist/files-backends/cursor-hosted.d.ts +6 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +6 -9
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/internal/advertise-tools.d.ts +4 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +20 -1
- package/dist/internal/as-of.d.ts +18 -0
- package/dist/internal/as-of.d.ts.map +1 -1
- package/dist/internal/as-of.js +131 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +66 -21
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +3 -1
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +3 -4
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +16 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +61 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +15 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +48 -0
- package/dist/internal/cursor-deployment-relay.d.ts +15 -1
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +46 -7
- package/dist/internal/deploy-client.d.ts +29 -6
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +61 -19
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +426 -121
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +5 -0
- package/dist/internal/framework-file-storage.d.ts +15 -8
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +70 -10
- package/dist/internal/framework-storage-selection.d.ts +12 -12
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +33 -39
- package/dist/internal/hosted-delivery.d.ts +3 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +19 -32
- package/dist/internal/hosted-execution-diag.d.ts +5 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -1
- package/dist/internal/hosted-execution-diag.js +5 -0
- package/dist/internal/hosted-execution-flush.d.ts +46 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +81 -0
- package/dist/internal/mcp-endpoint.js +1 -0
- package/dist/internal/mcp-host.d.ts +2 -1
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +35 -15
- package/dist/internal/review-comments.d.ts +1 -1
- package/dist/internal/review-comments.d.ts.map +1 -1
- package/dist/internal/review-comments.js +4 -4
- package/dist/internal/server.d.ts +3 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +79 -104
- package/dist/internal/session-engine.d.ts +9 -7
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +45 -34
- package/dist/internal/session-run-log.d.ts +5 -4
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +8 -8
- package/dist/internal/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +151 -0
- package/dist/internal/storage-coordinator.d.ts +0 -6
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +1 -9
- package/dist/internal/tool-policy.d.ts +8 -0
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +19 -7
- package/dist/playground/assets/{index-jzNbJENa.js → index-BnNN1-EK.js} +45 -45
- package/dist/playground/assets/index-DBQCwFp0.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted-v2.d.ts +83 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +164 -0
- package/dist/storage-backends/cursor-hosted.d.ts +6 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +6 -1
- package/dist/storage-protocol.d.ts +24 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +33 -0
- package/dist/storage.d.ts +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/types.d.ts +123 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -1
- package/docs/README.md +1 -1
- package/docs/ab.md +1 -1
- package/docs/building-with-agents.md +14 -11
- package/docs/evals.md +1 -1
- package/docs/guides/github.md +1 -1
- package/docs/guides/mcp-oauth.md +1 -1
- package/docs/guides/opentelemetry.md +2 -2
- package/docs/guides/slack.md +80 -1
- package/docs/hillclimbing.md +5 -5
- package/docs/quickstart.md +1 -1
- package/docs/reference/connections.md +32 -1
- package/docs/reference/http-api.md +1 -1
- package/docs/scaffolding-agents.md +3 -3
- package/docs/skills/index.md +26 -0
- package/docs/troubleshooting.md +1 -1
- package/package.json +18 -4
- package/src/bin/agent-serve.ts +11 -2
- package/src/channels/deployments/deployments-channel.ts +117 -8
- package/src/channels/deployments/types.ts +4 -3
- package/src/channels/github/defaults.ts +36 -3
- package/src/channels/github/progress.ts +7 -0
- package/src/channels/origin/defaults.ts +143 -0
- package/src/channels/origin/index.ts +2 -0
- package/src/channels/origin/origin-channel.ts +37 -1
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +24 -0
- package/src/channels/slack/api.ts +37 -18
- package/src/channels/slack/code-fences.ts +183 -0
- package/src/channels/slack/constants.ts +6 -0
- package/src/channels/slack/defaults.ts +173 -92
- package/src/channels/slack/dispatch.ts +8 -1
- package/src/channels/slack/inbound.ts +17 -0
- package/src/channels/slack/index.ts +2 -0
- package/src/channels/slack/live-delivery.ts +142 -28
- package/src/channels/slack/reasoning-card.ts +140 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +229 -0
- package/src/channels/slack/slack-channel.ts +7 -2
- package/src/channels/slack/stream.ts +31 -24
- package/src/channels/slack/tool-cards.ts +221 -0
- package/src/channels/slack/types.ts +159 -6
- package/src/connections.ts +18 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +118 -0
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +79 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +109 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +81 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +27 -0
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +29 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +84 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/status.ts +39 -0
- package/src/extensions.ts +98 -0
- package/src/files-backends/cursor-hosted.ts +15 -5
- package/src/index.ts +2 -0
- package/src/internal/advertise-tools.ts +37 -12
- package/src/internal/as-of.ts +163 -0
- package/src/internal/cli-deploy.ts +88 -25
- package/src/internal/continuation-identity.ts +3 -1
- package/src/internal/conversation-mirror.ts +3 -8
- package/src/internal/cursor/hosted-deployment-secrets.ts +72 -0
- package/src/internal/cursor/hosted-store-secrets.ts +72 -0
- package/src/internal/cursor-deployment-relay.ts +65 -8
- package/src/internal/deploy-client.ts +83 -28
- package/src/internal/discovery.ts +479 -114
- package/src/internal/distribution.ts +5 -0
- package/src/internal/framework-file-storage.ts +80 -10
- package/src/internal/framework-storage-selection.ts +31 -44
- package/src/internal/hosted-delivery.ts +38 -63
- package/src/internal/hosted-execution-diag.ts +6 -0
- package/src/internal/hosted-execution-flush.ts +142 -0
- package/src/internal/mcp-endpoint.ts +1 -0
- package/src/internal/mcp-host.ts +40 -14
- package/src/internal/review-comments.ts +5 -2
- package/src/internal/server.ts +81 -100
- package/src/internal/session-engine.ts +56 -28
- package/src/internal/session-run-log.ts +8 -12
- package/src/internal/start-log-store.ts +177 -0
- package/src/internal/storage-coordinator.ts +1 -11
- package/src/internal/tool-policy.ts +39 -9
- package/src/storage-backends/cursor-hosted-v2.ts +219 -0
- package/src/storage-backends/cursor-hosted.ts +6 -1
- package/src/storage-protocol.ts +37 -0
- package/src/storage.ts +1 -0
- package/src/types.ts +177 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +0 -1
- package/dist/docs/assets/hillclimbing.md.DhESf3OO.js +0 -4
- package/dist/docs/assets/scaffolding-agents.md.D7UUkWw0.js +0 -1
- package/dist/internal/null-kv-storage.d.ts +0 -48
- package/dist/internal/null-kv-storage.d.ts.map +0 -1
- package/dist/internal/null-kv-storage.js +0 -58
- package/dist/playground/assets/index-D7rGZNjy.css +0 -1
- package/src/internal/null-kv-storage.ts +0 -74
- /package/dist/docs/assets/{ab.md.DJo5r4R-.lean.js → ab.md.mlVgqvSk.lean.js} +0 -0
- /package/dist/docs/assets/{building-with-agents.md.DI4mEzlt.lean.js → building-with-agents.md.CUSWxlP_.lean.js} +0 -0
- /package/dist/docs/assets/{evals.md.lfJoEVc8.lean.js → evals.md.CPzDAwoH.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.Cnh2mL4a.lean.js → guides_github.md.BtPr9GaP.lean.js} +0 -0
- /package/dist/docs/assets/{guides_mcp-oauth.md.CN-6YmTJ.lean.js → guides_mcp-oauth.md.Dp6cDP7f.lean.js} +0 -0
- /package/dist/docs/assets/{guides_opentelemetry.md.bmPmkvJu.lean.js → guides_opentelemetry.md.BVTXDCRg.lean.js} +0 -0
- /package/dist/docs/assets/{hillclimbing.md.DhESf3OO.lean.js → hillclimbing.md.CpTGTCle.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CVeRUOeZ.lean.js → index.md.Bb4k8kUm.lean.js} +0 -0
- /package/dist/docs/assets/{quickstart.md.Nj_LjW_a.lean.js → quickstart.md.DdQOF7Y8.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.BEJx9XVj.lean.js → reference_http-api.md.oySXBO8o.lean.js} +0 -0
- /package/dist/docs/assets/{scaffolding-agents.md.D7UUkWw0.lean.js → scaffolding-agents.md.em43xlY1.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.DCiPBhYs.lean.js → troubleshooting.md.Cus_YZga.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA+B,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,cAAc,IAAI,cAAc,CAM/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAMrE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAC/C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../src/internal/distribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,sEAAsE;AACtE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,UAAU,EAAE,MAA2B,CAAC;AACrD,eAAO,MAAM,gBAAgB,EAAE,MAAiC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAA+B,CAAC;AAc/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,cAAc,IAAI,cAAc,CAM/C;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAMrE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAC/C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAgCzC,CAAC"}
|
|
@@ -103,6 +103,11 @@ export const AUTHORING_ENTRY_FILES = [
|
|
|
103
103
|
["channels/origin", "channels/origin/index.js"],
|
|
104
104
|
["channels/deployments", "channels/deployments/index.js"],
|
|
105
105
|
["skills", "skills.js"],
|
|
106
|
+
["extensions", "extensions.js"],
|
|
107
|
+
[
|
|
108
|
+
"extensions/cursor-cloud-agents",
|
|
109
|
+
"extensions/cursor-cloud-agents/extension.js",
|
|
110
|
+
],
|
|
106
111
|
["schedules", "schedules.js"],
|
|
107
112
|
["reminders", "reminders.js"],
|
|
108
113
|
["connections", "connections.js"],
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* {@link storageKeys} scheme was designed for exactly this: keys are a
|
|
16
16
|
* stable versioned contract that sinks may route on, so
|
|
17
17
|
* {@link composeFrameworkStorage} splits one {@link StorageConfig} by key
|
|
18
|
-
* kind — `session` / `session-events` / `session-runs` / `
|
|
19
|
-
* go to the framework file store (file-shaped; the store
|
|
20
|
-
* up to 64 MiB per
|
|
18
|
+
* kind — `session` / `session-events` / `session-runs` / `logs` /
|
|
19
|
+
* `continuation` go to the framework file store (file-shaped; the store
|
|
20
|
+
* accepts values up to 64 MiB per
|
|
21
21
|
* object without chunking, versus the KV proxy's 1 MiB row cap), while
|
|
22
22
|
* author `kv`, eval runs, A/B samples, and conditional writes stay on the
|
|
23
23
|
* control-plane KV proxy (the dashboard reads them there, and CAS needs a
|
|
@@ -42,14 +42,21 @@ export declare function fileSinkStorageCore(sink: FileSink): FileSinkStorageCore
|
|
|
42
42
|
* Split one storage core by key kind: framework session state to `files`,
|
|
43
43
|
* everything else to `kv`. Spread over the KV backend when building the
|
|
44
44
|
* full definition so its `evals` / `abs` groups (and the cursor-hosted
|
|
45
|
-
* marker) ride along untouched
|
|
46
|
-
*
|
|
47
|
-
* `continuation/` key would read and write a different store than the
|
|
48
|
-
* routed plain core — silent split-brain. Nothing in the package CASes
|
|
49
|
-
* those kinds today.
|
|
45
|
+
* marker) ride along untouched; wrap the KV `cas` group with
|
|
46
|
+
* {@link frameworkGuardedCas} rather than spreading it as-is.
|
|
50
47
|
*/
|
|
51
48
|
export declare function composeFrameworkStorage(input: {
|
|
52
49
|
kv: FileSinkStorageCore;
|
|
53
50
|
files: FileSinkStorageCore;
|
|
54
51
|
}): FileSinkStorageCore & Pick<StorageConfig, "listNewest">;
|
|
52
|
+
/**
|
|
53
|
+
* The KV backend's conditional writes, refusing framework-file keys.
|
|
54
|
+
*
|
|
55
|
+
* CAS runs on the KV proxy (a database row version); the plain core routes
|
|
56
|
+
* framework session state to the file store. A future coordination path
|
|
57
|
+
* that CASes a `session/` or `continuation/` key would otherwise read and
|
|
58
|
+
* write a different store than the plain path — silent split-brain. Fail
|
|
59
|
+
* loudly instead; nothing in the package CASes those kinds today.
|
|
60
|
+
*/
|
|
61
|
+
export declare function frameworkGuardedCas(cas: NonNullable<StorageConfig["cas"]>): NonNullable<StorageConfig["cas"]>;
|
|
55
62
|
//# sourceMappingURL=framework-file-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-file-storage.d.ts","sourceRoot":"","sources":["../../src/internal/framework-file-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"framework-file-storage.d.ts","sourceRoot":"","sources":["../../src/internal/framework-file-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,eAAe,CAAC;AAiBjE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAavD;AAED,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CACxC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC,CACvD,CAAC;AA0BF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,mBAAmB,CAuDvE;AA+CD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,EAAE,EAAE,mBAAmB,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;CAC5B,GAAG,mBAAmB,GAAG,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAe1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GACrC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CA0BnC"}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* {@link storageKeys} scheme was designed for exactly this: keys are a
|
|
16
16
|
* stable versioned contract that sinks may route on, so
|
|
17
17
|
* {@link composeFrameworkStorage} splits one {@link StorageConfig} by key
|
|
18
|
-
* kind — `session` / `session-events` / `session-runs` / `
|
|
19
|
-
* go to the framework file store (file-shaped; the store
|
|
20
|
-
* up to 64 MiB per
|
|
18
|
+
* kind — `session` / `session-events` / `session-runs` / `logs` /
|
|
19
|
+
* `continuation` go to the framework file store (file-shaped; the store
|
|
20
|
+
* accepts values up to 64 MiB per
|
|
21
21
|
* object without chunking, versus the KV proxy's 1 MiB row cap), while
|
|
22
22
|
* author `kv`, eval runs, A/B samples, and conditional writes stay on the
|
|
23
23
|
* control-plane KV proxy (the dashboard reads them there, and CAS needs a
|
|
@@ -46,6 +46,7 @@ const FRAMEWORK_FILE_KINDS = new Set([
|
|
|
46
46
|
"session",
|
|
47
47
|
"session-events",
|
|
48
48
|
"session-runs",
|
|
49
|
+
"logs",
|
|
49
50
|
"continuation",
|
|
50
51
|
]);
|
|
51
52
|
/**
|
|
@@ -99,7 +100,7 @@ export function fileSinkStorageCore(sink) {
|
|
|
99
100
|
// believe an impossible write landed.
|
|
100
101
|
throw new Error(`framework file storage: key "${key}" has a path segment the store cannot represent`);
|
|
101
102
|
}
|
|
102
|
-
yield sink.put(key,
|
|
103
|
+
yield sink.put(key, encodeDocument(key, value));
|
|
103
104
|
});
|
|
104
105
|
},
|
|
105
106
|
get(key) {
|
|
@@ -146,9 +147,37 @@ export function fileSinkStorageCore(sink) {
|
|
|
146
147
|
},
|
|
147
148
|
};
|
|
148
149
|
}
|
|
150
|
+
function frameworkFileKind(key) {
|
|
151
|
+
if (!key.startsWith(`${STORAGE_KEY_ROOT}/`)) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const rest = key.slice(STORAGE_KEY_ROOT.length + 1);
|
|
155
|
+
const agentEnd = rest.indexOf("/");
|
|
156
|
+
if (agentEnd === -1) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
const afterAgent = rest.slice(agentEnd + 1);
|
|
160
|
+
const kindEnd = afterAgent.indexOf("/");
|
|
161
|
+
return kindEnd === -1 ? afterAgent : afterAgent.slice(0, kindEnd);
|
|
162
|
+
}
|
|
163
|
+
function isLogKey(key) {
|
|
164
|
+
return frameworkFileKind(key) === "logs";
|
|
165
|
+
}
|
|
166
|
+
function encodeDocument(key, value) {
|
|
167
|
+
// start.log is raw UTF-8, not a JSON document. Stringify would quote
|
|
168
|
+
// every line and store a JSON string literal instead of the tee.
|
|
169
|
+
if (isLogKey(key)) {
|
|
170
|
+
return new TextEncoder().encode(typeof value === "string" ? value : JSON.stringify(value));
|
|
171
|
+
}
|
|
172
|
+
return new TextEncoder().encode(JSON.stringify(value));
|
|
173
|
+
}
|
|
149
174
|
function decodeDocument(key, bytes) {
|
|
175
|
+
const text = new TextDecoder().decode(bytes);
|
|
176
|
+
if (isLogKey(key)) {
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
150
179
|
try {
|
|
151
|
-
return JSON.parse(
|
|
180
|
+
return JSON.parse(text);
|
|
152
181
|
}
|
|
153
182
|
catch (error) {
|
|
154
183
|
throw new Error(`framework file storage: stored document at "${key}" is not JSON (${error instanceof Error ? error.message : String(error)})`);
|
|
@@ -158,11 +187,8 @@ function decodeDocument(key, bytes) {
|
|
|
158
187
|
* Split one storage core by key kind: framework session state to `files`,
|
|
159
188
|
* everything else to `kv`. Spread over the KV backend when building the
|
|
160
189
|
* full definition so its `evals` / `abs` groups (and the cursor-hosted
|
|
161
|
-
* marker) ride along untouched
|
|
162
|
-
*
|
|
163
|
-
* `continuation/` key would read and write a different store than the
|
|
164
|
-
* routed plain core — silent split-brain. Nothing in the package CASes
|
|
165
|
-
* those kinds today.
|
|
190
|
+
* marker) ride along untouched; wrap the KV `cas` group with
|
|
191
|
+
* {@link frameworkGuardedCas} rather than spreading it as-is.
|
|
166
192
|
*/
|
|
167
193
|
export function composeFrameworkStorage(input) {
|
|
168
194
|
const route = (key) => isFrameworkFileKey(key) ? input.files : input.kv;
|
|
@@ -179,3 +205,37 @@ export function composeFrameworkStorage(input) {
|
|
|
179
205
|
listNewest: undefined,
|
|
180
206
|
};
|
|
181
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* The KV backend's conditional writes, refusing framework-file keys.
|
|
210
|
+
*
|
|
211
|
+
* CAS runs on the KV proxy (a database row version); the plain core routes
|
|
212
|
+
* framework session state to the file store. A future coordination path
|
|
213
|
+
* that CASes a `session/` or `continuation/` key would otherwise read and
|
|
214
|
+
* write a different store than the plain path — silent split-brain. Fail
|
|
215
|
+
* loudly instead; nothing in the package CASes those kinds today.
|
|
216
|
+
*/
|
|
217
|
+
export function frameworkGuardedCas(cas) {
|
|
218
|
+
const refuse = (key) => {
|
|
219
|
+
if (isFrameworkFileKey(key)) {
|
|
220
|
+
throw new Error(`framework file storage: conditional writes are KV-only, but "${key}" routes to the framework file store`);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
getWithVersion: (key, ctx) => {
|
|
225
|
+
refuse(key);
|
|
226
|
+
return cas.getWithVersion(key, ctx);
|
|
227
|
+
},
|
|
228
|
+
putIfAbsent: (key, value, ctx) => {
|
|
229
|
+
refuse(key);
|
|
230
|
+
return cas.putIfAbsent(key, value, ctx);
|
|
231
|
+
},
|
|
232
|
+
putIfVersion: (key, value, expectedVersion, ctx) => {
|
|
233
|
+
refuse(key);
|
|
234
|
+
return cas.putIfVersion(key, value, expectedVersion, ctx);
|
|
235
|
+
},
|
|
236
|
+
listKeys: (prefix, ctx) => {
|
|
237
|
+
refuse(prefix);
|
|
238
|
+
return cas.listKeys(prefix, ctx);
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
* - **Cursor-managed hosting** (the deployment-generation environment
|
|
19
19
|
* variable is set, same signal that registers `GET /v1/manifest`):
|
|
20
20
|
* the deployment's **framework-level file store**
|
|
21
|
-
* (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID
|
|
22
|
-
* transcripts, and the continuation index —
|
|
23
|
-
* storage, apart from the author-facing user
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
21
|
+
* (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`, bound at task time) holds
|
|
22
|
+
* session records, event transcripts, and the continuation index —
|
|
23
|
+
* file-shaped state on file storage, apart from the author-facing user
|
|
24
|
+
* store. Author `host.kv`, eval runs, A/B samples, and conditional writes
|
|
25
|
+
* ride the AgentSDK v2 KV proxy (cursor-hosted-v2.ts), which resolves the
|
|
26
|
+
* pod service account to the factorydb deployment row (the v1 Bugbot
|
|
27
|
+
* proxy cannot resolve v2 pods at all). Framework session state never
|
|
28
|
+
* routes to the KV proxy — the composite splits by key kind — so
|
|
29
|
+
* transcripts stay off the author-reachable KV namespace. The API key
|
|
30
|
+
* resolves through the full credential chain on every call because hosted
|
|
31
|
+
* freeze snapshots listen unsigned and the binder drops the key file
|
|
32
|
+
* after restore.
|
|
33
33
|
* - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
|
|
34
34
|
* is correct when the operator owns the disk.
|
|
35
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAMH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"framework-storage-selection.d.ts","sourceRoot":"","sources":["../../src/internal/framework-storage-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAMH,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,MAAM,WAAW,8BAA8B;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,8BAA8B,GACpC,iBAAiB,GAAG,SAAS,CAqD/B"}
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
* - **Cursor-managed hosting** (the deployment-generation environment
|
|
19
19
|
* variable is set, same signal that registers `GET /v1/manifest`):
|
|
20
20
|
* the deployment's **framework-level file store**
|
|
21
|
-
* (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID
|
|
22
|
-
* transcripts, and the continuation index —
|
|
23
|
-
* storage, apart from the author-facing user
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
21
|
+
* (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`, bound at task time) holds
|
|
22
|
+
* session records, event transcripts, and the continuation index —
|
|
23
|
+
* file-shaped state on file storage, apart from the author-facing user
|
|
24
|
+
* store. Author `host.kv`, eval runs, A/B samples, and conditional writes
|
|
25
|
+
* ride the AgentSDK v2 KV proxy (cursor-hosted-v2.ts), which resolves the
|
|
26
|
+
* pod service account to the factorydb deployment row (the v1 Bugbot
|
|
27
|
+
* proxy cannot resolve v2 pods at all). Framework session state never
|
|
28
|
+
* routes to the KV proxy — the composite splits by key kind — so
|
|
29
|
+
* transcripts stay off the author-reachable KV namespace. The API key
|
|
30
|
+
* resolves through the full credential chain on every call because hosted
|
|
31
|
+
* freeze snapshots listen unsigned and the binder drops the key file
|
|
32
|
+
* after restore.
|
|
33
33
|
* - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
|
|
34
34
|
* is correct when the operator owns the disk.
|
|
35
35
|
*
|
|
@@ -43,12 +43,10 @@
|
|
|
43
43
|
*/
|
|
44
44
|
import { cursorFrameworkStoreSourceId, cursorHostedFiles, } from "../files-backends/cursor-hosted.js";
|
|
45
45
|
import { defineStorage } from "../storage.js";
|
|
46
|
-
import {
|
|
46
|
+
import { cursorHostedStorageV2 } from "../storage-backends/cursor-hosted-v2.js";
|
|
47
47
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
48
48
|
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
49
|
-
import { composeFrameworkStorage, fileSinkStorageCore, } from "./framework-file-storage.js";
|
|
50
|
-
import { nullKvStorage } from "./null-kv-storage.js";
|
|
51
|
-
const cursorHostedMarker = { [CURSOR_HOSTED_STORAGE]: true };
|
|
49
|
+
import { composeFrameworkStorage, fileSinkStorageCore, frameworkGuardedCas, } from "./framework-file-storage.js";
|
|
52
50
|
/**
|
|
53
51
|
* Pick the backend for framework session state.
|
|
54
52
|
*
|
|
@@ -78,30 +76,26 @@ export function selectFrameworkStorageDefinition(input) {
|
|
|
78
76
|
// comes up). Follow-ups restore lazily by continuation or session id;
|
|
79
77
|
// GET /v1/sessions lists from the sink either way.
|
|
80
78
|
const policy = { restore: "off" };
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// definition over it would fail every delivery that reads it. The state
|
|
85
|
-
// root is the durable copy, as when self-hosted.
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
// Full chain (env → key file → stored login): frozen engines listen
|
|
89
|
-
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this
|
|
79
|
+
const envSnapshot = env;
|
|
80
|
+
// Full chain (env → bind file → stored login): frozen engines listen
|
|
81
|
+
// unsigned and bind store ids + CURSOR_API_KEY at task time, after this
|
|
90
82
|
// definition is constructed.
|
|
91
83
|
const resolveApiKey = () => { var _a; return (_a = resolveApiKeySync()) === null || _a === void 0 ? void 0 : _a.apiKey; };
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// conditional write over a `session/` or `continuation/` key would run on
|
|
101
|
-
// the KV database while the plain core routes that key to the file store.
|
|
102
|
-
const kv = nullKvStorage();
|
|
103
|
-
return defineStorage(Object.assign(Object.assign(Object.assign({ name: "cursor-hosted (framework files)", policy }, cursorHostedMarker), kv), composeFrameworkStorage({
|
|
84
|
+
// v2 pods carry a factorydb-bound service account, which the v1 Bugbot
|
|
85
|
+
// storage proxy cannot resolve; author KV, CAS coordination, and the
|
|
86
|
+
// eval/A-B tables speak the AgentSDK v2 KV proxy instead. It also carries
|
|
87
|
+
// the cursor-hosted marker, so GET /v1/sessions prefers the durable list
|
|
88
|
+
// (session records are on the framework store, which the composed core
|
|
89
|
+
// lists).
|
|
90
|
+
const kv = cursorHostedStorageV2({ resolveApiKey });
|
|
91
|
+
return defineStorage(Object.assign(Object.assign(Object.assign({ name: "cursor-hosted (framework files)", policy }, kv), composeFrameworkStorage({
|
|
104
92
|
kv,
|
|
105
|
-
files: fileSinkStorageCore(cursorHostedFiles({
|
|
106
|
-
|
|
93
|
+
files: fileSinkStorageCore(cursorHostedFiles({
|
|
94
|
+
resolveStoreSourceId: () => cursorFrameworkStoreSourceId(envSnapshot),
|
|
95
|
+
resolveApiKey,
|
|
96
|
+
})),
|
|
97
|
+
})), {
|
|
98
|
+
// CAS stays on the KV proxy but must refuse framework-file keys, or a
|
|
99
|
+
// future coordination path would split-brain against the plain core.
|
|
100
|
+
cas: frameworkGuardedCas(kv.cas) }));
|
|
107
101
|
}
|
|
@@ -2,7 +2,7 @@ import type { ChannelHandlerArgs, SendMessageOptions } from "../types.js";
|
|
|
2
2
|
import { type HostedAdmission } from "./hosted-delivery-protocol.js";
|
|
3
3
|
import type { LogRingEntry } from "./log-ring.js";
|
|
4
4
|
import type { Router } from "./router.js";
|
|
5
|
-
import {
|
|
5
|
+
import type { SessionRunExecutionWrite } from "./session-run-log.js";
|
|
6
6
|
type DispatchInput = {
|
|
7
7
|
delivery: HostedAdmission;
|
|
8
8
|
definition: object;
|
|
@@ -57,6 +57,8 @@ export declare function registerHostedDeliveryRoute(input: {
|
|
|
57
57
|
* store; this path still awaits so a parked pod cannot shed the write.
|
|
58
58
|
*/
|
|
59
59
|
persistSessionRun?(write: SessionRunExecutionWrite): Promise<void>;
|
|
60
|
+
/** Snapshot the local `start.log` tee onto `logs/{ses_…}`. */
|
|
61
|
+
flushStartLog?(startLogId: string): Promise<void>;
|
|
60
62
|
/** Snapshot of the process log ring at persist time. */
|
|
61
63
|
snapshotLogs?(): LogRingEntry[];
|
|
62
64
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-delivery.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-delivery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hosted-delivery.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-delivery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAcrB,OAAO,EAKL,KAAK,eAAe,EAGrB,MAAM,+BAA+B,CAAC;AAYvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AA6DF;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,iBAAiB,CAAC,CAa5B;AA2GD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,gBAAgB,CACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACvB,kBAAkB,CAAC;IACtB;;;;;OAKG;IACH,sBAAsB,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,iBAAiB,CAAC,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,8DAA8D;IAC9D,aAAa,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,wDAAwD;IACxD,YAAY,CAAC,IAAI,YAAY,EAAE,CAAC;CACjC,GAAG,IAAI,CA+OP"}
|
|
@@ -8,14 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { randomBytes } from "node:crypto";
|
|
11
|
+
import { refreshBoundDeploymentSecrets } from "./cursor/hosted-deployment-secrets.js";
|
|
11
12
|
import { createDeferredChannelSession, DeferredChannelSessionError, } from "./deferred-channel-session.js";
|
|
12
13
|
import { getHostedAdmissionAdapter, } from "./hosted-admission-adapter.js";
|
|
13
14
|
import { HostedAdmissionLocalSendError, runDuringHostedAdmission, } from "./hosted-admission-context.js";
|
|
14
15
|
import { HOSTED_ADMISSION_PATH, HOSTED_DELIVERY_HEADER, HOSTED_DELIVERY_PROTOCOL_VERSION, HOSTED_EXECUTION_PATH, parseHostedAdmission, parseHostedExecution, } from "./hosted-delivery-protocol.js";
|
|
15
|
-
import { abortReasonFromTurnStatus, HOSTED_EXECUTION_DIAG_RUNNING_STATUS,
|
|
16
|
+
import { abortReasonFromTurnStatus, HOSTED_EXECUTION_DIAG_RUNNING_STATUS, hostedExecutionDiagId, } from "./hosted-execution-diag.js";
|
|
17
|
+
import { flushHostedExecutionRecord, } from "./hosted-execution-flush.js";
|
|
16
18
|
import { recordHostedManagedAutomation } from "./hosted-managed-automation.js";
|
|
17
19
|
import { errorResponse, readJsonObject } from "./http-channel.js";
|
|
18
|
-
import { serializeSessionRunError, snapshotSessionRunLogs, } from "./session-run-log.js";
|
|
19
20
|
/**
|
|
20
21
|
* A second `send()` in one delivery is a deterministic authored bug — the
|
|
21
22
|
* wire protocol carries exactly one pending send per delivery — so it must
|
|
@@ -198,6 +199,7 @@ export function registerHostedDeliveryRoute(input) {
|
|
|
198
199
|
pattern: `${input.base}${HOSTED_ADMISSION_PATH}`,
|
|
199
200
|
auth: [auth],
|
|
200
201
|
handler: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
refreshBoundDeploymentSecrets();
|
|
201
203
|
const startedAt = performance.now();
|
|
202
204
|
const finish = (response) => withServerTiming(response, performance.now() - startedAt);
|
|
203
205
|
const delivery = parseHostedAdmission(yield readJsonObject(request));
|
|
@@ -237,6 +239,7 @@ export function registerHostedDeliveryRoute(input) {
|
|
|
237
239
|
auth: [auth],
|
|
238
240
|
handler: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
239
241
|
var _a;
|
|
242
|
+
refreshBoundDeploymentSecrets();
|
|
240
243
|
const startedAt = performance.now();
|
|
241
244
|
const finish = (response) => withServerTiming(response, performance.now() - startedAt);
|
|
242
245
|
const execution = parseHostedExecution(yield readJsonObject(request));
|
|
@@ -257,37 +260,21 @@ export function registerHostedDeliveryRoute(input) {
|
|
|
257
260
|
var _a;
|
|
258
261
|
const startedAt = performance.now();
|
|
259
262
|
const executionId = hostedExecutionDiagId(execution.admissionToken);
|
|
263
|
+
const sinks = Object.assign(Object.assign(Object.assign(Object.assign({}, (input.stateRoot === undefined
|
|
264
|
+
? {}
|
|
265
|
+
: { stateRoot: input.stateRoot })), (input.persistSessionRun === undefined
|
|
266
|
+
? {}
|
|
267
|
+
: { persistSessionRun: input.persistSessionRun })), (input.flushStartLog === undefined
|
|
268
|
+
? {}
|
|
269
|
+
: { flushStartLog: input.flushStartLog })), (input.snapshotLogs === undefined
|
|
270
|
+
? {}
|
|
271
|
+
: { snapshotLogs: input.snapshotLogs }));
|
|
260
272
|
const writeDiag = (fields) => __awaiter(this, void 0, void 0, function* () {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
?
|
|
266
|
-
: boundedMessage(fields.message);
|
|
267
|
-
const stack = fields.error === undefined
|
|
268
|
-
? undefined
|
|
269
|
-
: hostedErrorStackSnippet(fields.error);
|
|
270
|
-
if (input.stateRoot !== undefined) {
|
|
271
|
-
yield writeHostedExecutionDiag(input.stateRoot, Object.assign(Object.assign(Object.assign(Object.assign({ v: 1, executionId, writtenAt: new Date().toISOString(), sessionPublicId: execution.sessionPublicId, sessionId: fields.sessionId, turnStatus: fields.turnStatus, durationMs }, (message === undefined ? {} : { message })), (stack === undefined || stack.length === 0 ? {} : { stack })), (message !== undefined && /abort/i.test(message)
|
|
272
|
-
? { signalAborted: true }
|
|
273
|
-
: {})), (fields.abortReason === undefined
|
|
274
|
-
? {}
|
|
275
|
-
: { abortReason: fields.abortReason })));
|
|
276
|
-
}
|
|
277
|
-
if (input.persistSessionRun === undefined) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
const error = fields.error === undefined
|
|
281
|
-
? undefined
|
|
282
|
-
: serializeSessionRunError(fields.error);
|
|
283
|
-
try {
|
|
284
|
-
yield input.persistSessionRun(Object.assign(Object.assign(Object.assign(Object.assign({ executionId, writtenAt: new Date().toISOString(), sessionPublicId: execution.sessionPublicId, sessionId: fields.sessionId, turnStatus: fields.turnStatus, durationMs }, (fields.abortReason === undefined
|
|
285
|
-
? {}
|
|
286
|
-
: { abortReason: fields.abortReason })), (message === undefined ? {} : { message })), (error === undefined ? {} : { error })), { logs: snapshotSessionRunLogs((_b = (_a = input.snapshotLogs) === null || _a === void 0 ? void 0 : _a.call(input)) !== null && _b !== void 0 ? _b : []) }));
|
|
287
|
-
}
|
|
288
|
-
catch (_c) {
|
|
289
|
-
// Soft-fail: a store outage must not change the HTTP reply.
|
|
290
|
-
}
|
|
273
|
+
yield flushHostedExecutionRecord(sinks, Object.assign(Object.assign(Object.assign({ executionId, sessionPublicId: execution.sessionPublicId, sessionId: fields.sessionId, turnStatus: fields.turnStatus, durationMs: Math.max(0, Math.round(performance.now() - startedAt)) }, (fields.message === undefined
|
|
274
|
+
? {}
|
|
275
|
+
: { message: fields.message })), (fields.abortReason === undefined
|
|
276
|
+
? {}
|
|
277
|
+
: { abortReason: fields.abortReason })), (fields.error === undefined ? {} : { error: fields.error })));
|
|
291
278
|
});
|
|
292
279
|
// Claim the file before the turn runs. The host reads it after its
|
|
293
280
|
// own POST returns, which for a 9-minute timeout is while this turn
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guest-local TAS diag (`hosted-execution.json`). Flushed with the durable
|
|
3
|
+
* session-run document and the `start.log` tee by
|
|
4
|
+
* `hosted-execution-flush.ts`.
|
|
5
|
+
*/
|
|
1
6
|
export declare const HOSTED_EXECUTION_DIAG_VERSION = 1;
|
|
2
7
|
/** Cap so a runaway message cannot fill the guest disk or the host log. */
|
|
3
8
|
export declare const HOSTED_EXECUTION_DIAG_MAX_BYTES = 4096;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-execution-diag.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-execution-diag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hosted-execution-diag.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-execution-diag.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,2EAA2E;AAC3E,eAAO,MAAM,+BAA+B,OAAO,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,MAAM,MAAM,8BAA8B,GACtC,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,EAAE,OAAO,6BAA6B,CAAC;IACxC,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,8BAA8B,CAAC;CAC9C,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,oCAAoC,YAAY,CAAC;AAmC9D,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAyB9D;AAED,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,8BAA8B,GAAG,SAAS,CAU5C;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,SAAS,CA2EjC;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guest-local TAS diag (`hosted-execution.json`). Flushed with the durable
|
|
3
|
+
* session-run document and the `start.log` tee by
|
|
4
|
+
* `hosted-execution-flush.ts`.
|
|
5
|
+
*/
|
|
1
6
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
7
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
8
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One hosted-execution flush. Two artifacts, same moments:
|
|
3
|
+
*
|
|
4
|
+
* - Guest-local `hosted-execution.json` — TAS failed-execute diag.
|
|
5
|
+
* - Durable `session-runs/{ses_…}` plus the `start.log` tee — dashboard.
|
|
6
|
+
*
|
|
7
|
+
* Claim (`running`) → terminal → process-death. Process-death upgrades the
|
|
8
|
+
* durable document and re-snapshots the tee; the local json stays `running`
|
|
9
|
+
* so TAS does not treat a previous delivery's terminal record as this one.
|
|
10
|
+
*/
|
|
11
|
+
import { type HostedExecutionDiagAbortReason } from "./hosted-execution-diag.js";
|
|
12
|
+
import type { LogRingEntry } from "./log-ring.js";
|
|
13
|
+
import { type SessionRunAbortReason, type SessionRunExecutionWrite } from "./session-run-log.js";
|
|
14
|
+
export type HostedExecutionFlushSinks = {
|
|
15
|
+
/** Serve `--state-root`. Omit to skip the guest-local TAS diag. */
|
|
16
|
+
stateRoot?: string;
|
|
17
|
+
persistSessionRun?(write: SessionRunExecutionWrite): Promise<void>;
|
|
18
|
+
flushStartLog?(startLogId: string): Promise<void>;
|
|
19
|
+
snapshotLogs?(): LogRingEntry[];
|
|
20
|
+
};
|
|
21
|
+
export type HostedExecutionFlushFields = {
|
|
22
|
+
executionId: string;
|
|
23
|
+
sessionPublicId: string;
|
|
24
|
+
sessionId: string;
|
|
25
|
+
turnStatus: string;
|
|
26
|
+
durationMs: number;
|
|
27
|
+
message?: string;
|
|
28
|
+
abortReason?: HostedExecutionDiagAbortReason;
|
|
29
|
+
error?: unknown;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Write the local TAS diag and the durable session-run + tee together.
|
|
33
|
+
* Soft-fail per sink so a store outage does not change hosted HTTP.
|
|
34
|
+
*/
|
|
35
|
+
export declare function flushHostedExecutionRecord(sinks: HostedExecutionFlushSinks, fields: HostedExecutionFlushFields): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Durable-only crash flush. Leaves `hosted-execution.json` at `running`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function flushHostedExecutionProcessDeath(args: {
|
|
40
|
+
flushProcessDeath: (reason: Extract<SessionRunAbortReason, "process_exit" | "uncaught_exception" | "unhandled_rejection">, error?: unknown) => Promise<void>;
|
|
41
|
+
flushStartLog?: (startLogId: string) => Promise<void>;
|
|
42
|
+
startLogId?: string;
|
|
43
|
+
reason: Extract<SessionRunAbortReason, "process_exit" | "uncaught_exception" | "unhandled_rejection">;
|
|
44
|
+
error?: unknown;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
//# sourceMappingURL=hosted-execution-flush.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted-execution-flush.d.ts","sourceRoot":"","sources":["../../src/internal/hosted-execution-flush.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAG9B,MAAM,sBAAsB,CAAC;AAU9B,MAAM,MAAM,yBAAyB,GAAG;IACtC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,aAAa,CAAC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,YAAY,CAAC,IAAI,YAAY,EAAE,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,8BAA8B,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,yBAAyB,EAChC,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,IAAI,CAAC,CA0Df;AAED;;GAEG;AACH,wBAAsB,gCAAgC,CAAC,IAAI,EAAE;IAC3D,iBAAiB,EAAE,CACjB,MAAM,EAAE,OAAO,CACb,qBAAqB,EACrB,cAAc,GAAG,oBAAoB,GAAG,qBAAqB,CAC9D,EACD,KAAK,CAAC,EAAE,OAAO,KACZ,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CACb,qBAAqB,EACrB,cAAc,GAAG,oBAAoB,GAAG,qBAAqB,CAC9D,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One hosted-execution flush. Two artifacts, same moments:
|
|
3
|
+
*
|
|
4
|
+
* - Guest-local `hosted-execution.json` — TAS failed-execute diag.
|
|
5
|
+
* - Durable `session-runs/{ses_…}` plus the `start.log` tee — dashboard.
|
|
6
|
+
*
|
|
7
|
+
* Claim (`running`) → terminal → process-death. Process-death upgrades the
|
|
8
|
+
* durable document and re-snapshots the tee; the local json stays `running`
|
|
9
|
+
* so TAS does not treat a previous delivery's terminal record as this one.
|
|
10
|
+
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
import { hostedErrorStackSnippet, writeHostedExecutionDiag, } from "./hosted-execution-diag.js";
|
|
21
|
+
import { serializeSessionRunError, snapshotSessionRunLogs, } from "./session-run-log.js";
|
|
22
|
+
const MAX_ERROR_MESSAGE_LENGTH = 1024;
|
|
23
|
+
function boundedMessage(text) {
|
|
24
|
+
return text.length > MAX_ERROR_MESSAGE_LENGTH
|
|
25
|
+
? `${text.slice(0, MAX_ERROR_MESSAGE_LENGTH)}…`
|
|
26
|
+
: text;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Write the local TAS diag and the durable session-run + tee together.
|
|
30
|
+
* Soft-fail per sink so a store outage does not change hosted HTTP.
|
|
31
|
+
*/
|
|
32
|
+
export function flushHostedExecutionRecord(sinks, fields) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a;
|
|
35
|
+
var _b;
|
|
36
|
+
const writtenAt = new Date().toISOString();
|
|
37
|
+
const message = fields.message === undefined ? undefined : boundedMessage(fields.message);
|
|
38
|
+
const stack = fields.error === undefined
|
|
39
|
+
? undefined
|
|
40
|
+
: hostedErrorStackSnippet(fields.error);
|
|
41
|
+
if (sinks.stateRoot !== undefined) {
|
|
42
|
+
yield writeHostedExecutionDiag(sinks.stateRoot, Object.assign(Object.assign(Object.assign(Object.assign({ v: 1, executionId: fields.executionId, writtenAt, sessionPublicId: fields.sessionPublicId, sessionId: fields.sessionId, turnStatus: fields.turnStatus, durationMs: fields.durationMs }, (message === undefined ? {} : { message })), (stack === undefined || stack.length === 0 ? {} : { stack })), (message !== undefined && /abort/i.test(message)
|
|
43
|
+
? { signalAborted: true }
|
|
44
|
+
: {})), (fields.abortReason === undefined
|
|
45
|
+
? {}
|
|
46
|
+
: { abortReason: fields.abortReason })));
|
|
47
|
+
}
|
|
48
|
+
if (sinks.persistSessionRun !== undefined) {
|
|
49
|
+
const error = fields.error === undefined
|
|
50
|
+
? undefined
|
|
51
|
+
: serializeSessionRunError(fields.error);
|
|
52
|
+
try {
|
|
53
|
+
yield sinks.persistSessionRun(Object.assign(Object.assign(Object.assign(Object.assign({ executionId: fields.executionId, writtenAt, sessionPublicId: fields.sessionPublicId, sessionId: fields.sessionId, turnStatus: fields.turnStatus, durationMs: fields.durationMs }, (fields.abortReason === undefined
|
|
54
|
+
? {}
|
|
55
|
+
: { abortReason: fields.abortReason })), (message === undefined ? {} : { message })), (error === undefined ? {} : { error })), { logs: snapshotSessionRunLogs((_b = (_a = sinks.snapshotLogs) === null || _a === void 0 ? void 0 : _a.call(sinks)) !== null && _b !== void 0 ? _b : []) }));
|
|
56
|
+
}
|
|
57
|
+
catch (_c) {
|
|
58
|
+
// Soft-fail: a store outage must not change the HTTP reply.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (sinks.flushStartLog !== undefined) {
|
|
62
|
+
try {
|
|
63
|
+
yield sinks.flushStartLog(fields.sessionPublicId);
|
|
64
|
+
}
|
|
65
|
+
catch (_d) {
|
|
66
|
+
// Soft-fail: same posture as the session-run persist.
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Durable-only crash flush. Leaves `hosted-execution.json` at `running`.
|
|
73
|
+
*/
|
|
74
|
+
export function flushHostedExecutionProcessDeath(args) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
yield args.flushProcessDeath(args.reason, args.error);
|
|
77
|
+
if (args.startLogId !== undefined && args.flushStartLog !== undefined) {
|
|
78
|
+
yield args.flushStartLog(args.startLogId);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -222,6 +222,7 @@ function buildConnectionBridgeMcpServer(engine, sessionId, connectionName) {
|
|
|
222
222
|
sessionId: sessionId !== null && sessionId !== void 0 ? sessionId : "",
|
|
223
223
|
connectionName,
|
|
224
224
|
toolName: request.params.name,
|
|
225
|
+
input: request.params.arguments,
|
|
225
226
|
});
|
|
226
227
|
if (answer.answered) {
|
|
227
228
|
return sdkResultToMcpResult(answer.result);
|