@cursor/july 0.1.96 → 0.1.99
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 +1 -1
- package/README.md +3 -2
- package/dist/bin/agent-serve.js +13 -3
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +16 -0
- package/dist/channels/origin/api.d.ts +15 -4
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +19 -3
- package/dist/channels/origin/binding.d.ts +11 -0
- package/dist/channels/origin/binding.d.ts.map +1 -1
- package/dist/channels/origin/binding.js +41 -25
- package/dist/channels/origin/index.d.ts +1 -0
- package/dist/channels/origin/index.d.ts.map +1 -1
- package/dist/channels/origin/index.js +1 -0
- package/dist/channels/origin/origin-channel.d.ts +2 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +40 -4
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +67 -0
- package/dist/channels/origin/types.d.ts +11 -0
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/approvals.d.ts +16 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -1
- package/dist/channels/slack/approvals.js +86 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +234 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -1
- package/dist/channels/slack/defaults.js +142 -63
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +1 -1
- package/dist/channels/slack/init.d.ts +3 -2
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +5 -5
- package/dist/channels/slack/interactive.d.ts +2 -1
- package/dist/channels/slack/interactive.d.ts.map +1 -1
- package/dist/channels/slack/interactive.js +15 -4
- package/dist/channels/slack/live-delivery.d.ts +1 -1
- package/dist/channels/slack/live-delivery.d.ts.map +1 -1
- package/dist/channels/slack/live-delivery.js +4 -2
- package/dist/channels/slack/manifest.d.ts +1 -1
- package/dist/channels/slack/manifest.js +1 -1
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +115 -0
- package/dist/channels/slack/setup.d.ts +1 -1
- package/dist/channels/slack/setup.d.ts.map +1 -1
- package/dist/channels/slack/setup.js +10 -6
- package/dist/channels/slack/slack-channel.d.ts.map +1 -1
- package/dist/channels/slack/slack-channel.js +1 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -1
- package/dist/channels/slack/tool-approval-events.js +91 -1
- package/dist/channels/slack/types.d.ts +9 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.jXleCmOc.js → app.BplEAZ3S.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.DpuI4i7Z.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.8LhyglIT.js → VPLocalSearchBox.CHXyv4wP.js} +1 -1
- package/dist/docs/assets/chunks/{theme.9ged-pr2.js → theme.BTcsZmjQ.js} +2 -2
- package/dist/docs/assets/{deployment.md.D9msOFOW.js → deployment.md.MFPKqsqI.js} +2 -2
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.js → guides_mcp-oauth.md.CN-6YmTJ.js} +4 -4
- package/dist/docs/assets/{guides_mcp-oauth.md.DPYmBCbV.lean.js → guides_mcp-oauth.md.CN-6YmTJ.lean.js} +1 -1
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.js +22 -0
- package/dist/docs/assets/guides_slack.md.VDXQV3ja.lean.js +1 -0
- package/dist/docs/assets/index.md.CVeRUOeZ.js +5 -0
- package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.js → reference_agent-config.md.BHeYMgme.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.js → reference_cli.md.DfoeyvL0.js} +9 -6
- package/dist/docs/assets/{reference_cli.md.CCnG-nJx.lean.js → reference_cli.md.DfoeyvL0.lean.js} +1 -1
- package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.js → reference_connections.md.DxldvyIB.js} +4 -3
- package/dist/docs/assets/{reference_http-api.md.D89k1mdm.js → reference_http-api.md.BEJx9XVj.js} +2 -2
- package/dist/docs/assets/reference_sessions.md.NxFP_CAC.js +1 -0
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.js → reference_tools.md.CvAHsdSp.js} +10 -2
- package/dist/docs/assets/{reference_tools.md.BHeXn2id.lean.js → reference_tools.md.CvAHsdSp.lean.js} +1 -1
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.js +2 -0
- package/dist/docs/assets/templates_agents-md.md.CXSMZljE.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DCiPBhYs.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +7 -7
- package/dist/docs/deployment.md +5 -4
- package/dist/docs/design/runtime-abstraction.md +1757 -0
- package/dist/docs/evals.html +4 -4
- 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 +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/mcp-oauth.html +8 -8
- package/dist/docs/guides/mcp-oauth.md +26 -8
- package/dist/docs/guides/opentelemetry.html +4 -4
- package/dist/docs/guides/slack.html +17 -33
- package/dist/docs/guides/slack.md +92 -201
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +6 -6
- package/dist/docs/index.md +5 -3
- package/dist/docs/llms-full.txt +2065 -637
- package/dist/docs/llms.txt +3 -2
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +6 -6
- package/dist/docs/reference/agent-config.md +2 -2
- package/dist/docs/reference/artifacts.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +13 -10
- package/dist/docs/reference/cli.md +32 -16
- package/dist/docs/reference/connections.html +9 -8
- package/dist/docs/reference/connections.md +6 -3
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +7 -7
- package/dist/docs/reference/http-api.md +3 -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 +5 -5
- package/dist/docs/reference/sessions.md +4 -2
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +15 -7
- package/dist/docs/reference/tools.md +34 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/templates/agentic-owners.html +4 -4
- package/dist/docs/templates/agents-md.html +28 -0
- package/dist/docs/templates/agents-md.md +105 -0
- package/dist/docs/templates/code-wiki.html +5 -5
- 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 +5 -5
- package/dist/docs/templates/triage.html +4 -4
- package/dist/docs/troubleshooting.html +5 -5
- package/dist/docs/troubleshooting.md +2 -2
- package/dist/evals/run-facts.d.ts.map +1 -1
- package/dist/evals/run-facts.js +27 -0
- package/dist/files-backends/cursor-hosted.d.ts +3 -2
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +3 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +15 -9
- package/dist/internal/approval-gate.d.ts +12 -13
- package/dist/internal/approval-gate.d.ts.map +1 -1
- package/dist/internal/approval-gate.js +16 -21
- package/dist/internal/as-of.d.ts +19 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +82 -0
- package/dist/internal/chat-client.js +10 -0
- package/dist/internal/cli-deploy.d.ts +6 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +149 -21
- package/dist/internal/cli-mcp-oauth.js +8 -18
- package/dist/internal/cli-slack-manual.d.ts +24 -2
- package/dist/internal/cli-slack-manual.d.ts.map +1 -1
- package/dist/internal/cli-slack-manual.js +251 -20
- package/dist/internal/cli-slack.d.ts +9 -2
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +29 -82
- package/dist/internal/cursor/account-mcp.d.ts +1 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +17 -0
- package/dist/internal/cursor-agent-template.d.ts +1 -1
- package/dist/internal/cursor-agent-template.d.ts.map +1 -1
- package/dist/internal/cursor-agent-template.js +1 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +5 -6
- package/dist/internal/deploy-client.d.ts +17 -0
- package/dist/internal/deploy-client.d.ts.map +1 -1
- package/dist/internal/deploy-client.js +31 -10
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +90 -0
- package/dist/internal/framework-file-storage.d.ts +11 -17
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +17 -40
- package/dist/internal/framework-storage-selection.d.ts +13 -11
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +37 -26
- package/dist/internal/hosted-admission-adapter.d.ts +28 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +13 -1
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +8 -1
- package/dist/internal/hosted-delivery.d.ts +21 -1
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +101 -34
- package/dist/internal/hosted-execution-diag.d.ts +59 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +187 -0
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +85 -2
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +2 -0
- package/dist/internal/logs-client.d.ts +5 -0
- package/dist/internal/logs-client.d.ts.map +1 -1
- package/dist/internal/logs-client.js +5 -0
- package/dist/internal/mcp-endpoint.js +2 -3
- package/dist/internal/mcp-host.d.ts +10 -0
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +57 -8
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +92 -0
- package/dist/internal/mcp-oauth.d.ts +1 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -1
- package/dist/internal/mcp-oauth.js +10 -2
- package/dist/internal/null-kv-storage.d.ts +48 -0
- package/dist/internal/null-kv-storage.d.ts.map +1 -0
- package/dist/internal/null-kv-storage.js +58 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +22 -9
- package/dist/internal/server.d.ts +6 -0
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +123 -33
- package/dist/internal/session-engine.d.ts +88 -3
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +538 -46
- package/dist/internal/session-run-log.d.ts +120 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +359 -0
- package/dist/internal/sessions-client.d.ts +9 -7
- package/dist/internal/sessions-client.d.ts.map +1 -1
- package/dist/internal/sessions-client.js +3 -1
- package/dist/internal/storage-coordinator.d.ts +13 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +37 -6
- package/dist/internal/storage-roles.d.ts +5 -0
- package/dist/internal/storage-roles.d.ts.map +1 -1
- package/dist/internal/stream-progress.d.ts.map +1 -1
- package/dist/internal/stream-progress.js +10 -0
- package/dist/internal/tool-policy.d.ts +29 -9
- package/dist/internal/tool-policy.d.ts.map +1 -1
- package/dist/internal/tool-policy.js +24 -0
- package/dist/internal/trajectory.d.ts.map +1 -1
- package/dist/internal/trajectory.js +10 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/playground/assets/index-D7rGZNjy.css +1 -0
- package/dist/playground/assets/index-jzNbJENa.js +69 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage-backends/cursor-hosted.d.ts +1 -1
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +12 -0
- package/dist/storage-protocol.d.ts +8 -0
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +8 -0
- package/dist/storage.d.ts +8 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/tools.d.ts +12 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/types.d.ts +88 -7
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +5 -3
- package/docs/deployment.md +5 -4
- package/docs/design/runtime-abstraction.md +1757 -0
- package/docs/guides/mcp-oauth.md +26 -8
- package/docs/guides/slack.md +93 -202
- package/docs/reference/agent-config.md +2 -2
- package/docs/reference/cli.md +32 -16
- package/docs/reference/connections.md +6 -3
- package/docs/reference/http-api.md +3 -1
- package/docs/reference/sessions.md +4 -2
- package/docs/reference/tools.md +34 -2
- package/docs/templates/agents-md.md +110 -0
- package/docs/troubleshooting.md +2 -2
- package/package.json +1 -1
- package/skills/create-agent/SKILL.md +2 -1
- package/skills/mcp-auth/SKILL.md +6 -3
- package/skills/setup-slack/SKILL.md +23 -13
- package/src/bin/agent-serve.ts +12 -1
- package/src/channels/github/github-channel.ts +17 -0
- package/src/channels/origin/api.ts +24 -5
- package/src/channels/origin/binding.ts +55 -26
- package/src/channels/origin/index.ts +1 -0
- package/src/channels/origin/origin-channel.ts +78 -10
- package/src/channels/origin/reactions.ts +82 -0
- package/src/channels/origin/types.ts +11 -0
- package/src/channels/slack/approvals.ts +105 -0
- package/src/channels/slack/cli-project.ts +267 -0
- package/src/channels/slack/defaults.ts +165 -74
- package/src/channels/slack/dispatch.ts +2 -0
- package/src/channels/slack/init.ts +10 -5
- package/src/channels/slack/interactive.ts +35 -9
- package/src/channels/slack/live-delivery.ts +5 -3
- package/src/channels/slack/manifest.ts +1 -1
- package/src/channels/slack/progress-delivery.ts +133 -0
- package/src/channels/slack/setup.ts +10 -6
- package/src/channels/slack/slack-channel.ts +1 -0
- package/src/channels/slack/tool-approval-events.ts +93 -0
- package/src/channels/slack/types.ts +9 -1
- package/src/evals/run-facts.ts +32 -0
- package/src/files-backends/cursor-hosted.ts +3 -2
- package/src/index.ts +4 -0
- package/src/internal/advertise-tools.ts +31 -10
- package/src/internal/approval-gate.ts +20 -29
- package/src/internal/as-of.ts +107 -0
- package/src/internal/chat-client.ts +19 -0
- package/src/internal/cli-deploy.ts +203 -13
- package/src/internal/cli-mcp-oauth.ts +7 -21
- package/src/internal/cli-slack-manual.ts +350 -18
- package/src/internal/cli-slack.ts +40 -84
- package/src/internal/cursor/account-mcp.ts +21 -0
- package/src/internal/cursor-agent-template.ts +1 -0
- package/src/internal/cursor-event-relay.ts +5 -6
- package/src/internal/deploy-client.ts +43 -0
- package/src/internal/env-file.ts +84 -0
- package/src/internal/framework-file-storage.ts +18 -46
- package/src/internal/framework-storage-selection.ts +41 -25
- package/src/internal/hosted-admission-adapter.ts +42 -0
- package/src/internal/hosted-delivery-protocol.ts +14 -2
- package/src/internal/hosted-delivery.ts +169 -44
- package/src/internal/hosted-execution-diag.ts +252 -0
- package/src/internal/http-channel.ts +107 -0
- package/src/internal/init-project.ts +2 -0
- package/src/internal/logs-client.ts +5 -0
- package/src/internal/mcp-endpoint.ts +13 -4
- package/src/internal/mcp-host.ts +77 -11
- package/src/internal/mcp-oauth-on-demand.ts +352 -0
- package/src/internal/mcp-oauth-persist.ts +127 -0
- package/src/internal/mcp-oauth.ts +17 -1
- package/src/internal/null-kv-storage.ts +74 -0
- package/src/internal/otel/collector.ts +30 -0
- package/src/internal/server.ts +159 -11
- package/src/internal/session-engine.ts +691 -57
- package/src/internal/session-run-log.ts +584 -0
- package/src/internal/sessions-client.ts +17 -8
- package/src/internal/storage-coordinator.ts +49 -9
- package/src/internal/storage-roles.ts +7 -0
- package/src/internal/stream-progress.ts +19 -0
- package/src/internal/tool-policy.ts +49 -9
- package/src/internal/trajectory.ts +10 -0
- package/src/internal/turn-outbox.ts +85 -0
- package/src/storage-backends/cursor-hosted.ts +13 -1
- package/src/storage-protocol.ts +10 -0
- package/src/storage.ts +12 -0
- package/src/tools.ts +12 -2
- package/src/types.ts +93 -8
- package/templates/agents-md/README.md +39 -0
- package/templates/agents-md/agent/agent.ts +8 -0
- package/templates/agents-md/agent/channels/github.ts +10 -0
- package/templates/agents-md/agent/channels/queue.ts +28 -0
- package/templates/agents-md/agent/channels/slack.ts +9 -0
- package/templates/agents-md/agent/instructions.md +39 -0
- package/templates/agents-md/agent/lib/collect.ts +439 -0
- package/templates/agents-md/agent/lib/config.ts +8 -0
- package/templates/agents-md/agent/lib/paths.ts +51 -0
- package/templates/agents-md/agent/schedules/weekly.ts +17 -0
- package/templates/agents-md/agent/tools/apply_agents.ts +226 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.DFoGuETX.js +0 -1
- package/dist/docs/assets/guides_slack.md.C32HsdKk.js +0 -38
- package/dist/docs/assets/guides_slack.md.C32HsdKk.lean.js +0 -1
- package/dist/docs/assets/index.md.CI93Ltlb.js +0 -5
- package/dist/docs/assets/reference_sessions.md.D0mIh4KK.js +0 -1
- package/dist/docs/assets/troubleshooting.md.Ctv3T8C2.js +0 -1
- package/dist/docs/design/agsh.md +0 -406
- package/dist/playground/assets/index-B1DDvBeC.css +0 -1
- package/dist/playground/assets/index-Cx9CclK_.js +0 -88
- package/docs/design/agsh.md +0 -406
- /package/dist/docs/assets/{deployment.md.D9msOFOW.lean.js → deployment.md.MFPKqsqI.lean.js} +0 -0
- /package/dist/docs/assets/{index.md.CI93Ltlb.lean.js → index.md.CVeRUOeZ.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.Cp_x38Nl.lean.js → reference_agent-config.md.BHeYMgme.lean.js} +0 -0
- /package/dist/docs/assets/{reference_connections.md.BH8Oc0D0.lean.js → reference_connections.md.DxldvyIB.lean.js} +0 -0
- /package/dist/docs/assets/{reference_http-api.md.D89k1mdm.lean.js → reference_http-api.md.BEJx9XVj.lean.js} +0 -0
- /package/dist/docs/assets/{reference_sessions.md.D0mIh4KK.lean.js → reference_sessions.md.NxFP_CAC.lean.js} +0 -0
- /package/dist/docs/assets/{troubleshooting.md.Ctv3T8C2.lean.js → troubleshooting.md.DCiPBhYs.lean.js} +0 -0
|
@@ -260,6 +260,13 @@ export interface AgentkitDeployStatus {
|
|
|
260
260
|
status: AgentkitCustomerStatus;
|
|
261
261
|
progress: AgentkitDeployProgress;
|
|
262
262
|
statusMessage: string | null;
|
|
263
|
+
/** Why the bake failed. Null/absent unless `status` is `failed`. */
|
|
264
|
+
lastError?: string | null;
|
|
265
|
+
/**
|
|
266
|
+
* `owner/name` scopes the deployment's GitHub/Origin channels watch.
|
|
267
|
+
* Absent on control planes that predate the field.
|
|
268
|
+
*/
|
|
269
|
+
repositories?: string[];
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
export const TERMINAL_AGENTKIT_DEPLOY_STATUSES: ReadonlySet<AgentkitCustomerStatus> =
|
|
@@ -350,6 +357,8 @@ const agentkitDeployStatusSchema = z
|
|
|
350
357
|
"stopped",
|
|
351
358
|
]),
|
|
352
359
|
statusMessage: z.string().nullable(),
|
|
360
|
+
// Optional: backends that predate the v2 bake-failure column omit it.
|
|
361
|
+
lastError: z.string().nullable().optional(),
|
|
353
362
|
})
|
|
354
363
|
.passthrough();
|
|
355
364
|
|
|
@@ -598,6 +607,8 @@ export class AgentServeDeployClient {
|
|
|
598
607
|
agentPath?: string;
|
|
599
608
|
components?: AgentkitDeployComponent[];
|
|
600
609
|
repositories?: string[];
|
|
610
|
+
/** Redeploy an existing Cursor-managed (multi-tenant) product. */
|
|
611
|
+
multiTenant?: boolean;
|
|
601
612
|
}): Promise<AgentkitDeployAccepted> {
|
|
602
613
|
const slugError = validateDeploymentSlug(args.slug);
|
|
603
614
|
if (slugError !== undefined) {
|
|
@@ -626,6 +637,7 @@ export class AgentServeDeployClient {
|
|
|
626
637
|
args.repositories !== undefined && args.repositories.length > 0
|
|
627
638
|
? args.repositories
|
|
628
639
|
: undefined,
|
|
640
|
+
...(args.multiTenant === true ? { multiTenant: true } : {}),
|
|
629
641
|
},
|
|
630
642
|
context: { verb: "deploy", slug: args.slug },
|
|
631
643
|
});
|
|
@@ -890,6 +902,37 @@ export class AgentServeDeployClient {
|
|
|
890
902
|
}
|
|
891
903
|
}
|
|
892
904
|
|
|
905
|
+
const MCP_GATEWAY_PATH =
|
|
906
|
+
/^\/internal\/agent-serve\/mcp\/(\d+)\/([^/]+)(?:\/tools)?\/?$/;
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Inverse of {@link AgentServeDeployClient.mcpGatewayUrl}. Also accepts
|
|
910
|
+
* the hosted `--cloud-tools-url` form (`…/tools`).
|
|
911
|
+
*/
|
|
912
|
+
export function parseAgentServeMcpGatewayUrl(
|
|
913
|
+
url: string
|
|
914
|
+
): { teamId: number; slug: string } | undefined {
|
|
915
|
+
let parsed: URL;
|
|
916
|
+
try {
|
|
917
|
+
parsed = new URL(url);
|
|
918
|
+
} catch {
|
|
919
|
+
return undefined;
|
|
920
|
+
}
|
|
921
|
+
const match = MCP_GATEWAY_PATH.exec(parsed.pathname);
|
|
922
|
+
if (match === null) {
|
|
923
|
+
return undefined;
|
|
924
|
+
}
|
|
925
|
+
const teamId = Number.parseInt(match[1]!, 10);
|
|
926
|
+
if (!Number.isInteger(teamId) || teamId <= 0) {
|
|
927
|
+
return undefined;
|
|
928
|
+
}
|
|
929
|
+
const slug = decodeURIComponent(match[2]!);
|
|
930
|
+
if (validateDeploymentSlug(slug) !== undefined) {
|
|
931
|
+
return undefined;
|
|
932
|
+
}
|
|
933
|
+
return { teamId, slug };
|
|
934
|
+
}
|
|
935
|
+
|
|
893
936
|
// ============================================================================
|
|
894
937
|
// Error mapping (HTTP → actionable human messages)
|
|
895
938
|
// ============================================================================
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `.env` / `.env.local` writers for CLI commands that mint tokens.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { chmod, readFile, writeFile } from "node:fs/promises";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
function isErrnoException(error: unknown): error is NodeJS.ErrnoException {
|
|
9
|
+
return error instanceof Error && "code" in error;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async function readOptionalFile(path: string): Promise<string> {
|
|
13
|
+
try {
|
|
14
|
+
return await readFile(path, "utf8");
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (isErrnoException(error) && error.code === "ENOENT") {
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Append `KEY=value` lines to an env file, replacing every existing line
|
|
25
|
+
* for the same key instead of appending duplicates. Creates the file when
|
|
26
|
+
* missing.
|
|
27
|
+
*/
|
|
28
|
+
export async function upsertEnvFile(
|
|
29
|
+
path: string,
|
|
30
|
+
entries: Array<{ key: string; value: string }>
|
|
31
|
+
): Promise<void> {
|
|
32
|
+
const existing = await readOptionalFile(path);
|
|
33
|
+
const lines =
|
|
34
|
+
existing === "" ? [] : existing.replace(/\r?\n$/, "").split(/\r?\n/);
|
|
35
|
+
// A stale `export KEY=…` line would shadow or duplicate the bare line
|
|
36
|
+
// under some loaders; treat both spellings as the same entry.
|
|
37
|
+
const matchesKey = (line: string, key: string): boolean =>
|
|
38
|
+
line.startsWith(`${key}=`) || line.startsWith(`export ${key}=`);
|
|
39
|
+
for (const { key, value } of entries) {
|
|
40
|
+
const next = `${key}=${value}`;
|
|
41
|
+
let replaced = false;
|
|
42
|
+
for (let i = 0; i < lines.length; ) {
|
|
43
|
+
if (!matchesKey(lines[i] ?? "", key)) {
|
|
44
|
+
i += 1;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (replaced) {
|
|
48
|
+
lines.splice(i, 1);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
lines[i] = next;
|
|
52
|
+
replaced = true;
|
|
53
|
+
i += 1;
|
|
54
|
+
}
|
|
55
|
+
if (!replaced) {
|
|
56
|
+
lines.push(next);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// writeFile's mode only applies on create; clamp pre-existing files too.
|
|
60
|
+
await writeFile(path, `${lines.join("\n")}\n`, { mode: 0o600 });
|
|
61
|
+
await chmod(path, 0o600);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Ensure the agent directory's .gitignore covers .env.local (create or
|
|
66
|
+
* append). A bare `.env` line does not count — that pattern matches only
|
|
67
|
+
* the file literally named .env.
|
|
68
|
+
*/
|
|
69
|
+
export async function ensureEnvLocalGitignored(dir: string): Promise<boolean> {
|
|
70
|
+
const path = join(dir, ".gitignore");
|
|
71
|
+
const existing = await readOptionalFile(path);
|
|
72
|
+
const covered = existing
|
|
73
|
+
.split(/\r?\n/)
|
|
74
|
+
.some((line) => /^\.env(\.local\*?|\.\*|\*)$/.test(line.trim()));
|
|
75
|
+
if (covered) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
const next =
|
|
79
|
+
existing === "" || existing.endsWith("\n")
|
|
80
|
+
? `${existing}.env.local\n`
|
|
81
|
+
: `${existing}\n.env.local\n`;
|
|
82
|
+
await writeFile(path, next);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
@@ -8,15 +8,16 @@
|
|
|
8
8
|
* is browsable from the dashboard and mountable on cloud-runtime VMs;
|
|
9
9
|
* - the **framework-level** store (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`)
|
|
10
10
|
* holds engine-owned session state — session records, event transcripts,
|
|
11
|
-
* the continuation index, and the SDK
|
|
12
|
-
* exposed to authors or models.
|
|
11
|
+
* hosted-execution run logs, the continuation index, and the SDK
|
|
12
|
+
* conversation mirror — and is never exposed to authors or models.
|
|
13
13
|
*
|
|
14
14
|
* This module puts framework session state on the framework store. The
|
|
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` / `
|
|
19
|
-
* file store (file-shaped; the store accepts values
|
|
18
|
+
* kind — `session` / `session-events` / `session-runs` / `continuation`
|
|
19
|
+
* go to the framework file store (file-shaped; the store accepts values
|
|
20
|
+
* up to 64 MiB per
|
|
20
21
|
* object without chunking, versus the KV proxy's 1 MiB row cap), while
|
|
21
22
|
* author `kv`, eval runs, A/B samples, and conditional writes stay on the
|
|
22
23
|
* control-plane KV proxy (the dashboard reads them there, and CAS needs a
|
|
@@ -40,6 +41,7 @@ import { mapBounded } from "./bounded.js";
|
|
|
40
41
|
const FRAMEWORK_FILE_KINDS: ReadonlySet<string> = new Set([
|
|
41
42
|
"session",
|
|
42
43
|
"session-events",
|
|
44
|
+
"session-runs",
|
|
43
45
|
"continuation",
|
|
44
46
|
]);
|
|
45
47
|
|
|
@@ -165,13 +167,16 @@ function decodeDocument(key: string, bytes: Uint8Array): JsonValue {
|
|
|
165
167
|
* Split one storage core by key kind: framework session state to `files`,
|
|
166
168
|
* everything else to `kv`. Spread over the KV backend when building the
|
|
167
169
|
* full definition so its `evals` / `abs` groups (and the cursor-hosted
|
|
168
|
-
* marker) ride along untouched
|
|
169
|
-
*
|
|
170
|
+
* marker) ride along untouched. A KV `cas` group must not be spread as-is:
|
|
171
|
+
* conditional writes run on a KV database row, so one over a `session/` or
|
|
172
|
+
* `continuation/` key would read and write a different store than the
|
|
173
|
+
* routed plain core — silent split-brain. Nothing in the package CASes
|
|
174
|
+
* those kinds today.
|
|
170
175
|
*/
|
|
171
176
|
export function composeFrameworkStorage(input: {
|
|
172
177
|
kv: FileSinkStorageCore;
|
|
173
178
|
files: FileSinkStorageCore;
|
|
174
|
-
}): FileSinkStorageCore {
|
|
179
|
+
}): FileSinkStorageCore & Pick<StorageConfig, "listNewest"> {
|
|
175
180
|
const route = (key: string): FileSinkStorageCore =>
|
|
176
181
|
isFrameworkFileKey(key) ? input.files : input.kv;
|
|
177
182
|
return {
|
|
@@ -179,44 +184,11 @@ export function composeFrameworkStorage(input: {
|
|
|
179
184
|
get: (key, ctx) => route(key).get(key, ctx),
|
|
180
185
|
delete: (key, ctx) => route(key).delete(key, ctx),
|
|
181
186
|
list: (prefix, ctx) => route(prefix).list(prefix, ctx),
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
* CAS runs on the KV proxy (a database row version); the plain core routes
|
|
189
|
-
* framework session state to the file store. A future coordination path
|
|
190
|
-
* that CASes a `session/` or `continuation/` key would otherwise read and
|
|
191
|
-
* write a different store than the plain path — silent split-brain. Fail
|
|
192
|
-
* loudly instead; nothing in the package CASes those kinds today.
|
|
193
|
-
*/
|
|
194
|
-
export function frameworkGuardedCas(
|
|
195
|
-
cas: NonNullable<StorageConfig["cas"]>
|
|
196
|
-
): NonNullable<StorageConfig["cas"]> {
|
|
197
|
-
const refuse = (key: string): void => {
|
|
198
|
-
if (isFrameworkFileKey(key)) {
|
|
199
|
-
throw new Error(
|
|
200
|
-
`framework file storage: conditional writes are KV-only, but "${key}" routes to the framework file store`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
return {
|
|
205
|
-
getWithVersion: (key, ctx) => {
|
|
206
|
-
refuse(key);
|
|
207
|
-
return cas.getWithVersion(key, ctx);
|
|
208
|
-
},
|
|
209
|
-
putIfAbsent: (key, value, ctx) => {
|
|
210
|
-
refuse(key);
|
|
211
|
-
return cas.putIfAbsent(key, value, ctx);
|
|
212
|
-
},
|
|
213
|
-
putIfVersion: (key, value, expectedVersion, ctx) => {
|
|
214
|
-
refuse(key);
|
|
215
|
-
return cas.putIfVersion(key, value, expectedVersion, ctx);
|
|
216
|
-
},
|
|
217
|
-
listKeys: (prefix, ctx) => {
|
|
218
|
-
refuse(prefix);
|
|
219
|
-
return cas.listKeys(prefix, ctx);
|
|
220
|
-
},
|
|
187
|
+
// Session records — the only `listNewest` consumer — are framework file
|
|
188
|
+
// keys, and the file store has no write-time ordering. Spreading the KV
|
|
189
|
+
// backend's `listNewest` through would query rows that live elsewhere
|
|
190
|
+
// (stale KV leftovers, or nothing), so the composed core explicitly has
|
|
191
|
+
// none and the engine falls back to the routed `list`.
|
|
192
|
+
listNewest: undefined,
|
|
221
193
|
};
|
|
222
194
|
}
|
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
*
|
|
18
18
|
* - **Cursor-managed hosting** (the deployment-generation environment
|
|
19
19
|
* variable is set, same signal that registers `GET /v1/manifest`):
|
|
20
|
-
* the
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
20
|
+
* the deployment's **framework-level file store**
|
|
21
|
+
* (`AGENT_SERVE_FRAMEWORK_STORE_SOURCE_ID`) holds session records, event
|
|
22
|
+
* transcripts, and the continuation index — file-shaped state on file
|
|
23
|
+
* storage, apart from the author-facing user store. The control-plane KV
|
|
24
|
+
* proxy is *not* used: it authorizes by mapping a pod service account to
|
|
25
|
+
* a v1 deployment row, which no v2 deployment has, so every call 403s and
|
|
26
|
+
* fails the delivery that read it. The KV half is inert until the proxy
|
|
27
|
+
* resolves v2 deployments (see null-kv-storage.ts). Without a framework
|
|
28
|
+
* store (a deploy predating framework-store provisioning) there is
|
|
29
|
+
* nothing left to mirror to, so the state root is again the only copy.
|
|
30
|
+
* The API key resolves through the full credential chain on every call
|
|
31
|
+
* because hosted freeze snapshots listen unsigned and the binder drops
|
|
32
|
+
* the key file after restore.
|
|
31
33
|
* - **Self-hosted**: no mirror. `--state-root` is the durable copy, which
|
|
32
34
|
* is correct when the operator owns the disk.
|
|
33
35
|
*
|
|
@@ -45,15 +47,17 @@ import {
|
|
|
45
47
|
cursorHostedFiles,
|
|
46
48
|
} from "../files-backends/cursor-hosted.js";
|
|
47
49
|
import { defineStorage, type StorageDefinition } from "../storage.js";
|
|
48
|
-
import {
|
|
50
|
+
import { CURSOR_HOSTED_STORAGE } from "../storage-backends/cursor-hosted.js";
|
|
49
51
|
import type { AgentArchitecture } from "../types.js";
|
|
50
52
|
import { resolveApiKeySync } from "./cursor/credentials.js";
|
|
51
53
|
import { AGENT_SERVE_GENERATION_ENV_VAR } from "./cursor-relay-core.js";
|
|
52
54
|
import {
|
|
53
55
|
composeFrameworkStorage,
|
|
54
56
|
fileSinkStorageCore,
|
|
55
|
-
frameworkGuardedCas,
|
|
56
57
|
} from "./framework-file-storage.js";
|
|
58
|
+
import { nullKvStorage } from "./null-kv-storage.js";
|
|
59
|
+
|
|
60
|
+
const cursorHostedMarker = { [CURSOR_HOSTED_STORAGE]: true } as const;
|
|
57
61
|
|
|
58
62
|
export interface FrameworkStorageSelectionInput {
|
|
59
63
|
/** `agent/storage.ts`, when the author wrote one (v1 only: discovery rejects it on v2). */
|
|
@@ -96,23 +100,38 @@ export function selectFrameworkStorageDefinition(
|
|
|
96
100
|
// comes up). Follow-ups restore lazily by continuation or session id;
|
|
97
101
|
// GET /v1/sessions lists from the sink either way.
|
|
98
102
|
const policy = { restore: "off" } as const;
|
|
99
|
-
// Full chain (env → key file → stored login): frozen engines listen
|
|
100
|
-
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this
|
|
101
|
-
// definition is constructed.
|
|
102
|
-
const resolveApiKey = (): string | undefined => resolveApiKeySync()?.apiKey;
|
|
103
|
-
const kv = cursorHostedStorage({ resolveApiKey });
|
|
104
103
|
const frameworkStoreId = cursorFrameworkStoreSourceId(
|
|
105
104
|
env as NodeJS.ProcessEnv
|
|
106
105
|
);
|
|
107
106
|
if (frameworkStoreId === undefined) {
|
|
108
|
-
|
|
107
|
+
// Nothing to mirror to: the KV proxy rejects v2 service accounts, so a
|
|
108
|
+
// definition over it would fail every delivery that reads it. The state
|
|
109
|
+
// root is the durable copy, as when self-hosted.
|
|
110
|
+
return undefined;
|
|
109
111
|
}
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
112
|
+
// Full chain (env → key file → stored login): frozen engines listen
|
|
113
|
+
// unsigned and bind CURSOR_API_KEY_FILE at task time, after this
|
|
114
|
+
// definition is constructed.
|
|
115
|
+
const resolveApiKey = (): string | undefined => resolveApiKeySync()?.apiKey;
|
|
116
|
+
// Framework session state on the framework-level file store, which
|
|
117
|
+
// authorizes by store source id and so works for v2. Everything the KV
|
|
118
|
+
// proxy used to serve — author kv, eval runs, A/B samples, conditional
|
|
119
|
+
// writes — is inert; `defineStorage` derives the eval/A/B tables over the
|
|
120
|
+
// core, which means that bookkeeping reads back empty rather than 403ing.
|
|
121
|
+
//
|
|
122
|
+
// Restoring `cursorHostedStorage()` here once the proxy resolves v2
|
|
123
|
+
// deployments also means restoring the guard its `cas` group needs: a
|
|
124
|
+
// conditional write over a `session/` or `continuation/` key would run on
|
|
125
|
+
// the KV database while the plain core routes that key to the file store.
|
|
126
|
+
const kv = nullKvStorage();
|
|
113
127
|
return defineStorage({
|
|
114
128
|
name: "cursor-hosted (framework files)",
|
|
115
129
|
policy,
|
|
130
|
+
// GET /v1/sessions still prefers the durable list: session records live
|
|
131
|
+
// on the framework store, which the composed core lists. Spread rather
|
|
132
|
+
// than named, the way cursorHostedStorage carries it: the marker is a
|
|
133
|
+
// platform stamp, not part of the authored config surface.
|
|
134
|
+
...cursorHostedMarker,
|
|
116
135
|
...kv,
|
|
117
136
|
...composeFrameworkStorage({
|
|
118
137
|
kv,
|
|
@@ -120,8 +139,5 @@ export function selectFrameworkStorageDefinition(
|
|
|
120
139
|
cursorHostedFiles({ storeSourceId: frameworkStoreId, resolveApiKey })
|
|
121
140
|
),
|
|
122
141
|
}),
|
|
123
|
-
// CAS stays on the KV proxy but must refuse framework-file keys, or a
|
|
124
|
-
// future coordination path would split-brain against the plain core.
|
|
125
|
-
cas: frameworkGuardedCas(kv.cas),
|
|
126
142
|
});
|
|
127
143
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ChannelHandlerArgs } from "../types.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hosted-admission hook a channel pack attaches to its definition.
|
|
5
|
+
*
|
|
6
|
+
* Hosted delivery looks this up from the mounted definition — it does not
|
|
7
|
+
* switch on `channelKind`. A new forge implements `dispatch` / `getOutcome`
|
|
8
|
+
* next to its webhook handler and calls {@link attachHostedAdmissionAdapter}
|
|
9
|
+
* from the channel constructor.
|
|
10
|
+
*/
|
|
11
|
+
export type HostedAdmissionDispatchOutcome = "skip" | "task";
|
|
12
|
+
|
|
13
|
+
export type HostedAdmissionAdapter = {
|
|
14
|
+
kind: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional wrap of the capturing `send` / `waitUntil` args (GitHub uses
|
|
17
|
+
* this to propagate background-task errors). Identity when omitted.
|
|
18
|
+
*/
|
|
19
|
+
prepareArgs?(args: ChannelHandlerArgs): ChannelHandlerArgs;
|
|
20
|
+
dispatch(input: {
|
|
21
|
+
eventType: string;
|
|
22
|
+
payload: unknown;
|
|
23
|
+
deliveryId: string;
|
|
24
|
+
args: ChannelHandlerArgs;
|
|
25
|
+
}): Promise<Response>;
|
|
26
|
+
getOutcome(response: Response): HostedAdmissionDispatchOutcome | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const adapters = new WeakMap<object, HostedAdmissionAdapter>();
|
|
30
|
+
|
|
31
|
+
export function attachHostedAdmissionAdapter(
|
|
32
|
+
definition: object,
|
|
33
|
+
adapter: HostedAdmissionAdapter
|
|
34
|
+
): void {
|
|
35
|
+
adapters.set(definition, adapter);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function getHostedAdmissionAdapter(
|
|
39
|
+
definition: object
|
|
40
|
+
): HostedAdmissionAdapter | undefined {
|
|
41
|
+
return adapters.get(definition);
|
|
42
|
+
}
|
|
@@ -2,6 +2,13 @@ export const HOSTED_DELIVERY_PROTOCOL_VERSION = 2;
|
|
|
2
2
|
export const HOSTED_DELIVERY_HEADER = "x-agent-sdk-hosted-delivery";
|
|
3
3
|
export const HOSTED_ADMISSION_PATH = "/v1/internal/hosted-admission";
|
|
4
4
|
export const HOSTED_EXECUTION_PATH = "/v1/internal/hosted-execution";
|
|
5
|
+
/**
|
|
6
|
+
* Filename under the serve `--state-root` (not the per-slug SessionEngine
|
|
7
|
+
* dir). Hosted freeze uses `/workspace/.agent-serve`; the Temporal host
|
|
8
|
+
* reads this path after hosted-execution and logs it on the activity span.
|
|
9
|
+
* Must match `AGENT_SERVE_ENGINE_HOSTED_EXECUTION_DIAG_PATH` basename.
|
|
10
|
+
*/
|
|
11
|
+
export const HOSTED_EXECUTION_DIAG_FILENAME = "hosted-execution.json";
|
|
5
12
|
|
|
6
13
|
export type HostedAdmissionManagedAutomation = {
|
|
7
14
|
automationUuid: string;
|
|
@@ -11,7 +18,12 @@ export type HostedAdmissionManagedAutomation = {
|
|
|
11
18
|
export type HostedAdmission = {
|
|
12
19
|
v: 2;
|
|
13
20
|
channelId: string;
|
|
14
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Mailbox / subscription channel kind (`github`, `origin`, …). The guest
|
|
23
|
+
* resolves dispatch from the mounted definition's hosted-admission
|
|
24
|
+
* adapter; this field is not an allowlist.
|
|
25
|
+
*/
|
|
26
|
+
channelKind: string;
|
|
15
27
|
eventType: string;
|
|
16
28
|
deliveryId: string;
|
|
17
29
|
sessionMode: "event" | "continuation";
|
|
@@ -100,7 +112,7 @@ export function parseHostedAdmission(
|
|
|
100
112
|
!Object.hasOwn(body, "payload") ||
|
|
101
113
|
body.v !== HOSTED_DELIVERY_PROTOCOL_VERSION ||
|
|
102
114
|
!boundedString(body.channelId, 128) ||
|
|
103
|
-
body.channelKind
|
|
115
|
+
!boundedString(body.channelKind, 128) ||
|
|
104
116
|
!boundedString(body.eventType, 128) ||
|
|
105
117
|
!boundedString(body.deliveryId, 256) ||
|
|
106
118
|
(body.sessionMode !== "event" && body.sessionMode !== "continuation") ||
|