@cursor/july 0.1.101 → 0.1.103
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 +34 -32
- package/README.md +28 -3
- package/dist/ab.d.ts +1 -1
- package/dist/ab.js +1 -1
- package/dist/bin/agent-serve.d.ts +12 -12
- package/dist/bin/agent-serve.js +114 -36
- package/dist/channels/bitbucket/api.d.ts +176 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +419 -0
- package/dist/channels/bitbucket/binding.d.ts +71 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +269 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +394 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +73 -0
- package/dist/channels/bitbucket/events.d.ts +22 -0
- package/dist/channels/bitbucket/events.d.ts.map +1 -0
- package/dist/channels/bitbucket/events.js +64 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +304 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +229 -0
- package/dist/channels/bitbucket/types.d.ts.map +1 -0
- package/dist/channels/bitbucket/types.js +1 -0
- package/dist/channels/deployments/deployments-channel.d.ts +22 -14
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -1
- package/dist/channels/deployments/deployments-channel.js +25 -27
- package/dist/channels/deployments/types.d.ts +12 -6
- package/dist/channels/deployments/types.d.ts.map +1 -1
- package/dist/channels/github/binding.d.ts +6 -0
- package/dist/channels/github/binding.d.ts.map +1 -1
- package/dist/channels/github/binding.js +3 -3
- package/dist/channels/github/cursor-account.d.ts +7 -3
- package/dist/channels/github/cursor-account.d.ts.map +1 -1
- package/dist/channels/github/cursor-account.js +10 -6
- package/dist/channels/github/events.d.ts +1 -1
- package/dist/channels/github/events.js +1 -1
- package/dist/channels/github/forward.d.ts +1 -1
- package/dist/channels/github/forward.d.ts.map +1 -1
- package/dist/channels/github/forward.js +3 -2
- package/dist/channels/github/github-channel.d.ts +29 -39
- package/dist/channels/github/github-channel.d.ts.map +1 -1
- package/dist/channels/github/github-channel.js +68 -101
- package/dist/channels/github/replay.d.ts +1 -1
- package/dist/channels/github/replay.js +1 -1
- package/dist/channels/github/state.d.ts +2 -0
- package/dist/channels/github/state.d.ts.map +1 -1
- package/dist/channels/github/state.js +14 -11
- package/dist/channels/github/types.d.ts +2 -4
- package/dist/channels/github/types.d.ts.map +1 -1
- package/dist/channels/gitlab/api.d.ts +91 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +150 -0
- package/dist/channels/gitlab/binding.d.ts +58 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +139 -0
- package/dist/channels/gitlab/checks.d.ts +110 -0
- package/dist/channels/gitlab/checks.d.ts.map +1 -0
- package/dist/channels/gitlab/checks.js +126 -0
- package/dist/channels/gitlab/cursor-account.d.ts +36 -0
- package/dist/channels/gitlab/cursor-account.d.ts.map +1 -0
- package/dist/channels/gitlab/cursor-account.js +65 -0
- package/dist/channels/gitlab/defaults.d.ts +25 -0
- package/dist/channels/gitlab/defaults.d.ts.map +1 -0
- package/dist/channels/gitlab/defaults.js +60 -0
- package/dist/channels/gitlab/events.d.ts +12 -0
- package/dist/channels/gitlab/events.d.ts.map +1 -0
- package/dist/channels/gitlab/events.js +28 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +397 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +206 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +214 -0
- package/dist/channels/gitlab/types.d.ts.map +1 -0
- package/dist/channels/gitlab/types.js +1 -0
- package/dist/channels/origin/api.d.ts.map +1 -1
- package/dist/channels/origin/api.js +4 -2
- package/dist/channels/origin/origin-channel.d.ts +4 -9
- package/dist/channels/origin/origin-channel.d.ts.map +1 -1
- package/dist/channels/origin/origin-channel.js +8 -48
- package/dist/channels/origin/types.d.ts +20 -2
- package/dist/channels/origin/types.d.ts.map +1 -1
- package/dist/channels/slack/api.d.ts +1 -1
- package/dist/channels/slack/api.d.ts.map +1 -1
- package/dist/channels/slack/api.js +3 -1
- package/dist/channels/slack/assistant.d.ts +1 -1
- package/dist/channels/slack/assistant.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.d.ts +3 -2
- package/dist/channels/slack/dispatch.d.ts.map +1 -1
- package/dist/channels/slack/dispatch.js +28 -8
- package/dist/channels/slack/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +1 -7
- package/dist/channels/slack/inbound.d.ts +8 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -1
- package/dist/channels/slack/inbound.js +28 -0
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +3 -3
- package/dist/channels/slack/manifest.d.ts.map +1 -1
- package/dist/channels/slack/manifest.js +2 -1
- 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 +6 -13
- package/dist/channels/slack/types.d.ts +1 -1
- package/dist/channels/slack/types.d.ts.map +1 -1
- package/dist/channels.d.ts +1 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/connections.d.ts +1 -1
- package/dist/connections.js +1 -1
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.BASO9Kih.js → app.DW9pXkpL.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DwkqxoE0.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
- package/dist/docs/assets/chunks/{theme.CCil_13e.js → theme.YZMHgPgg.js} +2 -2
- package/dist/docs/assets/{concepts.md.lwAgBIMI.js → concepts.md.DgEcZOfT.js} +1 -1
- package/dist/docs/assets/{concepts.md.lwAgBIMI.lean.js → concepts.md.DgEcZOfT.lean.js} +1 -1
- package/dist/docs/assets/{evals.md.CPzDAwoH.js → evals.md.CbMoebP1.js} +1 -1
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.DS8RIjwx.lean.js +1 -0
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.js → guides_github.md.DKYiT9do.js} +1 -1
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.js → guides_opentelemetry.md.COh9jFVg.js} +7 -8
- package/dist/docs/assets/{guides_opentelemetry.md.BVTXDCRg.lean.js → guides_opentelemetry.md.COh9jFVg.lean.js} +1 -1
- package/dist/docs/assets/index.md.D75GWhPl.js +5 -0
- package/dist/docs/assets/{index.md.Bb4k8kUm.lean.js → index.md.D75GWhPl.lean.js} +1 -1
- package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.js → reference_agent-config.md.CHNpiyp4.js} +3 -3
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.js → reference_channels.md.Dz8Cnudp.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.Dz8Cnudp.lean.js} +1 -1
- package/dist/docs/assets/{reference_cli.md.DfoeyvL0.js → reference_cli.md.CJNc_xYK.js} +1 -1
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DykHW3qL.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Ddt5DdgJ.js +73 -0
- package/dist/docs/assets/{reference_hooks.md.a8BJxMR5.lean.js → reference_hooks.md.Ddt5DdgJ.lean.js} +1 -1
- package/dist/docs/assets/{reference_playground.md.DnX5nL-B.js → reference_playground.md.4myJPxrf.js} +1 -1
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.js → reference_project-layout.md.DuBu9a96.js} +2 -2
- package/dist/docs/assets/{reference_project-layout.md.Bv4KOtlB.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +1 -1
- package/dist/docs/assets/reference_result.md.BK5SxDrf.js +19 -0
- package/dist/docs/assets/reference_result.md.BK5SxDrf.lean.js +1 -0
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.js → reference_sessions.md.CueyOHSL.js} +1 -1
- package/dist/docs/assets/{reference_sessions.md.NxFP_CAC.lean.js → reference_sessions.md.CueyOHSL.lean.js} +1 -1
- package/dist/docs/assets/{reference_skills.md.BFW9retM.js → reference_skills.md.l2ezAcaN.js} +1 -1
- package/dist/docs/assets/{reference_tools.md.CvAHsdSp.js → reference_tools.md.aGrn99hP.js} +2 -2
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
- package/dist/docs/assets/{skills_framework-map.md.BTi817yv.lean.js → skills_framework-map.md.haibFyoB.lean.js} +1 -1
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.js → skills_otel.md.CqhobH3B.js} +3 -3
- package/dist/docs/assets/{skills_otel.md.CgiZryR3.lean.js → skills_otel.md.CqhobH3B.lean.js} +1 -1
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.js → templates_pr-autofixer.md.Bds_XWcV.js} +2 -2
- package/dist/docs/assets/{templates_pr-autofixer.md.x5zl6-GT.lean.js → templates_pr-autofixer.md.Bds_XWcV.lean.js} +1 -1
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +5 -5
- package/dist/docs/concepts.md +5 -7
- package/dist/docs/deployment.html +4 -4
- package/dist/docs/design/runtime-abstraction.md +2 -3
- package/dist/docs/evals.html +6 -6
- package/dist/docs/evals.md +9 -7
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-agents.html +35 -0
- package/dist/docs/guides/cloud-agents.md +91 -0
- package/dist/docs/guides/convert-automation.html +4 -4
- package/dist/docs/guides/github.html +6 -6
- package/dist/docs/guides/github.md +0 -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/opentelemetry.html +11 -12
- package/dist/docs/guides/opentelemetry.md +41 -17
- package/dist/docs/guides/slack.html +4 -4
- 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 +7 -3
- package/dist/docs/llms-full.txt +765 -209
- package/dist/docs/llms.txt +3 -1
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +8 -8
- package/dist/docs/reference/agent-config.md +6 -10
- package/dist/docs/reference/artifacts.html +5 -5
- package/dist/docs/reference/channels.html +6 -6
- package/dist/docs/reference/channels.md +18 -8
- package/dist/docs/reference/cli.html +5 -5
- package/dist/docs/reference/cli.md +3 -4
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/extensions.html +88 -0
- package/dist/docs/reference/extensions.md +264 -0
- package/dist/docs/reference/hooks.html +69 -10
- package/dist/docs/reference/hooks.md +215 -46
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +5 -5
- package/dist/docs/reference/playground.md +3 -0
- package/dist/docs/reference/project-layout.html +6 -6
- package/dist/docs/reference/project-layout.md +4 -0
- package/dist/docs/reference/prompt.html +4 -4
- package/dist/docs/reference/result.html +45 -0
- package/dist/docs/reference/result.md +89 -0
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +5 -5
- package/dist/docs/reference/sessions.md +3 -1
- package/dist/docs/reference/skills.html +6 -6
- package/dist/docs/reference/skills.md +2 -0
- package/dist/docs/reference/subagents.html +5 -5
- package/dist/docs/reference/tools.html +6 -6
- package/dist/docs/reference/tools.md +3 -2
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/skills/ab.html +4 -4
- package/dist/docs/skills/create-agent.html +4 -4
- package/dist/docs/skills/debug.html +4 -4
- package/dist/docs/skills/evals.html +4 -4
- package/dist/docs/skills/framework-map.html +5 -5
- package/dist/docs/skills/framework-map.md +3 -0
- package/dist/docs/skills/github.html +4 -4
- package/dist/docs/skills/hillclimb.html +4 -4
- package/dist/docs/skills/index.html +4 -4
- package/dist/docs/skills/mcp-auth.html +4 -4
- package/dist/docs/skills/otel.html +7 -7
- package/dist/docs/skills/otel.md +8 -3
- package/dist/docs/skills/setup-slack.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 +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 +6 -6
- package/dist/docs/templates/pr-autofixer.md +0 -3
- 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 +4 -4
- package/dist/evals.d.ts +1 -1
- package/dist/evals.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +9 -7
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/extension.js +9 -7
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +286 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +14 -38
- package/dist/extensions/cursor-cloud-agents/tools/list.js +1 -1
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/{follow_up.js → reply.js} +12 -14
- package/dist/extensions.d.ts +54 -17
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +83 -15
- package/dist/files-backends/cursor-hosted.d.ts +0 -8
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/files-backends/cursor-hosted.js +1 -11
- package/dist/files.d.ts +21 -4
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +38 -21
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/ab-snapshot.js +0 -1
- package/dist/internal/advertise-tools.d.ts.map +1 -1
- package/dist/internal/advertise-tools.js +1 -3
- package/dist/internal/authored-alias-hooks.d.ts +4 -13
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -1
- package/dist/internal/authored-alias-hooks.js +4 -20
- package/dist/internal/authored-loaders.d.ts +2 -3
- package/dist/internal/authored-loaders.d.ts.map +1 -1
- package/dist/internal/authored-loaders.js +6 -20
- package/dist/internal/channel-dispatch.d.ts +43 -0
- package/dist/internal/channel-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-dispatch.js +77 -0
- package/dist/internal/chat-client.d.ts +1 -1
- package/dist/internal/chat-client.js +1 -1
- package/dist/internal/cli-ax.d.ts +5 -5
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +5 -5
- package/dist/internal/cli-bitbucket.d.ts +33 -0
- package/dist/internal/cli-bitbucket.d.ts.map +1 -0
- package/dist/internal/cli-bitbucket.js +359 -0
- package/dist/internal/cli-convert-automation.d.ts +1 -1
- package/dist/internal/cli-convert-automation.js +2 -2
- package/dist/internal/cli-cursor.d.ts +1 -1
- package/dist/internal/cli-cursor.d.ts.map +1 -1
- package/dist/internal/cli-cursor.js +2 -4
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +2 -6
- package/dist/internal/cli-github.d.ts +1 -1
- package/dist/internal/cli-github.js +3 -3
- package/dist/internal/cli-gitlab.d.ts +37 -0
- package/dist/internal/cli-gitlab.d.ts.map +1 -0
- package/dist/internal/cli-gitlab.js +380 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -1
- package/dist/internal/cli-mcp.js +2 -6
- package/dist/internal/cli-slack.d.ts +1 -1
- package/dist/internal/cli-slack.d.ts.map +1 -1
- package/dist/internal/cli-slack.js +2 -4
- package/dist/internal/continuation-channel.d.ts +14 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +56 -3
- package/dist/internal/continuation-identity.d.ts +14 -15
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +182 -7
- package/dist/internal/conversation-mirror.d.ts.map +1 -1
- package/dist/internal/conversation-mirror.js +17 -18
- package/dist/internal/convert-automation/types.d.ts +1 -1
- package/dist/internal/convert-automation/types.js +1 -1
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -1
- package/dist/internal/cursor/account-mcp.js +1 -3
- package/dist/internal/cursor/backend-client.d.ts +13 -5
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +30 -15
- package/dist/internal/cursor/bound-secret-file.d.ts +56 -0
- package/dist/internal/cursor/bound-secret-file.d.ts.map +1 -0
- package/dist/internal/cursor/bound-secret-file.js +88 -0
- package/dist/internal/cursor/credentials.d.ts +39 -5
- package/dist/internal/cursor/credentials.d.ts.map +1 -1
- package/dist/internal/cursor/credentials.js +58 -8
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +19 -5
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-deployment-secrets.js +29 -9
- package/dist/internal/cursor/hosted-store-secrets.d.ts +12 -1
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +16 -1
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -1
- package/dist/internal/cursor-account-mcp-auth.js +2 -4
- package/dist/internal/cursor-deployment-relay.d.ts +6 -2
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -1
- package/dist/internal/cursor-deployment-relay.js +13 -9
- package/dist/internal/deploy-manifest.d.ts +1 -1
- package/dist/internal/deploy-manifest.d.ts.map +1 -1
- package/dist/internal/deploy-manifest.js +1 -1
- package/dist/internal/discovery/ab.d.ts +9 -0
- package/dist/internal/discovery/ab.d.ts.map +1 -0
- package/dist/internal/discovery/ab.js +113 -0
- package/dist/internal/discovery/agent-config.d.ts +35 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +173 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +255 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +422 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +568 -0
- package/dist/internal/discovery/extension-overlay.d.ts +32 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +191 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +375 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +61 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +147 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +107 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +293 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +118 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +21 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +134 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +128 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +159 -0
- package/dist/internal/discovery.d.ts +8 -63
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +6 -2504
- package/dist/internal/distribution.d.ts +10 -27
- package/dist/internal/distribution.d.ts.map +1 -1
- package/dist/internal/distribution.js +25 -73
- package/dist/internal/docs-site.js +1 -1
- package/dist/internal/eval-run-store.d.ts +0 -1
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-runner.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.d.ts +8 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -1
- package/dist/internal/framework-file-storage.js +14 -14
- package/dist/internal/framework-storage-selection.d.ts.map +1 -1
- package/dist/internal/framework-storage-selection.js +8 -7
- package/dist/internal/frontmatter.d.ts +11 -3
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +29 -3
- package/dist/internal/github-fanout.d.ts +1 -1
- package/dist/internal/github-fanout.js +1 -1
- package/dist/internal/guest-network.d.ts +101 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +304 -0
- package/dist/internal/host-otel.d.ts +3 -3
- package/dist/internal/host-otel.d.ts.map +1 -1
- package/dist/internal/host-otel.js +8 -4
- package/dist/internal/hosted-admission-adapter.d.ts +8 -7
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.d.ts +6 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -1
- package/dist/internal/hosted-delivery-protocol.js +18 -5
- package/dist/internal/hosted-delivery.d.ts +18 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -1
- package/dist/internal/hosted-delivery.js +248 -118
- package/dist/internal/http-channel.d.ts.map +1 -1
- package/dist/internal/http-channel.js +1 -3
- package/dist/internal/init-interview.d.ts.map +1 -1
- package/dist/internal/init-interview.js +1 -3
- package/dist/internal/init-project.d.ts +2 -2
- package/dist/internal/init-project.js +2 -2
- package/dist/internal/inline-stdio-define-stub.d.ts +1 -1
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -1
- package/dist/internal/inline-stdio-define-stub.js +1 -1
- package/dist/internal/is-record.d.ts +2 -0
- package/dist/internal/is-record.d.ts.map +1 -0
- package/dist/internal/is-record.js +3 -0
- package/dist/internal/json-schema.d.ts.map +1 -1
- package/dist/internal/json-schema.js +18 -10
- package/dist/internal/local-control-plane.d.ts +1 -2
- package/dist/internal/local-control-plane.d.ts.map +1 -1
- package/dist/internal/local-control-plane.js +3 -20
- package/dist/internal/mcp-endpoint.d.ts.map +1 -1
- package/dist/internal/mcp-endpoint.js +1 -3
- package/dist/internal/mcp-host.d.ts.map +1 -1
- package/dist/internal/mcp-host.js +37 -20
- package/dist/internal/otel/collector.d.ts +22 -0
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +145 -126
- package/dist/internal/otel/config.d.ts +0 -2
- package/dist/internal/otel/config.d.ts.map +1 -1
- package/dist/internal/otel/config.js +17 -20
- package/dist/internal/otel/http.d.ts +2 -0
- package/dist/internal/otel/http.d.ts.map +1 -1
- package/dist/internal/otel/http.js +8 -10
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +55 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +26 -1
- package/dist/internal/otel/runtime.d.ts.map +1 -1
- package/dist/internal/otel/runtime.js +166 -15
- package/dist/internal/package-inline-stdio.d.ts.map +1 -1
- package/dist/internal/package-inline-stdio.js +3 -11
- package/dist/internal/playground/toolchain.d.ts +1 -1
- package/dist/internal/playground/toolchain.d.ts.map +1 -1
- package/dist/internal/playground/toolchain.js +1 -1
- package/dist/internal/request-error-status.d.ts +12 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +52 -0
- package/dist/internal/resolve-prod-target.d.ts +1 -1
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +3 -7
- package/dist/internal/result-output.d.ts +18 -0
- package/dist/internal/result-output.d.ts.map +1 -0
- package/dist/internal/result-output.js +33 -0
- package/dist/internal/run-client.d.ts +2 -2
- package/dist/internal/run-client.js +2 -2
- package/dist/internal/runtime-dispatch-runner.d.ts +1 -11
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -1
- package/dist/internal/runtime-dispatch-runner.js +2 -15
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +3 -6
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +110 -35
- package/dist/internal/session-cost.d.ts +3 -3
- package/dist/internal/session-cost.d.ts.map +1 -1
- package/dist/internal/session-cost.js +3 -3
- package/dist/internal/session-engine.d.ts +31 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +208 -102
- package/dist/internal/session-run-log.d.ts +2 -1
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +14 -17
- package/dist/internal/skills-sync.d.ts +1 -4
- package/dist/internal/skills-sync.d.ts.map +1 -1
- package/dist/internal/skills-sync.js +10 -50
- package/dist/internal/sleep.d.ts +2 -0
- package/dist/internal/sleep.d.ts.map +1 -0
- package/dist/internal/sleep.js +3 -0
- package/dist/internal/start-log-store.d.ts +1 -1
- package/dist/internal/start-log-store.d.ts.map +1 -1
- package/dist/internal/start-log-store.js +12 -14
- package/dist/internal/storage-coordinator.d.ts +4 -1
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +15 -13
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/tenant-slack/relay.d.ts +73 -0
- package/dist/internal/tenant-slack/relay.d.ts.map +1 -0
- package/dist/internal/tenant-slack/relay.js +138 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -1
- package/dist/internal/tool-catalog.js +9 -6
- package/dist/internal/turn-cost.d.ts +14 -0
- package/dist/internal/turn-cost.d.ts.map +1 -1
- package/dist/internal/turn-cost.js +41 -9
- package/dist/internal/v2-hosting.d.ts +22 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +23 -0
- package/dist/internal/workspace-sync.d.ts +22 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +49 -0
- package/dist/internal/workspace.d.ts +7 -0
- package/dist/internal/workspace.d.ts.map +1 -1
- package/dist/internal/workspace.js +13 -0
- package/dist/otel.d.ts +39 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +118 -1
- package/dist/playground/assets/index-59KvgREd.js +67 -0
- package/dist/playground/assets/index-MbMxXg-y.css +1 -0
- package/dist/playground/index.html +2 -2
- package/dist/result.d.ts +24 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +27 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -1
- package/dist/storage-backends/cursor-hosted.js +7 -4
- package/dist/storage-protocol.d.ts +24 -23
- package/dist/storage-protocol.d.ts.map +1 -1
- package/dist/storage-protocol.js +69 -68
- package/dist/storage.d.ts +2 -2
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/tools.d.ts +9 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +9 -0
- package/dist/types.d.ts +126 -23
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +7 -3
- package/docs/concepts.md +5 -7
- package/docs/design/runtime-abstraction.md +2 -3
- package/docs/evals.md +9 -7
- package/docs/guides/cloud-agents.md +96 -0
- package/docs/guides/github.md +0 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +18 -8
- package/docs/reference/cli.md +3 -4
- package/docs/reference/extensions.md +269 -0
- package/docs/reference/hooks.md +215 -46
- package/docs/reference/playground.md +3 -0
- package/docs/reference/project-layout.md +4 -0
- package/docs/reference/result.md +94 -0
- package/docs/reference/sessions.md +3 -1
- package/docs/reference/skills.md +2 -0
- package/docs/reference/tools.md +3 -2
- package/docs/templates/pr-autofixer.md +0 -3
- package/package.json +29 -10
- package/skills/framework-map/SKILL.md +3 -0
- package/skills/otel/SKILL.md +8 -3
- package/src/ab.ts +1 -1
- package/src/bin/agent-serve.ts +121 -21
- package/src/channels/bitbucket/api.ts +623 -0
- package/src/channels/bitbucket/binding.ts +414 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +182 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +576 -0
- package/src/channels/bitbucket/checks.ts +154 -0
- package/src/channels/bitbucket/cursor-account.ts +117 -0
- package/src/channels/bitbucket/defaults.ts +110 -0
- package/src/channels/bitbucket/events.ts +84 -0
- package/src/channels/bitbucket/index.ts +49 -0
- package/src/channels/bitbucket/replay.ts +439 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +266 -0
- package/src/channels/deployments/deployments-channel.ts +25 -43
- package/src/channels/deployments/types.ts +12 -6
- package/src/channels/github/binding.ts +8 -1
- package/src/channels/github/cursor-account.ts +17 -6
- package/src/channels/github/events.ts +1 -1
- package/src/channels/github/forward.ts +3 -2
- package/src/channels/github/github-channel.ts +74 -221
- package/src/channels/github/replay.ts +1 -1
- package/src/channels/github/state.ts +6 -0
- package/src/channels/github/types.ts +2 -5
- package/src/channels/gitlab/api.ts +228 -0
- package/src/channels/gitlab/binding.ts +233 -0
- package/src/channels/gitlab/checks.ts +243 -0
- package/src/channels/gitlab/cursor-account.ts +114 -0
- package/src/channels/gitlab/defaults.ts +93 -0
- package/src/channels/gitlab/events.ts +44 -0
- package/src/channels/gitlab/gitlab-channel.ts +176 -0
- package/src/channels/gitlab/gitlab-webhook.ts +555 -0
- package/src/channels/gitlab/index.ts +43 -0
- package/src/channels/gitlab/replay.ts +347 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +263 -0
- package/src/channels/origin/api.ts +4 -2
- package/src/channels/origin/origin-channel.ts +19 -94
- package/src/channels/origin/types.ts +23 -2
- package/src/channels/slack/api.ts +4 -2
- package/src/channels/slack/assistant.ts +1 -1
- package/src/channels/slack/dispatch.ts +27 -2
- package/src/channels/slack/eval-directive.ts +1 -6
- package/src/channels/slack/inbound.ts +37 -0
- package/src/channels/slack/init.ts +6 -3
- package/src/channels/slack/manifest.ts +2 -1
- package/src/channels/slack/setup.ts +7 -6
- package/src/channels/slack/types.ts +1 -1
- package/src/channels.ts +0 -1
- package/src/client.ts +1 -1
- package/src/connections.ts +1 -1
- package/src/evals.ts +1 -1
- package/src/extensions/cursor-cloud-agents/extension.ts +9 -7
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +395 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +23 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +21 -7
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +51 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +22 -42
- package/src/extensions/cursor-cloud-agents/tools/list.ts +1 -1
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions.ts +100 -15
- package/src/files-backends/cursor-hosted.ts +1 -17
- package/src/files.ts +64 -37
- package/src/index.ts +27 -26
- package/src/internal/ab-snapshot.ts +0 -3
- package/src/internal/advertise-tools.ts +1 -4
- package/src/internal/authored-alias-hooks.ts +4 -21
- package/src/internal/authored-loaders.ts +6 -23
- package/src/internal/channel-dispatch.ts +160 -0
- package/src/internal/chat-client.ts +1 -1
- package/src/internal/cli-ax.ts +5 -5
- package/src/internal/cli-bitbucket.ts +477 -0
- package/src/internal/cli-convert-automation.ts +7 -7
- package/src/internal/cli-cursor.ts +2 -5
- package/src/internal/cli-deploy.ts +2 -8
- package/src/internal/cli-github.ts +3 -3
- package/src/internal/cli-gitlab.ts +485 -0
- package/src/internal/cli-mcp.ts +2 -7
- package/src/internal/cli-slack.ts +2 -5
- package/src/internal/continuation-channel.ts +82 -1
- package/src/internal/continuation-identity.ts +229 -11
- package/src/internal/conversation-mirror.ts +27 -21
- package/src/internal/convert-automation/types.ts +1 -1
- package/src/internal/cursor/account-mcp.ts +1 -4
- package/src/internal/cursor/backend-client.ts +41 -20
- package/src/internal/cursor/bound-secret-file.ts +108 -0
- package/src/internal/cursor/credentials.ts +75 -10
- package/src/internal/cursor/hosted-bound-secrets.ts +75 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +42 -11
- package/src/internal/cursor/hosted-store-secrets.ts +28 -1
- package/src/internal/cursor-account-mcp-auth.ts +2 -5
- package/src/internal/cursor-deployment-relay.ts +11 -7
- package/src/internal/deploy-manifest.ts +4 -2
- package/src/internal/discovery/ab.ts +131 -0
- package/src/internal/discovery/agent-config.ts +222 -0
- package/src/internal/discovery/agent.ts +319 -0
- package/src/internal/discovery/channels.ts +105 -0
- package/src/internal/discovery/connections.ts +545 -0
- package/src/internal/discovery/context.ts +46 -0
- package/src/internal/discovery/cursor-plugin.ts +705 -0
- package/src/internal/discovery/extension-overlay.ts +274 -0
- package/src/internal/discovery/extensions.ts +573 -0
- package/src/internal/discovery/fs.ts +108 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +186 -0
- package/src/internal/discovery/instructions.ts +113 -0
- package/src/internal/discovery/modules.ts +113 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +341 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +37 -0
- package/src/internal/discovery/services.ts +160 -0
- package/src/internal/discovery/skills.ts +186 -0
- package/src/internal/discovery/subagent.ts +136 -0
- package/src/internal/discovery/tools.ts +182 -0
- package/src/internal/discovery.ts +18 -3081
- package/src/internal/distribution.ts +35 -83
- package/src/internal/docs-site.ts +1 -1
- package/src/internal/eval-run-store.ts +0 -7
- package/src/internal/eval-runner.ts +0 -1
- package/src/internal/framework-file-storage.ts +14 -14
- package/src/internal/framework-storage-selection.ts +9 -9
- package/src/internal/frontmatter.ts +36 -3
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +383 -0
- package/src/internal/host-otel.ts +8 -4
- package/src/internal/hosted-admission-adapter.ts +8 -8
- package/src/internal/hosted-delivery-protocol.ts +26 -1
- package/src/internal/hosted-delivery.ts +376 -192
- package/src/internal/http-channel.ts +1 -4
- package/src/internal/init-interview.ts +1 -4
- package/src/internal/init-project.ts +2 -2
- package/src/internal/inline-stdio-define-stub.ts +1 -1
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +19 -10
- package/src/internal/local-control-plane.ts +5 -24
- package/src/internal/mcp-endpoint.ts +1 -4
- package/src/internal/mcp-host.ts +84 -31
- package/src/internal/otel/collector.ts +200 -165
- package/src/internal/otel/config.ts +10 -14
- package/src/internal/otel/http.ts +16 -13
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +242 -25
- package/src/internal/package-inline-stdio.ts +3 -12
- package/src/internal/playground/toolchain.ts +1 -1
- package/src/internal/request-error-status.ts +72 -0
- package/src/internal/resolve-prod-target.ts +3 -8
- package/src/internal/result-output.ts +34 -0
- package/src/internal/run-client.ts +2 -2
- package/src/internal/runtime-dispatch-runner.ts +3 -21
- package/src/internal/sdk-runner.ts +3 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +274 -81
- package/src/internal/session-run-log.ts +18 -20
- package/src/internal/skills-sync.ts +13 -63
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +13 -16
- package/src/internal/storage-coordinator.ts +19 -16
- package/src/internal/store-mirror.ts +86 -0
- package/src/internal/tenant-slack/relay.ts +179 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +286 -0
- package/src/internal/tool-catalog.ts +9 -6
- package/src/internal/turn-cost.ts +47 -4
- package/src/internal/v2-hosting.ts +38 -0
- package/src/internal/workspace-sync.ts +55 -0
- package/src/internal/workspace.ts +14 -0
- package/src/otel.ts +180 -2
- package/src/result.ts +36 -0
- package/src/storage-backends/cursor-hosted.ts +7 -4
- package/src/storage-protocol.ts +102 -95
- package/src/storage.ts +4 -0
- package/src/tools.ts +18 -0
- package/src/types.ts +146 -34
- package/templates/triage/agent/lib/types.ts +0 -2
- package/dist/continuation.d.ts +0 -20
- package/dist/continuation.d.ts.map +0 -1
- package/dist/continuation.js +0 -18
- package/dist/docs/assets/chunks/@localSearchIndexroot.DbFXINq2.js +0 -1
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.CkYbjnAX.lean.js +0 -1
- package/dist/docs/assets/index.md.Bb4k8kUm.js +0 -5
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
- package/dist/docs/assets/skills_framework-map.md.BTi817yv.js +0 -1
- package/dist/docs/guides/cloud-runtime.html +0 -35
- package/dist/docs/guides/cloud-runtime.md +0 -115
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts +0 -30
- package/dist/extensions/cursor-cloud-agents/lib/cloud.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/lib/cloud.js +0 -45
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/follow_up.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts +0 -4
- package/dist/extensions/cursor-cloud-agents/tools/status.d.ts.map +0 -1
- package/dist/extensions/cursor-cloud-agents/tools/status.js +0 -41
- package/dist/internal/convert-automation/index.d.ts +0 -3
- package/dist/internal/convert-automation/index.d.ts.map +0 -1
- package/dist/internal/convert-automation/index.js +0 -1
- package/dist/internal/grokbot/runner.d.ts +0 -64
- package/dist/internal/grokbot/runner.d.ts.map +0 -1
- package/dist/internal/grokbot/runner.js +0 -282
- package/dist/internal/managed-delivery.d.ts +0 -80
- package/dist/internal/managed-delivery.d.ts.map +0 -1
- package/dist/internal/managed-delivery.js +0 -86
- package/dist/internal/review-comments.d.ts +0 -370
- package/dist/internal/review-comments.d.ts.map +0 -1
- package/dist/internal/review-comments.js +0 -921
- package/dist/internal/shallow-clone.d.ts +0 -176
- package/dist/internal/shallow-clone.d.ts.map +0 -1
- package/dist/internal/shallow-clone.js +0 -419
- package/dist/playground/assets/index-BnNN1-EK.js +0 -69
- package/dist/playground/assets/index-DBQCwFp0.css +0 -1
- package/docs/guides/cloud-runtime.md +0 -120
- package/src/continuation.ts +0 -49
- package/src/extensions/cursor-cloud-agents/lib/cloud.ts +0 -79
- package/src/extensions/cursor-cloud-agents/tools/follow_up.ts +0 -29
- package/src/extensions/cursor-cloud-agents/tools/status.ts +0 -39
- package/src/internal/convert-automation/index.ts +0 -10
- package/src/internal/grokbot/runner.ts +0 -370
- package/src/internal/managed-delivery.ts +0 -125
- package/src/internal/review-comments.ts +0 -1363
- package/src/internal/shallow-clone.ts +0 -609
- /package/dist/docs/assets/{evals.md.CPzDAwoH.lean.js → evals.md.CbMoebP1.lean.js} +0 -0
- /package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.DKYiT9do.lean.js} +0 -0
- /package/dist/docs/assets/{reference_agent-config.md.BHeYMgme.lean.js → reference_agent-config.md.CHNpiyp4.lean.js} +0 -0
- /package/dist/docs/assets/{reference_cli.md.DfoeyvL0.lean.js → reference_cli.md.CJNc_xYK.lean.js} +0 -0
- /package/dist/docs/assets/{reference_playground.md.DnX5nL-B.lean.js → reference_playground.md.4myJPxrf.lean.js} +0 -0
- /package/dist/docs/assets/{reference_skills.md.BFW9retM.lean.js → reference_skills.md.l2ezAcaN.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.CvAHsdSp.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
package/docs/reference/hooks.md
CHANGED
|
@@ -5,56 +5,119 @@ description: "Observe-only subscribers to the session event stream: audit logs,
|
|
|
5
5
|
|
|
6
6
|
# Hooks
|
|
7
7
|
|
|
8
|
-
A hook
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
A hook subscribes to the session event stream and runs a side effect
|
|
9
|
+
after each event is recorded: an audit line, a metric, a copy of the
|
|
10
|
+
transcript in your own store, or derived state for later turns. Hooks
|
|
11
|
+
run in the serving process for every session of the agent, on local and
|
|
12
|
+
cloud runtime turns alike.
|
|
13
|
+
|
|
14
|
+
Hooks observe. They can't change the turn, the prompt, or the reply, and
|
|
15
|
+
a handler that throws is logged and skipped. Treat the event as
|
|
16
|
+
read-only; later subscribers see the same object. That makes hooks safe
|
|
17
|
+
to add to a production agent, and the wrong tool for anything that must
|
|
18
|
+
happen before the model runs or must fail a turn; see
|
|
19
|
+
[When not to use a hook](#when-not-to-use-a-hook).
|
|
20
|
+
|
|
21
|
+
`defineHook` is unrelated to
|
|
22
|
+
[Cursor Agent hooks](https://cursor.com/docs/agent/hooks), the
|
|
23
|
+
`.cursor/hooks.json` scripts that can observe, block, or modify the
|
|
24
|
+
agent loop. Those still run inside a local session workspace.
|
|
25
|
+
|
|
26
|
+
## Author a hook
|
|
20
27
|
|
|
21
28
|
Author `agent/hooks/<name>.ts` with `defineHook` from
|
|
22
|
-
`@cursor/july/hooks
|
|
29
|
+
`@cursor/july/hooks`. This one meters tokens:
|
|
23
30
|
|
|
24
31
|
```ts
|
|
32
|
+
// agent/hooks/usage.ts
|
|
25
33
|
import { defineHook } from "@cursor/july/hooks";
|
|
26
34
|
|
|
27
35
|
export default defineHook({
|
|
28
36
|
events: {
|
|
29
37
|
async "turn.completed"(event, ctx) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
if (ctx.session.purpose === "eval" || event.data.usage === undefined) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const { inputTokens, outputTokens } = event.data.usage;
|
|
42
|
+
ctx.host.otel.increment("acme.tokens.input", inputTokens);
|
|
43
|
+
ctx.host.otel.increment("acme.tokens.output", outputTokens);
|
|
33
44
|
},
|
|
34
|
-
async "turn.failed"(
|
|
35
|
-
|
|
45
|
+
async "turn.failed"(_event, ctx) {
|
|
46
|
+
ctx.host.otel.increment("acme.turn.failed", { channel: ctx.channel.id });
|
|
36
47
|
},
|
|
37
48
|
},
|
|
38
49
|
});
|
|
39
50
|
```
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
Any module under `agent/hooks/`, subfolders included, is a hook named by
|
|
53
|
+
its path without the extension: `agent/hooks/audit/usage.ts` is
|
|
54
|
+
`audit/usage`. `*.test.ts` and `*.spec.ts` files are skipped. The
|
|
55
|
+
default export must be `defineHook(...)`, names can't contain `__`, and
|
|
56
|
+
an empty `events` map skips the hook with a warning; `agent-sdk validate`
|
|
57
|
+
reports all three. An extension mounts its hooks as `<ns>__<name>`, and
|
|
58
|
+
`disableHook()` removes one
|
|
59
|
+
([Adjust a mounted extension](./extensions.md#adjust-a-mounted-extension)).
|
|
60
|
+
|
|
61
|
+
`agent-sdk init` scaffolds `agent/hooks/memory.ts`, which exports
|
|
62
|
+
`memoryHook()` from `@cursor/july/memory` and journals every turn for
|
|
63
|
+
later sessions to read. Delete the file to opt out.
|
|
64
|
+
|
|
65
|
+
## Events and payloads
|
|
66
|
+
|
|
67
|
+
Keys are event types from the
|
|
68
|
+
[event vocabulary](./sessions.md#which-events-can-i-stream), or `"*"`
|
|
69
|
+
for every event. A typed key narrows `event.data`; a `"*"` handler
|
|
70
|
+
receives the union, so switch on `event.type`. Every event carries the
|
|
71
|
+
stream envelope `{ type, index, sessionId, turnId?, at, data }`, with
|
|
72
|
+
`turnId` set on turn-scoped events.
|
|
73
|
+
|
|
74
|
+
The payloads hooks read most often:
|
|
75
|
+
|
|
76
|
+
| Event | `event.data` |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `message.received` | `{ text }` |
|
|
79
|
+
| `turn.completed` | `{ result?, usage?, cost? }`. `usage` has `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, and optional `reasoningTokens`. `cost` has `totalUsd` and the `model` it was priced against |
|
|
80
|
+
| `turn.failed` | `{ message }` |
|
|
81
|
+
| `actions.requested` | `{ calls: [{ callId, toolName, args? }] }`. A call with `parentCallId` belongs to a subagent |
|
|
82
|
+
| `action.result` | `{ callId, toolName, output?, isError, stubbed? }`. `stubbed` means a dry-run session answered a write without running it |
|
|
83
|
+
|
|
84
|
+
The types are `SessionEvent`, `SessionEventType`, and `HookContext`,
|
|
85
|
+
exported from `@cursor/july`.
|
|
86
|
+
|
|
87
|
+
## Handler context
|
|
45
88
|
|
|
46
89
|
| Member | What it is |
|
|
47
90
|
| --- | --- |
|
|
48
|
-
| `ctx.session` | Read-only session info: id
|
|
91
|
+
| `ctx.session` | Read-only session info: `id`, `channelId`, `mode` (`chat` or `task`), `purpose` (`live` or `eval`), `auth`, plus `title`, `sdkAgentId`, and `abs` when set |
|
|
49
92
|
| `ctx.agent` | `{ name }` of the agent the event belongs to |
|
|
50
|
-
| `ctx.channel` | `{ id, continuationToken }`
|
|
51
|
-
| `ctx.
|
|
52
|
-
| `ctx.host` |
|
|
53
|
-
| `ctx.
|
|
93
|
+
| `ctx.channel` | `{ id, continuationToken }`. The token is `null` when the session can't take follow-ups |
|
|
94
|
+
| `ctx.host.kv` | Durable JSON, shared by every session of the agent; the [storage backend](../storage.md#author-kv-ctx-host-kv) decides whether it survives a hosted replace. Prefix keys with `ctx.session.id` for per-session state |
|
|
95
|
+
| `ctx.host.files` | Durable files, bound to this session. Pass `{ scope: "deployment" }` for agent-wide files |
|
|
96
|
+
| `ctx.host.otel` | Counters, histograms, and tags, attributed to this session |
|
|
97
|
+
| `ctx.host.mcp`, `ctx.host.github`, `ctx.host.slack` | The same shared clients tools get |
|
|
98
|
+
| `ctx.host.reminders` | Per-session [reminders](./schedules.md), the same API tools get |
|
|
99
|
+
| `ctx.artifacts` | Session-bound [artifacts](./artifacts.md) facade: `tag` fills in `sessionId` and `turnId` |
|
|
100
|
+
| `ctx.stateRoot` | Absolute path of the local state root. It resets when a hosted deployment is replaced; keep derived state in `kv` or `files` |
|
|
101
|
+
|
|
102
|
+
## When hooks run
|
|
103
|
+
|
|
104
|
+
A hook runs after the event is durably recorded. It never delays the
|
|
105
|
+
model turn and never sees an event that wasn't recorded.
|
|
106
|
+
|
|
107
|
+
Within one session, events dispatch in order, one at a time: the
|
|
108
|
+
channel's `events` handlers first, then each hook in discovery order.
|
|
109
|
+
Sessions don't wait on each other.
|
|
54
110
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
111
|
+
Two consequences:
|
|
112
|
+
|
|
113
|
+
- A slow handler holds up the next event's handlers for that session,
|
|
114
|
+
not the model. Keep handlers short and queue anything slow.
|
|
115
|
+
- Hooks fire for eval sessions too. Check
|
|
116
|
+
`ctx.session.purpose === "eval"` before metering or paging.
|
|
117
|
+
|
|
118
|
+
Each event reaches a hook at most once. A restart doesn't replay the log
|
|
119
|
+
into hooks, so a mirror needs no dedupe, and the event log rather than
|
|
120
|
+
the hook's copy is the source of truth.
|
|
58
121
|
|
|
59
122
|
## Hooks, channel events, evals, or A/B?
|
|
60
123
|
|
|
@@ -62,37 +125,143 @@ All of them consume the same stream, for different jobs:
|
|
|
62
125
|
|
|
63
126
|
| | Hooks | Channel `events` | Evals | A/B (`defineAB`) |
|
|
64
127
|
| --- | --- | --- | --- | --- |
|
|
65
|
-
| Scope | every session
|
|
66
|
-
| Job | observe: audit, metrics, mirrors, derived state | deliver: replies back to the channel's surface | assert: gates over the trajectory |
|
|
128
|
+
| Scope | every session of the agent | sessions the channel owns | one test turn | every live session; enrollment at creation, metrics on each turn |
|
|
129
|
+
| Job | observe: audit, metrics, mirrors, derived state | deliver: replies back to the channel's surface | assert: gates over the trajectory | compare: sticky arms, then fold the stream into `onSample` metrics |
|
|
130
|
+
| Context | `ctx.host`, `ctx.artifacts`, session info | `channel.state`, `setContinuationToken`, `ctx.host`, session info | the `t` assertion helpers | per-session samples in `onSample` |
|
|
67
131
|
| Can affect the run | no | yes, it owns the surface | n/a | yes through arm instructions or `session.abs`; collection is observe-only |
|
|
68
132
|
| Authored at | `agent/hooks/*.ts` | channel config | `evals/**/*.eval.ts` | [`agent/ab.ts` or `agent/ab/*.ts`](../ab.md) |
|
|
69
133
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
134
|
+
## When not to use a hook
|
|
135
|
+
|
|
136
|
+
| You want to | Use instead |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| Add context before the model runs | The channel's `send` message and `workspaceFiles`, `instructions.md`, skills, or `sandbox/workspace/` seed files |
|
|
139
|
+
| Reply on Slack, comment on a PR, or post any other delivery | The channel's `events` map, or the Slack and GitHub packs |
|
|
140
|
+
| Show PR progress (merge-box check, sticky banner) | `githubChannel({ progress: { commitStatus, banner } })`; see [Show PR progress](../guides/github.md#show-pr-progress) |
|
|
141
|
+
| Block, approve, or rewrite a tool call | [`needsApproval`](./tools.md#gate-a-tool-on-human-approval) on the tool |
|
|
142
|
+
| Act on the final assistant text, or fail a bad turn | [`defineResult`](./result.md) |
|
|
143
|
+
| Gate a change on behavior | [Evals](../evals.md) |
|
|
144
|
+
| Compare two prompts on live traffic | [`defineAB`](../ab.md) |
|
|
77
145
|
|
|
78
146
|
## Patterns
|
|
79
147
|
|
|
80
|
-
Usage metering
|
|
81
|
-
|
|
148
|
+
Usage metering is the [authoring example](#author-a-hook). Three more:
|
|
149
|
+
|
|
150
|
+
### Alert on failure
|
|
151
|
+
|
|
152
|
+
`turn.failed` carries the message, and `ctx.session.id` points at the
|
|
153
|
+
trace. Skip interrupted turns; those are preemptions, not failures. Read
|
|
154
|
+
secrets inside the handler: hosted deployments bind them after the
|
|
155
|
+
process starts, so a module-scope read stays empty. Give the call a
|
|
156
|
+
timeout, since a stalled request holds up later handlers on that
|
|
157
|
+
session.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
// agent/hooks/page-on-failure.ts
|
|
161
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
162
|
+
|
|
163
|
+
export default defineHook({
|
|
164
|
+
events: {
|
|
165
|
+
async "turn.failed"(event, ctx) {
|
|
166
|
+
const pagerUrl = process.env.PAGER_WEBHOOK_URL;
|
|
167
|
+
if (
|
|
168
|
+
pagerUrl === undefined ||
|
|
169
|
+
ctx.session.purpose === "eval" ||
|
|
170
|
+
event.data.message === "turn interrupted"
|
|
171
|
+
) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
await fetch(pagerUrl, {
|
|
175
|
+
method: "POST",
|
|
176
|
+
headers: { "content-type": "application/json" },
|
|
177
|
+
body: JSON.stringify({
|
|
178
|
+
agent: ctx.agent.name,
|
|
179
|
+
session: ctx.session.id,
|
|
180
|
+
channel: ctx.channel.id,
|
|
181
|
+
message: event.data.message,
|
|
182
|
+
}),
|
|
183
|
+
signal: AbortSignal.timeout(5_000),
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Mirror the transcript
|
|
191
|
+
|
|
192
|
+
Subscribe to `"*"` and write one file per event, skipping the
|
|
193
|
+
`*.appended` deltas: they arrive per token, and `message.completed`
|
|
194
|
+
carries the final text. Session scope keeps transcripts apart without a
|
|
195
|
+
session id in the path. The mirror holds reasoning text and raw tool
|
|
196
|
+
arguments and outputs, so pick the store accordingly, and write to your
|
|
197
|
+
own store instead when you need cross-session queries.
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
// agent/hooks/mirror.ts
|
|
201
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
202
|
+
|
|
203
|
+
export default defineHook({
|
|
204
|
+
events: {
|
|
205
|
+
async "*"(event, ctx) {
|
|
206
|
+
if (event.type.endsWith(".appended")) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const name = String(event.index).padStart(6, "0");
|
|
210
|
+
await ctx.host.files.write(
|
|
211
|
+
`transcript/${name}.json`,
|
|
212
|
+
JSON.stringify(event)
|
|
213
|
+
);
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Keep derived state across a replace
|
|
220
|
+
|
|
221
|
+
Write it to `ctx.host.kv` under a session-prefixed key; a tool reads it
|
|
222
|
+
back with `ctx.host.kv.get`.
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
// agent/hooks/last-result.ts
|
|
226
|
+
import { defineHook } from "@cursor/july/hooks";
|
|
227
|
+
|
|
228
|
+
export default defineHook({
|
|
229
|
+
events: {
|
|
230
|
+
async "turn.completed"(event, ctx) {
|
|
231
|
+
await ctx.host.kv.put(`last-result/${ctx.session.id}`, {
|
|
232
|
+
at: event.at,
|
|
233
|
+
result: event.data.result ?? null,
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Test and debug a hook
|
|
82
241
|
|
|
83
|
-
|
|
84
|
-
`
|
|
242
|
+
A hook definition is a plain object, so a unit test calls
|
|
243
|
+
`hook.events["turn.completed"]` directly with an event and a stub
|
|
244
|
+
`HookContext`. Discovery skips `*.test.ts`, so the test can live next to
|
|
245
|
+
the hook.
|
|
85
246
|
|
|
86
|
-
|
|
87
|
-
`ctx.host.kv` or `ctx.host.files`. `stateRoot` resets on replace.
|
|
247
|
+
At runtime:
|
|
88
248
|
|
|
89
|
-
|
|
249
|
+
- `agent-sdk validate --dir .` reports discovery errors and the
|
|
250
|
+
empty-handlers warning.
|
|
251
|
+
- `agent-sdk info --dir . --json` lists the loaded hooks under
|
|
252
|
+
`agents[].hooks`.
|
|
253
|
+
- Send a turn with `agent-sdk dev` or `agent-sdk run --dir . --message "…"`
|
|
254
|
+
and watch the serve log for
|
|
255
|
+
`hook "<name>" handler for <event> threw: …`. `run` prints that log on
|
|
256
|
+
stderr. On hosting, read it with [`agent-sdk logs`](./cli.md#logs).
|
|
90
257
|
|
|
91
258
|
## What's next
|
|
92
259
|
|
|
93
260
|
Continue with these pages:
|
|
94
261
|
|
|
262
|
+
- [Turn result](./result.md): fail a turn from `commit`, not from a hook
|
|
95
263
|
- [Sessions and streaming](./sessions.md): the event vocabulary hooks observe
|
|
264
|
+
- [Storage](../storage.md): where `ctx.host.kv` and `ctx.host.files` live
|
|
96
265
|
- [OpenTelemetry](../guides/opentelemetry.md): OTLP traces and metrics
|
|
97
266
|
from the same event stream
|
|
98
267
|
- [Deployment](../deployment.md#observability): runtime logs and export
|
|
@@ -32,6 +32,9 @@ Use the playground to chat, try channel routes, and inspect sessions.
|
|
|
32
32
|
`/v1/dev/evals`). Schedule hand-dispatch still requires `--dev`.
|
|
33
33
|
- **The surface**: inspect the discovered tools, skills, subagents, MCP
|
|
34
34
|
connections, channels, and hooks.
|
|
35
|
+
- **Custom tool chips**: drop `agent/playground/tools/<toolName>.tsx` to
|
|
36
|
+
change how that tool renders. Chips compile from the agent tree;
|
|
37
|
+
an [extension](./extensions.md) cannot contribute them.
|
|
35
38
|
- **Raw events pane**: flip it on to inspect the event stream.
|
|
36
39
|
- **Logs tab**: recent server log lines, polled from `GET /v1/logs`.
|
|
37
40
|
- **A/Bs tab**: per-session and aggregate
|
|
@@ -21,6 +21,8 @@ experiments can override their file-derived name.
|
|
|
21
21
|
| `agent/host-connections/anytool.ts` | Host MCP connection `anytool` (host + `mcp oauth` only) |
|
|
22
22
|
| `agent/skills/pr-review.md` | skill `pr-review` |
|
|
23
23
|
| `agent/subagents/reviewer/` | subagent `reviewer` |
|
|
24
|
+
| `agent/extensions/ci.ts` | extension mount `ci`; its contributions become `ci__<name>` |
|
|
25
|
+
| `agent/extensions/notion.ts` | Cursor plugin mount `notion` (`cursorPlugin`); its skills, agents, and MCP servers become `notion__<name>` |
|
|
24
26
|
| `agent/channels/drive.ts` | channel `drive`, routes under `/v1/channels/drive` |
|
|
25
27
|
| `agent/ab.ts` | A/B experiment `ab` unless `name` overrides it |
|
|
26
28
|
| `agent/ab/concise.ts` | A/B experiment `concise` unless `name` overrides it |
|
|
@@ -71,6 +73,7 @@ Each path maps to a capability and a reference page.
|
|
|
71
73
|
| `agent/mcp-connections/<name>.ts` | MCP servers, available to the model, to server tools (`ctx.host.mcp`), and to channel/schedule handlers (`args.host.mcp`) | [MCP connections](./connections.md) |
|
|
72
74
|
| `agent/host-connections/<name>.ts` | Privileged MCP servers for `ctx.host.mcp` and `mcp oauth`. The model never sees them. | [MCP connections](./connections.md) |
|
|
73
75
|
| `agent/subagents/<id>/` | Child agent directory; `description` required | [Subagents](./subagents.md) |
|
|
76
|
+
| `agent/extensions/<ns>.ts` or `agent/extensions/<ns>/` | A mounted extension or Cursor plugin; its contributions become `<ns>__<name>` | [Extensions](./extensions.md) |
|
|
74
77
|
| `agent/channels/*.ts` | HTTP surfaces beyond the built-in session API; `slack.ts` and `github.ts` use the platform packs | [Channels](./channels.md) |
|
|
75
78
|
| `agent/hooks/*.ts` | Observe-only event subscribers, never fatal | [Hooks](./hooks.md) |
|
|
76
79
|
| `agent/otel.ts` | `defineOtel` OTLP export (traces, metrics, optional logs) | [OpenTelemetry](../guides/opentelemetry.md) |
|
|
@@ -78,6 +81,7 @@ Each path maps to a capability and a reference page.
|
|
|
78
81
|
| `agent/ab.config.ts` | `defineABConfig` shared A/B settings | [Live A/B metrics](../ab.md) |
|
|
79
82
|
| `agent/storage.ts` | `defineStorage` backend for the durable `host.kv` / `host.files` APIs | [Storage](../storage.md) |
|
|
80
83
|
| `agent/artifacts.ts` | `defineArtifacts` kinds, the `tag_artifact` opt-in, and retention | [Artifacts](./artifacts.md) |
|
|
84
|
+
| `agent/result.ts` | `defineResult` host `commit` on the final assistant text | [Turn result](./result.md) |
|
|
81
85
|
| `agent/schedules/*` | Cron-driven runs (UTC, 5-field; never auto-fire under `--dev`) | [Schedules](./schedules.md) |
|
|
82
86
|
| `agent/sandbox/workspace/**` | Seed files copied into each local session workspace | [Sessions](./sessions.md#what-goes-into-a-local-session-workspace) |
|
|
83
87
|
| `agent/playground/` | Custom playground tool chips | [Playground](./playground.md) |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Turn result"
|
|
3
|
+
description: "Run host code on the final assistant text when a turn finishes. Throw to fail the turn."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Turn result
|
|
7
|
+
|
|
8
|
+
Judgment agents need a place to act on the model's last message: parse
|
|
9
|
+
it, then page, comment, or close a ticket. Author `agent/result.ts`
|
|
10
|
+
with `defineResult` from `@cursor/july/result`. When that file exists,
|
|
11
|
+
every finished turn runs `commit` on the serving host with the full
|
|
12
|
+
assistant text.
|
|
13
|
+
|
|
14
|
+
A thrown `commit` fails the turn. Empty assistant text fails it too.
|
|
15
|
+
Hooks still observe only; they cannot fail a valid turn.
|
|
16
|
+
|
|
17
|
+
Use this for an end-of-turn actuation. Mid-turn actions belong in
|
|
18
|
+
[tools](./tools.md). Durable records that outlive a session belong in
|
|
19
|
+
[artifacts](./artifacts.md).
|
|
20
|
+
|
|
21
|
+
## Author `agent/result.ts`
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { defineResult } from "@cursor/july/result";
|
|
25
|
+
import { applyDecision, parseDecision } from "./lib/actuate.js";
|
|
26
|
+
|
|
27
|
+
export default defineResult({
|
|
28
|
+
async commit(ctx) {
|
|
29
|
+
if (ctx.session.purpose === "eval") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
await applyDecision(parseDecision(ctx.text), ctx.host);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`commit` is required. Parse `ctx.text` however the agent needs. Tell
|
|
38
|
+
the model the document shape in `instructions.md`. The Agent SDK does
|
|
39
|
+
not inject a schema.
|
|
40
|
+
|
|
41
|
+
Put `result.ts` on the root agent only. A copy under a subagent is
|
|
42
|
+
ignored with a warning.
|
|
43
|
+
|
|
44
|
+
## Commit on the host
|
|
45
|
+
|
|
46
|
+
`commit` runs in the serving process after the model finishes, before
|
|
47
|
+
the turn completes. `ctx` is the same host surface a server tool gets,
|
|
48
|
+
plus the turn text:
|
|
49
|
+
|
|
50
|
+
| Member | What it is |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `ctx.session` | The session that produced this turn, including `purpose` |
|
|
53
|
+
| `ctx.host` | Shared host services (`kv`, `files`, `mcp`) |
|
|
54
|
+
| `ctx.artifacts` | Session-bound [artifacts](./artifacts.md) facade |
|
|
55
|
+
| `ctx.stateRoot` | The agent's durable state root |
|
|
56
|
+
| `ctx.workspaceDir` | The session workspace |
|
|
57
|
+
| `ctx.text` | The full assistant string |
|
|
58
|
+
|
|
59
|
+
A dry-run session skips `commit` and still completes. Eval sessions do
|
|
60
|
+
run `commit`; return early when `ctx.session.purpose === "eval"` if the
|
|
61
|
+
handler must not actuate.
|
|
62
|
+
|
|
63
|
+
On cloud runtime, the model still runs on the VM. `commit` runs on the
|
|
64
|
+
serving host after the turn returns.
|
|
65
|
+
|
|
66
|
+
`GET /v1/info` reports `result: true` when the file is authored.
|
|
67
|
+
|
|
68
|
+
## Assert in evals
|
|
69
|
+
|
|
70
|
+
`t.succeeded()` fails when `commit` throws or the turn produced no
|
|
71
|
+
text, because those are turn failures. Read the document on `t.reply`.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { defineEval, includes } from "@cursor/july/evals";
|
|
75
|
+
|
|
76
|
+
export default defineEval({
|
|
77
|
+
async test(t) {
|
|
78
|
+
await t.send("Triage LIN-1842. It duplicates LIN-1801.");
|
|
79
|
+
t.succeeded();
|
|
80
|
+
t.check(t.reply, includes("duplicate"));
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## What's next
|
|
86
|
+
|
|
87
|
+
Continue with these pages:
|
|
88
|
+
|
|
89
|
+
- [Evals](../evals.md): `t.succeeded` and `t.reply`
|
|
90
|
+
- [Sessions and streaming](./sessions.md): `turn.completed` and
|
|
91
|
+
`turn.failed`
|
|
92
|
+
- [Hooks](./hooks.md): observe the stream after the turn has already
|
|
93
|
+
settled
|
|
94
|
+
- [Project layout](./project-layout.md): where `agent/result.ts` lives
|
|
@@ -94,7 +94,9 @@ within one session. The `at` field is an ISO-8601 timestamp.
|
|
|
94
94
|
|
|
95
95
|
Pair `actions.requested` with `action.result` to reconstruct the tool
|
|
96
96
|
trajectory. Read `turn.completed.data.usage` for input, output, and
|
|
97
|
-
cache token counts.
|
|
97
|
+
cache token counts. When `agent/result.ts` is authored, a thrown
|
|
98
|
+
`commit` or empty assistant text emits `turn.failed` instead of
|
|
99
|
+
`turn.completed`. See [Turn result](./result.md).
|
|
98
100
|
|
|
99
101
|
## How do I stream or replay session events?
|
|
100
102
|
|
package/docs/reference/skills.md
CHANGED
|
@@ -85,4 +85,6 @@ Continue with these pages:
|
|
|
85
85
|
|
|
86
86
|
- [Instructions](./instructions.md): what stays always-on
|
|
87
87
|
- [Tools](./tools.md): when prose needs to become code
|
|
88
|
+
- [Extensions](./extensions.md): skills installed as a package under a
|
|
89
|
+
namespace
|
|
88
90
|
- [Project layout](./project-layout.md): where skills sit in the tree
|
package/docs/reference/tools.md
CHANGED
|
@@ -19,8 +19,7 @@ access to `process.env` and your `agent/lib/` code. Local turns call
|
|
|
19
19
|
server tools as SDK custom tools. Cloud turns reach them over
|
|
20
20
|
authenticated HTTP MCP back to the serve host when `--public-url` or
|
|
21
21
|
`--cloud-tools-url` is set; without either, the server warns at startup
|
|
22
|
-
and cloud turns omit them
|
|
23
|
-
[Cloud runtime](../guides/cloud-runtime.md#what-changes-on-cloud)).
|
|
22
|
+
and cloud turns omit them.
|
|
24
23
|
|
|
25
24
|
```ts
|
|
26
25
|
// agent/tools/inspect_pr.ts
|
|
@@ -343,4 +342,6 @@ Continue with these pages:
|
|
|
343
342
|
lifecycle in full
|
|
344
343
|
- [MCP connections](./connections.md): tools that come from MCP servers
|
|
345
344
|
instead
|
|
345
|
+
- [Extensions](./extensions.md): tools installed as a package under a
|
|
346
|
+
namespace
|
|
346
347
|
- [Evals](../evals.md): gating tool decisions with `calledTool`
|
|
@@ -123,6 +123,3 @@ agent-sdk deploy
|
|
|
123
123
|
Run it from the agent's git checkout. It infers repository, ref, path,
|
|
124
124
|
and slug, builds on Cursor-managed hosting, and prints the URL.
|
|
125
125
|
`agent-sdk deployments` shows status.
|
|
126
|
-
|
|
127
|
-
See [Cloud runtime](../guides/cloud-runtime.md) for what changes on
|
|
128
|
-
the VM.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cursor/july",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.103",
|
|
4
4
|
"description": "(early alpha) Filesystem-first framework for defining Cursor agents as markdown and TypeScript and serving them over channels with the Cursor SDK.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
"module": "dist/index.js",
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"bin": {
|
|
16
|
-
"
|
|
17
|
-
"agent-sdk": "./dist/bin/agent-serve.js",
|
|
18
|
-
"agentsdk": "./dist/bin/agent-serve.js",
|
|
19
|
-
"agentkit": "./dist/bin/agent-serve.js",
|
|
20
|
-
"agent-serve": "./dist/bin/agent-serve.js"
|
|
16
|
+
"agent-sdk": "./dist/bin/agent-serve.js"
|
|
21
17
|
},
|
|
22
18
|
"publishConfig": {
|
|
23
19
|
"access": "public"
|
|
@@ -26,9 +22,17 @@
|
|
|
26
22
|
"dist/**/*",
|
|
27
23
|
"!dist/playground-central/**",
|
|
28
24
|
"!dist/internal/tenant-mcp/**",
|
|
25
|
+
"!dist/internal/grokbot/**",
|
|
26
|
+
"!dist/internal/review-comments.*",
|
|
27
|
+
"!dist/internal/shallow-clone.*",
|
|
28
|
+
"!dist/internal/managed-delivery.*",
|
|
29
29
|
"src/**/*",
|
|
30
30
|
"!src/**/*.test.ts",
|
|
31
31
|
"!src/internal/tenant-mcp/**",
|
|
32
|
+
"!src/internal/grokbot/**",
|
|
33
|
+
"!src/internal/review-comments.ts",
|
|
34
|
+
"!src/internal/shallow-clone.ts",
|
|
35
|
+
"!src/internal/managed-delivery.ts",
|
|
32
36
|
"skills/**/*",
|
|
33
37
|
"templates/**/*",
|
|
34
38
|
"docs/**/*.md",
|
|
@@ -83,6 +87,18 @@
|
|
|
83
87
|
"import": "./dist/channels/origin/index.js",
|
|
84
88
|
"default": "./dist/channels/origin/index.js"
|
|
85
89
|
},
|
|
90
|
+
"./channels/gitlab": {
|
|
91
|
+
"anysphere-source": "./src/channels/gitlab/index.ts",
|
|
92
|
+
"types": "./dist/channels/gitlab/index.d.ts",
|
|
93
|
+
"import": "./dist/channels/gitlab/index.js",
|
|
94
|
+
"default": "./dist/channels/gitlab/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./channels/bitbucket": {
|
|
97
|
+
"anysphere-source": "./src/channels/bitbucket/index.ts",
|
|
98
|
+
"types": "./dist/channels/bitbucket/index.d.ts",
|
|
99
|
+
"import": "./dist/channels/bitbucket/index.js",
|
|
100
|
+
"default": "./dist/channels/bitbucket/index.js"
|
|
101
|
+
},
|
|
86
102
|
"./channels/deployments": {
|
|
87
103
|
"anysphere-source": "./src/channels/deployments/index.ts",
|
|
88
104
|
"types": "./dist/channels/deployments/index.d.ts",
|
|
@@ -182,6 +198,13 @@
|
|
|
182
198
|
"import": "./dist/artifacts.js",
|
|
183
199
|
"default": "./dist/artifacts.js"
|
|
184
200
|
},
|
|
201
|
+
"./result": {
|
|
202
|
+
"anysphere-source": "./src/result.ts",
|
|
203
|
+
"bun": "./dist/result.js",
|
|
204
|
+
"types": "./dist/result.d.ts",
|
|
205
|
+
"import": "./dist/result.js",
|
|
206
|
+
"default": "./dist/result.js"
|
|
207
|
+
},
|
|
185
208
|
"./kv": {
|
|
186
209
|
"anysphere-source": "./src/kv.ts",
|
|
187
210
|
"bun": "./dist/kv.js",
|
|
@@ -289,21 +312,17 @@
|
|
|
289
312
|
"devDependencies": {
|
|
290
313
|
"@anysphere/agent-store-sync": "workspace:*",
|
|
291
314
|
"@anysphere/ui": "workspace:*",
|
|
292
|
-
"@base-ui/react": "1.6.0",
|
|
293
|
-
"@stylexjs/stylex": "0.18.3",
|
|
294
315
|
"@stylexswc/rs-compiler": "^0.18.0",
|
|
295
316
|
"@tanstack/react-virtual": "3.13.23",
|
|
296
317
|
"@types/js-yaml": "4.0.9",
|
|
297
318
|
"@types/ms": "^2.1.0",
|
|
298
319
|
"@types/node": "catalog:",
|
|
299
|
-
"@types/pg": "^8.16.0",
|
|
300
320
|
"@types/proper-lockfile": "^4.1.4",
|
|
301
321
|
"@types/react": "^19.0.0",
|
|
302
322
|
"@types/react-dom": "^19.0.0",
|
|
303
323
|
"@typescript/native-preview": "7.0.0-dev.20260701.1",
|
|
304
324
|
"@vitejs/plugin-react": "^5.1.2",
|
|
305
325
|
"minimatch": "^10.2.5",
|
|
306
|
-
"pg": "^8.18.0",
|
|
307
326
|
"pretty-ms": "^9.2.0",
|
|
308
327
|
"react": "^19.2.1",
|
|
309
328
|
"react-dom": "^19.2.1",
|
|
@@ -44,8 +44,11 @@ Path is identity. Full list: README "Folder structure".
|
|
|
44
44
|
| `agent/mcp-connections/<name>.ts` | MCP. Never name an account file `cursor.ts`. `advertiseTools: true` for named local tools |
|
|
45
45
|
| `agent/host-connections/<name>.ts` | Privileged MCP for `ctx.host.mcp` / `mcp oauth` |
|
|
46
46
|
| `agent/subagents/<id>/` | Child agent (`description` required) |
|
|
47
|
+
| `agent/extensions/<ns>.ts` | Mounted extension or Cursor plugin (`cursorPlugin`); contributions are `<ns>__<name>` |
|
|
47
48
|
| `agent/channels/*.ts` | Slack / GitHub / custom HTTP |
|
|
48
49
|
| `agent/hooks/*.ts` | Observe-only |
|
|
50
|
+
| `agent/artifacts.ts` | Durable tagged outputs (`defineArtifacts`) |
|
|
51
|
+
| `agent/result.ts` | Host `commit` on the final assistant text (`defineResult`) |
|
|
49
52
|
| `agent/ab.ts` or `agent/ab/*.ts` | Live A/B (`defineAB`) |
|
|
50
53
|
| `agent/otel.ts` | OpenTelemetry (`defineOtel`) |
|
|
51
54
|
| `agent/schedules/*` | Cron. Never auto-fire under `--dev` |
|
package/skills/otel/SKILL.md
CHANGED
|
@@ -33,9 +33,13 @@ export default defineOtel({
|
|
|
33
33
|
3. `serve(dir, { otel: { … } })`. `otel: false` disables env and
|
|
34
34
|
authored config.
|
|
35
35
|
|
|
36
|
+
Hosted v2 secrets arrive after bake. Use `defineOtel(() => …)` so flush
|
|
37
|
+
re-resolves exporters. Authored `agent/otel.ts` records from process
|
|
38
|
+
start even when the factory returns no exporters yet.
|
|
39
|
+
|
|
36
40
|
| Signal | Default |
|
|
37
41
|
| --- | --- |
|
|
38
|
-
| Traces | on (`agent_sdk.http`
|
|
42
|
+
| Traces | on (`agent_sdk.http`; `agent_sdk.turn` → tool / subagent) |
|
|
39
43
|
| Metrics | on (`cursor.token.usage`, `cursor.tool.calls`, `cursor.cost.usage`) |
|
|
40
44
|
| Logs | off (`logs: true` or `OTEL_LOGS_EXPORTER=otlp`) |
|
|
41
45
|
|
|
@@ -51,5 +55,6 @@ ctx.host.otel.record("abc.approval.duration_ms", 1420);
|
|
|
51
55
|
```
|
|
52
56
|
|
|
53
57
|
Prefix names with team or agent. No custom spans. Join on
|
|
54
|
-
`cursor.conversation.id` and
|
|
55
|
-
own process when Agent SDK
|
|
58
|
+
`agent_sdk.session_id` / `cursor.conversation.id` and
|
|
59
|
+
`agent_sdk.agent`. Run `serve` as its own process when Agent SDK
|
|
60
|
+
should own the destination.
|
package/src/ab.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* `ab.assigned` events; arms are exposed on {@link SessionInfo.abs} for the
|
|
7
7
|
* agent loop (tools / optional per-variant `instructions`). {@link ABCollector}
|
|
8
8
|
* folds the event stream into metrics and calls {@link ABConfig.onSample}.
|
|
9
|
-
* There is no `agent-
|
|
9
|
+
* There is no `agent-sdk ab` test runner.
|
|
10
10
|
*
|
|
11
11
|
* Assignments and foldable metrics live in each session's `events.ndjson`
|
|
12
12
|
* (survive serve restart). Optional project defaults in `agent/ab.config.ts`
|