@cursor/july 0.1.102 → 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 +10 -12
- 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/eval-directive.d.ts.map +1 -1
- package/dist/channels/slack/eval-directive.js +1 -7
- package/dist/channels/slack/init.d.ts.map +1 -1
- package/dist/channels/slack/init.js +3 -3
- 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.CLA03RCz.js → app.DW9pXkpL.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.nrl1ifBq.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.ifxv-cJV.js → VPLocalSearchBox.CdEIUwDg.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DWCwM6p-.js → theme.YZMHgPgg.js} +2 -2
- package/dist/docs/assets/concepts.md.DgEcZOfT.js +1 -0
- package/dist/docs/assets/{concepts.md.rPzW2HZN.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_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.Kiht7ell.js → index.md.D75GWhPl.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.9WQMZe1l.js → reference_extensions.md.DykHW3qL.js} +11 -5
- 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.CA6QP6Lw.js → reference_project-layout.md.DuBu9a96.js} +2 -2
- 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_tools.md.B1up2r9W.js → reference_tools.md.aGrn99hP.js} +1 -1
- package/dist/docs/assets/skills_framework-map.md.haibFyoB.js +1 -0
- 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 +2 -4
- 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 +6 -6
- package/dist/docs/guides/cloud-agents.md +4 -6
- 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 +10 -11
- 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 +2 -2
- package/dist/docs/llms-full.txt +501 -262
- package/dist/docs/llms.txt +2 -2
- 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 +16 -10
- package/dist/docs/reference/extensions.md +86 -22
- 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 +2 -1
- 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 +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +5 -5
- package/dist/docs/reference/tools.md +1 -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 -1
- 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.d.ts +20 -7
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +36 -5
- package/dist/files.d.ts +16 -3
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +16 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- 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 +4 -3
- 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 +5 -4
- package/dist/internal/cursor/backend-client.d.ts.map +1 -1
- package/dist/internal/cursor/backend-client.js +5 -6
- 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 +1 -1
- package/dist/internal/cursor/hosted-store-secrets.js +1 -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 +1 -1
- package/dist/internal/discovery/ab.d.ts.map +1 -1
- package/dist/internal/discovery/ab.js +21 -9
- package/dist/internal/discovery/agent.d.ts +6 -1
- package/dist/internal/discovery/agent.d.ts.map +1 -1
- package/dist/internal/discovery/agent.js +65 -116
- package/dist/internal/discovery/channels.d.ts +1 -1
- package/dist/internal/discovery/channels.d.ts.map +1 -1
- package/dist/internal/discovery/channels.js +14 -14
- package/dist/internal/discovery/connections.d.ts +1 -5
- package/dist/internal/discovery/connections.d.ts.map +1 -1
- package/dist/internal/discovery/connections.js +30 -44
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -1
- package/dist/internal/discovery/cursor-plugin.js +1 -3
- 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 +11 -2
- package/dist/internal/discovery/extensions.d.ts.map +1 -1
- package/dist/internal/discovery/extensions.js +211 -74
- package/dist/internal/discovery/hooks.d.ts +1 -1
- package/dist/internal/discovery/hooks.d.ts.map +1 -1
- package/dist/internal/discovery/hooks.js +15 -2
- package/dist/internal/discovery/info.d.ts.map +1 -1
- package/dist/internal/discovery/info.js +7 -1
- package/dist/internal/discovery/modules.d.ts.map +1 -1
- package/dist/internal/discovery/modules.js +8 -2
- package/dist/internal/discovery/names.d.ts +1 -1
- package/dist/internal/discovery/names.d.ts.map +1 -1
- package/dist/internal/discovery/names.js +1 -0
- package/dist/internal/discovery/project.d.ts +0 -2
- package/dist/internal/discovery/project.d.ts.map +1 -1
- package/dist/internal/discovery/project.js +64 -10
- package/dist/internal/discovery/runtime.d.ts.map +1 -1
- package/dist/internal/discovery/runtime.js +1 -2
- package/dist/internal/discovery/schedules.d.ts +1 -1
- package/dist/internal/discovery/schedules.d.ts.map +1 -1
- package/dist/internal/discovery/schedules.js +23 -2
- package/dist/internal/discovery/services.d.ts +6 -2
- package/dist/internal/discovery/services.d.ts.map +1 -1
- package/dist/internal/discovery/services.js +31 -1
- package/dist/internal/discovery/skills.d.ts +1 -6
- package/dist/internal/discovery/skills.d.ts.map +1 -1
- package/dist/internal/discovery/skills.js +8 -3
- package/dist/internal/discovery/subagent.d.ts +3 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -1
- package/dist/internal/discovery/subagent.js +109 -0
- package/dist/internal/discovery.d.ts +1 -2
- package/dist/internal/discovery.d.ts.map +1 -1
- package/dist/internal/discovery.js +1 -2
- 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 +8 -8
- 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/otel/collector.d.ts +12 -3
- package/dist/internal/otel/collector.d.ts.map +1 -1
- package/dist/internal/otel/collector.js +77 -125
- 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 +7 -1
- package/dist/internal/otel/mcp.d.ts.map +1 -1
- package/dist/internal/otel/mcp.js +3 -16
- 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 +164 -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 +26 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +146 -76
- package/dist/internal/session-run-log.d.ts.map +1 -1
- package/dist/internal/session-run-log.js +1 -3
- 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/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/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 +23 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +93 -2
- 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.map +1 -1
- package/dist/storage-protocol.js +1 -3
- package/dist/types.d.ts +90 -23
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/concepts.md +2 -4
- package/docs/design/runtime-abstraction.md +2 -3
- package/docs/evals.md +9 -7
- package/docs/guides/cloud-agents.md +4 -6
- 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 +87 -23
- package/docs/reference/hooks.md +215 -46
- package/docs/reference/playground.md +3 -0
- package/docs/reference/project-layout.md +2 -1
- package/docs/reference/result.md +94 -0
- package/docs/reference/sessions.md +3 -1
- package/docs/reference/tools.md +1 -2
- package/docs/templates/pr-autofixer.md +0 -3
- package/package.json +29 -10
- package/skills/framework-map/SKILL.md +3 -1
- 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/eval-directive.ts +1 -6
- package/src/channels/slack/init.ts +6 -3
- 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.ts +47 -5
- package/src/files.ts +21 -3
- package/src/index.ts +20 -28
- 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 +4 -3
- 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 +9 -10
- 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 +1 -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 +29 -9
- package/src/internal/discovery/agent.ts +94 -135
- package/src/internal/discovery/channels.ts +15 -13
- package/src/internal/discovery/connections.ts +55 -50
- package/src/internal/discovery/cursor-plugin.ts +1 -4
- package/src/internal/discovery/extension-overlay.ts +274 -0
- package/src/internal/discovery/extensions.ts +330 -105
- package/src/internal/discovery/hooks.ts +20 -2
- package/src/internal/discovery/info.ts +7 -0
- package/src/internal/discovery/modules.ts +8 -2
- package/src/internal/discovery/names.ts +2 -1
- package/src/internal/discovery/project.ts +80 -9
- package/src/internal/discovery/runtime.ts +1 -2
- package/src/internal/discovery/schedules.ts +28 -2
- package/src/internal/discovery/services.ts +37 -1
- package/src/internal/discovery/skills.ts +13 -3
- package/src/internal/discovery/subagent.ts +107 -0
- package/src/internal/discovery.ts +0 -2
- 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 +8 -8
- 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/otel/collector.ts +94 -159
- package/src/internal/otel/config.ts +10 -14
- package/src/internal/otel/http.ts +14 -1
- package/src/internal/otel/mcp.ts +3 -16
- package/src/internal/otel/runtime.ts +240 -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 +182 -74
- package/src/internal/session-run-log.ts +1 -4
- package/src/internal/skills-sync.ts +13 -63
- package/src/internal/sleep.ts +3 -0
- 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/workspace-sync.ts +55 -0
- package/src/internal/workspace.ts +14 -0
- package/src/otel.ts +143 -3
- package/src/result.ts +36 -0
- package/src/storage-backends/cursor-hosted.ts +7 -4
- package/src/storage-protocol.ts +1 -4
- package/src/types.ts +105 -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.FAqdWIXo.js +0 -1
- package/dist/docs/assets/concepts.md.rPzW2HZN.js +0 -1
- package/dist/docs/assets/guides_cloud-agents.md.DumwWXba.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.js +0 -9
- package/dist/docs/assets/guides_cloud-runtime.md.BRirbRAN.lean.js +0 -1
- package/dist/docs/assets/reference_extensions.md.9WQMZe1l.lean.js +0 -1
- package/dist/docs/assets/reference_hooks.md.a8BJxMR5.js +0 -14
- package/dist/docs/assets/skills_framework-map.md.DDa4MeEW.js +0 -1
- package/dist/docs/guides/cloud-runtime.html +0 -35
- package/dist/docs/guides/cloud-runtime.md +0 -117
- 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-B6C9S9nG.css +0 -1
- package/dist/playground/assets/index-ZqNoT8Ie.js +0 -69
- package/docs/guides/cloud-runtime.md +0 -122
- package/src/continuation.ts +0 -49
- 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_cloud-agents.md.DumwWXba.lean.js → guides_cloud-agents.md.DS8RIjwx.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/{index.md.Kiht7ell.lean.js → index.md.D75GWhPl.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_project-layout.md.CA6QP6Lw.lean.js → reference_project-layout.md.DuBu9a96.lean.js} +0 -0
- /package/dist/docs/assets/{reference_tools.md.B1up2r9W.lean.js → reference_tools.md.aGrn99hP.lean.js} +0 -0
- /package/dist/docs/assets/{skills_framework-map.md.DDa4MeEW.lean.js → skills_framework-map.md.haibFyoB.lean.js} +0 -0
package/src/otel.ts
CHANGED
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
* serviceName: "cursor",
|
|
10
10
|
* exporters: [{ url: "https://otel.example.com", protocol: "http/protobuf" }],
|
|
11
11
|
* });
|
|
12
|
+
*
|
|
13
|
+
* // Hosted v2: re-read env on flush after deployment secrets bind.
|
|
14
|
+
* export default defineOtel(() => resolveMyOtelConfig());
|
|
12
15
|
* ```
|
|
13
16
|
*/
|
|
14
17
|
|
|
18
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
19
|
import { context, trace } from "@opentelemetry/api";
|
|
16
20
|
import { brandDefinition } from "./internal/brand.js";
|
|
17
21
|
|
|
@@ -92,8 +96,47 @@ export interface OtelConfig {
|
|
|
92
96
|
|
|
93
97
|
export type OtelDefinition = OtelConfig & { readonly __agentServe: "otel" };
|
|
94
98
|
|
|
99
|
+
/** Re-read authored config after bake (hosted v2 binds secrets later). */
|
|
100
|
+
export type OtelConfigFactory = () => OtelConfig;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Hidden factory on {@link OtelDefinition}. Not enumerable so
|
|
104
|
+
* `pickAuthoredOtel` compares the bake-time snapshot, not the thunk.
|
|
105
|
+
*/
|
|
106
|
+
export const OTEL_CONFIG_RESOLVE: symbol = Symbol.for(
|
|
107
|
+
"anysphere.july.otel.configResolve"
|
|
108
|
+
);
|
|
109
|
+
|
|
95
110
|
/** Author OpenTelemetry export under `agent/otel.ts`. */
|
|
96
|
-
export function defineOtel(
|
|
111
|
+
export function defineOtel(
|
|
112
|
+
config: OtelConfig | OtelConfigFactory = {}
|
|
113
|
+
): OtelDefinition {
|
|
114
|
+
const resolve: OtelConfigFactory =
|
|
115
|
+
typeof config === "function" ? config : () => config;
|
|
116
|
+
const snapshot = resolve();
|
|
117
|
+
validateOtelConfig(snapshot);
|
|
118
|
+
const def = brandDefinition("otel", snapshot);
|
|
119
|
+
Object.defineProperty(def, OTEL_CONFIG_RESOLVE, {
|
|
120
|
+
value: resolve,
|
|
121
|
+
enumerable: false,
|
|
122
|
+
});
|
|
123
|
+
return def;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Invoke a `defineOtel(() => …)` factory, or return the static snapshot. */
|
|
127
|
+
export function resolveOtelDefinition(def: OtelConfig): OtelConfig {
|
|
128
|
+
const resolve = (
|
|
129
|
+
def as unknown as Record<symbol, OtelConfigFactory | undefined>
|
|
130
|
+
)[OTEL_CONFIG_RESOLVE];
|
|
131
|
+
if (resolve === undefined) {
|
|
132
|
+
return def;
|
|
133
|
+
}
|
|
134
|
+
const next = resolve();
|
|
135
|
+
validateOtelConfig(next);
|
|
136
|
+
return next;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function validateOtelConfig(config: OtelConfig): void {
|
|
97
140
|
if (config.exporters !== undefined) {
|
|
98
141
|
for (const exporter of config.exporters) {
|
|
99
142
|
if (typeof exporter.url !== "string" || exporter.url.length === 0) {
|
|
@@ -123,7 +166,6 @@ export function defineOtel(config: OtelConfig = {}): OtelDefinition {
|
|
|
123
166
|
}
|
|
124
167
|
}
|
|
125
168
|
assertSampleRatio(config.traces);
|
|
126
|
-
return brandDefinition("otel", config);
|
|
127
169
|
}
|
|
128
170
|
|
|
129
171
|
function assertSignals(signals: OtelSignal[] | undefined): void {
|
|
@@ -175,12 +217,17 @@ export function formatTraceparent(spanContext: {
|
|
|
175
217
|
/**
|
|
176
218
|
* Copy the active span onto outbound headers as W3C `traceparent` and
|
|
177
219
|
* Cursor `backend-traceparent`. No-op when no valid span is active.
|
|
220
|
+
*
|
|
221
|
+
* Prefers the Agent SDK ALS (`instrumentHttp`, `runInTurn`,
|
|
222
|
+
* `runInCall`). Falls back to the `@anysphere/context` process-wide
|
|
223
|
+
* ALS: `createSpan` does not bind OTel API context, and SPAN keys
|
|
224
|
+
* are per `@opentelemetry/api` copy.
|
|
178
225
|
*/
|
|
179
226
|
export function injectActiveTraceContext(headers: {
|
|
180
227
|
get(name: string): string | null;
|
|
181
228
|
set(name: string, value: string): void;
|
|
182
229
|
}): void {
|
|
183
|
-
const span = trace.getSpan(context.active());
|
|
230
|
+
const span = trace.getSpan(context.active()) ?? getContextTracerSpan();
|
|
184
231
|
if (span === undefined) {
|
|
185
232
|
return;
|
|
186
233
|
}
|
|
@@ -191,3 +238,96 @@ export function injectActiveTraceContext(headers: {
|
|
|
191
238
|
headers.set(TRACEPARENT_HEADER, traceparent);
|
|
192
239
|
headers.set(BACKEND_TRACEPARENT_HEADER, traceparent);
|
|
193
240
|
}
|
|
241
|
+
|
|
242
|
+
/** W3C `traceparent` for the active span, or undefined if none. */
|
|
243
|
+
export function activeTraceparent(): string | undefined {
|
|
244
|
+
const headers = new Headers();
|
|
245
|
+
injectActiveTraceContext(headers);
|
|
246
|
+
return headers.get(TRACEPARENT_HEADER) ?? undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Copy the active span onto every outbound `fetch`. Agents should not
|
|
251
|
+
* wrap their own Connect / MCP clients for this — `createOtelRuntime`
|
|
252
|
+
* installs it on `globalThis.fetch` when traces are on.
|
|
253
|
+
*/
|
|
254
|
+
function headersForFetch(
|
|
255
|
+
input: RequestInfo | URL,
|
|
256
|
+
init?: RequestInit
|
|
257
|
+
): Headers {
|
|
258
|
+
// Fetch: `init.headers` replaces `Request` headers. If `init` omits
|
|
259
|
+
// headers (`fetch(request, { signal })`), keep the Request's.
|
|
260
|
+
const headers = new Headers(
|
|
261
|
+
init?.headers !== undefined
|
|
262
|
+
? init.headers
|
|
263
|
+
: input instanceof Request
|
|
264
|
+
? input.headers
|
|
265
|
+
: undefined
|
|
266
|
+
);
|
|
267
|
+
injectActiveTraceContext(headers);
|
|
268
|
+
return headers;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function instrumentedFetch(base: typeof fetch = fetch): typeof fetch {
|
|
272
|
+
return (input, init) => {
|
|
273
|
+
const headers = headersForFetch(input, init);
|
|
274
|
+
if (input instanceof Request && init === undefined) {
|
|
275
|
+
return base(new Request(input, { headers }));
|
|
276
|
+
}
|
|
277
|
+
return base(input, { ...init, headers });
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const OUTBOUND_FETCH_INSTALLED = Symbol.for(
|
|
282
|
+
"anysphere.july.otel.outboundFetch"
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
/** Idempotent. Safe to call from `createOtelRuntime` on every serve. */
|
|
286
|
+
export function installOutboundFetchInstrumentation(): void {
|
|
287
|
+
const slots = globalThis as unknown as Record<symbol, boolean>;
|
|
288
|
+
if (slots[OUTBOUND_FETCH_INSTALLED] === true) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
slots[OUTBOUND_FETCH_INSTALLED] = true;
|
|
292
|
+
globalThis.fetch = instrumentedFetch(globalThis.fetch);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Must match `@anysphere/context` `ACTIVE_OTEL_SPAN_ALS`. */
|
|
296
|
+
const ACTIVE_OTEL_SPAN_ALS = Symbol.for("anysphere.context.activeOtelSpanAls");
|
|
297
|
+
|
|
298
|
+
function ensureContextTracerAls(): void {
|
|
299
|
+
const slots = globalThis as unknown as Record<symbol, unknown>;
|
|
300
|
+
if (slots[ACTIVE_OTEL_SPAN_ALS] === undefined) {
|
|
301
|
+
slots[ACTIVE_OTEL_SPAN_ALS] = new AsyncLocalStorage();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
ensureContextTracerAls();
|
|
306
|
+
|
|
307
|
+
function getContextTracerSpan():
|
|
308
|
+
| {
|
|
309
|
+
spanContext: () => {
|
|
310
|
+
traceId: string;
|
|
311
|
+
spanId: string;
|
|
312
|
+
traceFlags: number;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
| undefined {
|
|
316
|
+
const als = (
|
|
317
|
+
globalThis as unknown as Record<
|
|
318
|
+
symbol,
|
|
319
|
+
{
|
|
320
|
+
getStore?: () =>
|
|
321
|
+
| {
|
|
322
|
+
spanContext: () => {
|
|
323
|
+
traceId: string;
|
|
324
|
+
spanId: string;
|
|
325
|
+
traceFlags: number;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
| undefined;
|
|
329
|
+
}
|
|
330
|
+
>
|
|
331
|
+
)[ACTIVE_OTEL_SPAN_ALS];
|
|
332
|
+
return als?.getStore?.();
|
|
333
|
+
}
|
package/src/result.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `defineResult` — authored at `agent/result.ts`.
|
|
3
|
+
*
|
|
4
|
+
* After the model finishes, `commit` runs on the serving host with the
|
|
5
|
+
* full assistant text. Throw to fail the turn. Parse `ctx.text` however
|
|
6
|
+
* the agent needs.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineResult } from "@cursor/july/result";
|
|
10
|
+
*
|
|
11
|
+
* export default defineResult({
|
|
12
|
+
* async commit(ctx) {
|
|
13
|
+
* if (ctx.session.purpose === "eval") {
|
|
14
|
+
* return;
|
|
15
|
+
* }
|
|
16
|
+
* await applyDecision(parseDecision(ctx.text), ctx.host);
|
|
17
|
+
* },
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { brandDefinition } from "./internal/brand.js";
|
|
23
|
+
import type { ResultConfig, ResultDefinition } from "./types.js";
|
|
24
|
+
|
|
25
|
+
export type {
|
|
26
|
+
ResultConfig,
|
|
27
|
+
ResultContext,
|
|
28
|
+
ResultDefinition,
|
|
29
|
+
} from "./types.js";
|
|
30
|
+
|
|
31
|
+
export function defineResult(config: ResultConfig): ResultDefinition {
|
|
32
|
+
if (typeof config.commit !== "function") {
|
|
33
|
+
throw new Error("defineResult: commit is required");
|
|
34
|
+
}
|
|
35
|
+
return brandDefinition("result", config);
|
|
36
|
+
}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import type { ABSnapshot } from "../ab.js";
|
|
26
26
|
import type { EvalRunSnapshot } from "../evals.js";
|
|
27
|
+
import { injectActiveTraceContext } from "../otel.js";
|
|
27
28
|
import type {
|
|
28
29
|
StorageABTable,
|
|
29
30
|
StorageCasTable,
|
|
@@ -223,12 +224,14 @@ export async function storageRpc<T>(
|
|
|
223
224
|
if (typeof fetchImpl !== "function") {
|
|
224
225
|
throw new Error("cursorHostedStorage requires fetch");
|
|
225
226
|
}
|
|
227
|
+
const headers = new Headers({
|
|
228
|
+
Authorization: `Bearer ${apiKey}`,
|
|
229
|
+
"Content-Type": "application/json",
|
|
230
|
+
});
|
|
231
|
+
injectActiveTraceContext(headers);
|
|
226
232
|
const response = await fetchImpl(`${baseUrl}${path}`, {
|
|
227
233
|
method: "POST",
|
|
228
|
-
headers
|
|
229
|
-
Authorization: `Bearer ${apiKey}`,
|
|
230
|
-
"Content-Type": "application/json",
|
|
231
|
-
},
|
|
234
|
+
headers,
|
|
232
235
|
body: JSON.stringify(body),
|
|
233
236
|
});
|
|
234
237
|
const text = await response.text();
|
package/src/storage-protocol.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
|
+
import { isRecord } from "./internal/is-record.js";
|
|
10
11
|
|
|
11
12
|
/** Legacy architecture-v1 storage root. */
|
|
12
13
|
export const STORAGE_KEY_ROOT = "agentkit/v1" as const;
|
|
@@ -205,10 +206,6 @@ export type DurableSessionSummary = {
|
|
|
205
206
|
running: boolean | undefined;
|
|
206
207
|
};
|
|
207
208
|
|
|
208
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
209
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
209
|
function stringValue(value: unknown): string | undefined {
|
|
213
210
|
return typeof value === "string" ? value : undefined;
|
|
214
211
|
}
|
package/src/types.ts
CHANGED
|
@@ -15,17 +15,10 @@ import type {
|
|
|
15
15
|
ContinuationClaim,
|
|
16
16
|
ContinuationIdentity,
|
|
17
17
|
MailboxContinuation,
|
|
18
|
-
} from "./continuation.js";
|
|
18
|
+
} from "./internal/continuation-identity.js";
|
|
19
19
|
import type { OtelConfig, OtelDefinition } from "./otel.js";
|
|
20
20
|
import type { StorageDefinition } from "./storage.js";
|
|
21
21
|
|
|
22
|
-
export type {
|
|
23
|
-
ContinuationClaim,
|
|
24
|
-
ContinuationIdentity,
|
|
25
|
-
ConversationType,
|
|
26
|
-
MailboxContinuation,
|
|
27
|
-
} from "./continuation.js";
|
|
28
|
-
|
|
29
22
|
// ============================================================================
|
|
30
23
|
// JSON
|
|
31
24
|
// ============================================================================
|
|
@@ -53,6 +46,7 @@ export type DefinitionKind =
|
|
|
53
46
|
| "extension"
|
|
54
47
|
| "disabled-tool"
|
|
55
48
|
| "disabled-connection"
|
|
49
|
+
| "disabled"
|
|
56
50
|
| "connection"
|
|
57
51
|
| "channel"
|
|
58
52
|
| "http-channel"
|
|
@@ -63,7 +57,8 @@ export type DefinitionKind =
|
|
|
63
57
|
| "ab"
|
|
64
58
|
| "storage"
|
|
65
59
|
| "artifacts"
|
|
66
|
-
| "otel"
|
|
60
|
+
| "otel"
|
|
61
|
+
| "result";
|
|
67
62
|
|
|
68
63
|
export interface BrandedDefinition<K extends DefinitionKind> {
|
|
69
64
|
readonly __agentServe: K;
|
|
@@ -104,6 +99,7 @@ export const DEFAULT_MODEL: ModelSetting = {
|
|
|
104
99
|
* `/v0/grokbot` session API, and the user-visible reply is whatever the
|
|
105
100
|
* agent delivers through its SendToUser tool. The hosted harness picks
|
|
106
101
|
* the model; {@link AgentConfig.model} does not apply to grokbot turns.
|
|
102
|
+
* The grokbot client is Cursor-internal and not in the published package.
|
|
107
103
|
*/
|
|
108
104
|
export type AgentRuntime = "local" | "cloud" | "grokbot";
|
|
109
105
|
|
|
@@ -818,7 +814,8 @@ export type HostOtelAttributes = Record<
|
|
|
818
814
|
*
|
|
819
815
|
* Metrics and tags only — no custom spans, and no raw OTel `Meter` /
|
|
820
816
|
* `Tracer`. First-party names (`cursor.token.usage`, …) and join keys
|
|
821
|
-
* (`cursor.conversation.id`, `agent_sdk.
|
|
817
|
+
* (`cursor.conversation.id`, `agent_sdk.session_id`, `agent_sdk.agent`,
|
|
818
|
+
* …) are reserved.
|
|
822
819
|
*/
|
|
823
820
|
export interface HostOtelApi {
|
|
824
821
|
/** True when a meter is running and `increment` / `record` export. */
|
|
@@ -826,7 +823,7 @@ export interface HostOtelApi {
|
|
|
826
823
|
|
|
827
824
|
/**
|
|
828
825
|
* Merge tags onto this host binding. On a session-bound host they join
|
|
829
|
-
*
|
|
826
|
+
* open turn/tool spans and later first-party metrics. Unbound tags
|
|
830
827
|
* stay on this host instance only.
|
|
831
828
|
*/
|
|
832
829
|
setAttributes(attributes: HostOtelAttributes): void;
|
|
@@ -1189,6 +1186,14 @@ export type DisabledToolDefinition = BrandedDefinition<"disabled-tool">;
|
|
|
1189
1186
|
export type DisabledConnectionDefinition =
|
|
1190
1187
|
BrandedDefinition<"disabled-connection">;
|
|
1191
1188
|
|
|
1189
|
+
/**
|
|
1190
|
+
* `export default disable()` / `disableSkill()` / `disableHook()` /
|
|
1191
|
+
* `disableChannel()` / `disableSchedule()` / `disableSubagent()` /
|
|
1192
|
+
* `disableInstructions()` / `disableAB()` / `disableArtifacts()` in a
|
|
1193
|
+
* directory mount removes that contribution from the matching overlay slot.
|
|
1194
|
+
*/
|
|
1195
|
+
export type DisabledDefinition = BrandedDefinition<"disabled">;
|
|
1196
|
+
|
|
1192
1197
|
/** One mounted extension and the names it contributed. */
|
|
1193
1198
|
export interface DiscoveredExtension {
|
|
1194
1199
|
/** Mount namespace: the filename stem or directory name under `agent/extensions/`. */
|
|
@@ -1198,10 +1203,26 @@ export interface DiscoveredExtension {
|
|
|
1198
1203
|
tools: string[];
|
|
1199
1204
|
/** Composed skill names (`<ns>__<name>`), overrides applied. */
|
|
1200
1205
|
skills: string[];
|
|
1201
|
-
/** Composed MCP connection names (`<ns>__<server>`)
|
|
1206
|
+
/** Composed MCP connection names (`<ns>__<server>`). */
|
|
1202
1207
|
connections: string[];
|
|
1203
|
-
/** Composed
|
|
1208
|
+
/** Composed host MCP connection names (`<ns>__<server>`). */
|
|
1209
|
+
hostConnections: string[];
|
|
1210
|
+
/** Composed subagent names (`<ns>__<id>`). */
|
|
1204
1211
|
subagents: string[];
|
|
1212
|
+
/** Composed hook names (`<ns>__<name>`). */
|
|
1213
|
+
hooks: string[];
|
|
1214
|
+
/** Composed channel ids (`<ns>__<id>`). */
|
|
1215
|
+
channels: string[];
|
|
1216
|
+
/** Composed schedule names (`<ns>__<name>`). */
|
|
1217
|
+
schedules: string[];
|
|
1218
|
+
/** Whether the mount contributed an instructions fragment. */
|
|
1219
|
+
instructions: boolean;
|
|
1220
|
+
/** Workspace seed paths the mount contributed. */
|
|
1221
|
+
seedFiles: string[];
|
|
1222
|
+
/** Composed A/B experiment names (`<ns>__<name>`). */
|
|
1223
|
+
abs: string[];
|
|
1224
|
+
/** Composed artifact kind names (`<ns>__<kind>`). */
|
|
1225
|
+
artifactKinds: string[];
|
|
1205
1226
|
}
|
|
1206
1227
|
|
|
1207
1228
|
// ============================================================================
|
|
@@ -1728,7 +1749,11 @@ export type SessionEventPayload =
|
|
|
1728
1749
|
}
|
|
1729
1750
|
| {
|
|
1730
1751
|
type: "turn.completed";
|
|
1731
|
-
data: {
|
|
1752
|
+
data: {
|
|
1753
|
+
result?: string;
|
|
1754
|
+
usage?: TurnUsage;
|
|
1755
|
+
cost?: TurnCost;
|
|
1756
|
+
};
|
|
1732
1757
|
}
|
|
1733
1758
|
| {
|
|
1734
1759
|
/**
|
|
@@ -1796,7 +1821,7 @@ export type SessionMode = "chat" | "task";
|
|
|
1796
1821
|
|
|
1797
1822
|
/**
|
|
1798
1823
|
* Why the session exists. `"eval"` is regression traffic (`defineEval` /
|
|
1799
|
-
* `agent-
|
|
1824
|
+
* `agent-sdk eval` / playground Evals) and is excluded from live A/B
|
|
1800
1825
|
* enrollment. Default `"live"`.
|
|
1801
1826
|
*/
|
|
1802
1827
|
export type SessionPurpose = "live" | "eval";
|
|
@@ -2328,12 +2353,6 @@ export interface ChannelDeleteRouteSpec<
|
|
|
2328
2353
|
handler: ChannelRouteHandler;
|
|
2329
2354
|
}
|
|
2330
2355
|
|
|
2331
|
-
/** @deprecated Prefer {@link ChannelGetRouteSpec} / {@link ChannelBodyRouteSpec}. */
|
|
2332
|
-
export type ChannelRouteSpec =
|
|
2333
|
-
| ChannelGetRouteSpec
|
|
2334
|
-
| ChannelBodyRouteSpec
|
|
2335
|
-
| ChannelDeleteRouteSpec;
|
|
2336
|
-
|
|
2337
2356
|
export interface ChannelRoute {
|
|
2338
2357
|
method: RouteMethod;
|
|
2339
2358
|
path: string;
|
|
@@ -2359,8 +2378,15 @@ export interface ChannelEventContext<TState = JsonValue> {
|
|
|
2359
2378
|
setContinuationToken(token: string | null): Promise<void>;
|
|
2360
2379
|
}
|
|
2361
2380
|
|
|
2381
|
+
/** Per-event session context shared by channel `events` handlers and hooks. */
|
|
2362
2382
|
export interface SessionContext {
|
|
2363
2383
|
session: SessionInfo;
|
|
2384
|
+
/**
|
|
2385
|
+
* Shared host services (MCP / GitHub / Slack / kv / files). Same as
|
|
2386
|
+
* tool `ctx.host`. `files` and `otel` are bound to this session, so a
|
|
2387
|
+
* relative path cannot read another session's files.
|
|
2388
|
+
*/
|
|
2389
|
+
host: HostContext;
|
|
2364
2390
|
}
|
|
2365
2391
|
|
|
2366
2392
|
export type ChannelEventHandler<
|
|
@@ -2463,7 +2489,7 @@ export interface ChannelStartArgs {
|
|
|
2463
2489
|
|
|
2464
2490
|
/**
|
|
2465
2491
|
* Descriptive metadata a channel pack attaches for tooling. Read by
|
|
2466
|
-
* discovery / `projectInfo` and CLI helpers (e.g. `agent-
|
|
2492
|
+
* discovery / `projectInfo` and CLI helpers (e.g. `agent-sdk github
|
|
2467
2493
|
* forward`) — it never affects routing or dispatch.
|
|
2468
2494
|
*/
|
|
2469
2495
|
export interface ChannelMeta {
|
|
@@ -2479,6 +2505,16 @@ export interface ChannelMeta {
|
|
|
2479
2505
|
* to dispatch on. Used by `--cursor-events` to subscribe `provider: "origin"`.
|
|
2480
2506
|
*/
|
|
2481
2507
|
originWebhookEvents?: readonly string[];
|
|
2508
|
+
/**
|
|
2509
|
+
* For GitLab webhook packs: the `object_kind`s this channel is wired to
|
|
2510
|
+
* dispatch on (`merge_request`, `note`, `push`, `pipeline`, `tag_push`).
|
|
2511
|
+
*/
|
|
2512
|
+
gitlabWebhookEvents?: readonly string[];
|
|
2513
|
+
/**
|
|
2514
|
+
* For Bitbucket webhook packs: the event keys this channel is wired to
|
|
2515
|
+
* dispatch on, in the Cloud vocabulary (`pullrequest:created`, …).
|
|
2516
|
+
*/
|
|
2517
|
+
bitbucketWebhookEvents?: readonly string[];
|
|
2482
2518
|
/**
|
|
2483
2519
|
* For deployments packs: the factory event types this channel is wired
|
|
2484
2520
|
* to dispatch on. Extracted into the deploy manifest as `eventTypes`.
|
|
@@ -2562,22 +2598,15 @@ export type HttpChannelDefinition = HttpChannelConfig &
|
|
|
2562
2598
|
// Hooks (agent/hooks/*.ts)
|
|
2563
2599
|
// ============================================================================
|
|
2564
2600
|
|
|
2565
|
-
export interface HookContext {
|
|
2601
|
+
export interface HookContext extends SessionContext {
|
|
2566
2602
|
agent: { name: string };
|
|
2567
2603
|
channel: { id: string; continuationToken: string | null };
|
|
2568
|
-
session: SessionInfo;
|
|
2569
2604
|
/**
|
|
2570
2605
|
* Absolute path of the agent's durable state root (shared across every
|
|
2571
2606
|
* session of this agent). Hooks that maintain derived state (e.g. the
|
|
2572
2607
|
* memory journal) write here.
|
|
2573
2608
|
*/
|
|
2574
2609
|
stateRoot: string;
|
|
2575
|
-
/**
|
|
2576
|
-
* Shared host services (MCP / GitHub / Slack / kv / files). Same as
|
|
2577
|
-
* tool `ctx.host`. `files` is bound to this hook's session, so a
|
|
2578
|
-
* relative path cannot read another session's files.
|
|
2579
|
-
*/
|
|
2580
|
-
host: HostContext;
|
|
2581
2610
|
/**
|
|
2582
2611
|
* Durable artifacts, bound to this hook's session: `tag` auto-fills
|
|
2583
2612
|
* `sessionId` (and `turnId` when known).
|
|
@@ -2645,6 +2674,38 @@ export interface ArtifactsConfig {
|
|
|
2645
2674
|
export type ArtifactsDefinition = ArtifactsConfig &
|
|
2646
2675
|
BrandedDefinition<"artifacts">;
|
|
2647
2676
|
|
|
2677
|
+
// ============================================================================
|
|
2678
|
+
// Result (agent/result.ts)
|
|
2679
|
+
// ============================================================================
|
|
2680
|
+
|
|
2681
|
+
/**
|
|
2682
|
+
* Host context passed to {@link ResultConfig.commit}. Same services as a
|
|
2683
|
+
* server tool, without a tool call id.
|
|
2684
|
+
*/
|
|
2685
|
+
export interface ResultContext {
|
|
2686
|
+
session: SessionInfo;
|
|
2687
|
+
host: HostContext;
|
|
2688
|
+
artifacts: ArtifactsApi;
|
|
2689
|
+
stateRoot: string;
|
|
2690
|
+
workspaceDir: string;
|
|
2691
|
+
/** Full assistant text for the turn. */
|
|
2692
|
+
text: string;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* Input to `defineResult` (authored at `agent/result.ts`).
|
|
2697
|
+
* Parse `ctx.text` in `commit`. Throw to fail the turn.
|
|
2698
|
+
*/
|
|
2699
|
+
export interface ResultConfig {
|
|
2700
|
+
/**
|
|
2701
|
+
* Host actuation after the model finishes, before `turn.completed`.
|
|
2702
|
+
* Throw to fail the turn. A dry-run session skips this callback.
|
|
2703
|
+
*/
|
|
2704
|
+
commit: (ctx: ResultContext) => void | Promise<void>;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
export type ResultDefinition = ResultConfig & BrandedDefinition<"result">;
|
|
2708
|
+
|
|
2648
2709
|
/** Who tagged an artifact: host code, or the model via `tag_artifact`. */
|
|
2649
2710
|
export type ArtifactSource = "host" | "model";
|
|
2650
2711
|
|
|
@@ -3036,6 +3097,8 @@ export interface DiscoveredHook {
|
|
|
3036
3097
|
/** Live A/B metrics experiment (`agent/ab.ts` or `agent/ab/<name>.ts`). */
|
|
3037
3098
|
export interface DiscoveredAB {
|
|
3038
3099
|
name: string;
|
|
3100
|
+
/** File stem the experiment was loaded from (`ab` or a path under `ab/`). */
|
|
3101
|
+
source?: string;
|
|
3039
3102
|
/** Branded `defineAB({ ... })` config (see `@cursor/july/ab`). */
|
|
3040
3103
|
definition: BrandedDefinition<"ab">;
|
|
3041
3104
|
}
|
|
@@ -3086,8 +3149,8 @@ export interface ResolvedAgent {
|
|
|
3086
3149
|
tools: DiscoveredTool[];
|
|
3087
3150
|
skills: DiscoveredSkill[];
|
|
3088
3151
|
/**
|
|
3089
|
-
* Mounted `agent/extensions/`. Their
|
|
3090
|
-
* into
|
|
3152
|
+
* Mounted `agent/extensions/`. Their contributions are already merged
|
|
3153
|
+
* into the agent and project lists; this records provenance.
|
|
3091
3154
|
*/
|
|
3092
3155
|
extensions?: DiscoveredExtension[];
|
|
3093
3156
|
connections: DiscoveredConnection[];
|
|
@@ -3121,6 +3184,8 @@ export interface AgentProject {
|
|
|
3121
3184
|
storage?: StorageDefinition;
|
|
3122
3185
|
/** Optional `agent/artifacts.ts` (`defineArtifacts`). */
|
|
3123
3186
|
artifacts?: ArtifactsDefinition;
|
|
3187
|
+
/** Optional `agent/result.ts` (`defineResult`). */
|
|
3188
|
+
result?: ResultDefinition;
|
|
3124
3189
|
/** Optional `agent/otel.ts` (`defineOtel`). */
|
|
3125
3190
|
otel?: OtelDefinition;
|
|
3126
3191
|
diagnostics: Diagnostic[];
|
|
@@ -3203,6 +3268,10 @@ export interface AgentProjectInfo {
|
|
|
3203
3268
|
githubWebhookEvents?: readonly string[];
|
|
3204
3269
|
/** Origin webhook event types the channel dispatches on, when declared. */
|
|
3205
3270
|
originWebhookEvents?: readonly string[];
|
|
3271
|
+
/** GitLab `object_kind`s the channel dispatches on, when declared. */
|
|
3272
|
+
gitlabWebhookEvents?: readonly string[];
|
|
3273
|
+
/** Bitbucket event keys (Cloud vocabulary) the channel dispatches on. */
|
|
3274
|
+
bitbucketWebhookEvents?: readonly string[];
|
|
3206
3275
|
/** Factory deployment event types the channel dispatches on, when declared. */
|
|
3207
3276
|
deploymentEventTypes?: readonly string[];
|
|
3208
3277
|
/** Slack channels watched for posts (opt-in channel watch), when declared. */
|
|
@@ -3223,6 +3292,8 @@ export interface AgentProjectInfo {
|
|
|
3223
3292
|
otel?: { serviceName?: string; enabled: true };
|
|
3224
3293
|
/** Declared artifact kinds from `agent/artifacts.ts`, when authored. */
|
|
3225
3294
|
artifacts?: { kinds: string[]; agentTool: boolean; max: number };
|
|
3295
|
+
/** Present when `agent/result.ts` (`defineResult`) is authored. */
|
|
3296
|
+
result?: true;
|
|
3226
3297
|
diagnostics: Diagnostic[];
|
|
3227
3298
|
}
|
|
3228
3299
|
|
|
@@ -3350,7 +3421,7 @@ export interface ServeOptions {
|
|
|
3350
3421
|
/**
|
|
3351
3422
|
* Cursor API key for the SDK runner and Cursor account MCP connections.
|
|
3352
3423
|
* When omitted, falls back to `CURSOR_API_KEY`, then to the credential
|
|
3353
|
-
* stored by `agent-
|
|
3424
|
+
* stored by `agent-sdk login`.
|
|
3354
3425
|
*/
|
|
3355
3426
|
apiKey?: string;
|
|
3356
3427
|
/** Run schedules on their cron cadence. Defaults to `!dev`. */
|
|
@@ -3435,7 +3506,7 @@ export interface ServeOptions {
|
|
|
3435
3506
|
* GitHub and Origin subscriptions are registered independently.
|
|
3436
3507
|
* The stream is read as the host's Cursor user, so this requires a signed-in
|
|
3437
3508
|
* host: `serve` throws when no key resolves from `apiKey` here,
|
|
3438
|
-
* {@link ServeOptions.apiKey}, `CURSOR_API_KEY`, or `agent-
|
|
3509
|
+
* {@link ServeOptions.apiKey}, `CURSOR_API_KEY`, or `agent-sdk login`.
|
|
3439
3510
|
*/
|
|
3440
3511
|
cursorEvents?: {
|
|
3441
3512
|
repos: string[];
|
package/dist/continuation.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public continuation-identity surface for `@cursor/july`.
|
|
3
|
-
*
|
|
4
|
-
* Omitted `continuation` on a channel constructor stays `/v1` (engine
|
|
5
|
-
* minting). Deploy onto the v2 control plane with a root architecture
|
|
6
|
-
* flag; omitted channels then inherit the kind `/v2` default:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* export default defineAgent({
|
|
10
|
-
* architecture: "v2",
|
|
11
|
-
* });
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Per-channel selectors still override type (`"github.issue/v2"`,
|
|
15
|
-
* `"github.none/v2"`). Other `/v2` selectors: `"slack.thread/v2"`,
|
|
16
|
-
* `"origin.pr/v2"`, `"deployments.deployment/v2"`, `"none/v2"`.
|
|
17
|
-
*/
|
|
18
|
-
export type { ContinuationBuiltin, ContinuationClaim, ContinuationIdentity, ContinuationProtocolVersion, ContinuationSelector, ConversationType, MailboxContinuation, ParsedContinuation, } from "./internal/continuation-identity.js";
|
|
19
|
-
export { BUILTINS, bindMailboxContinuationSend, builtinForType, CONTINUATION_SELECTORS, continuationSource, defaultContinuationSelector, extractContinuation, formatConversationKey, handshakeContinuation, isContinuationSelector, isV2DurableContinuationKey, mintClaim, newEvtKey, normalizeIdentity, parseContinuationSelector, resolveContinuation, resolveV2Key, stampMailboxContinuation, V2EngineError, } from "./internal/continuation-identity.js";
|
|
20
|
-
//# sourceMappingURL=continuation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuation.d.ts","sourceRoot":"","sources":["../src/continuation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,QAAQ,EACR,2BAA2B,EAC3B,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,EACxB,aAAa,GACd,MAAM,qCAAqC,CAAC"}
|
package/dist/continuation.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public continuation-identity surface for `@cursor/july`.
|
|
3
|
-
*
|
|
4
|
-
* Omitted `continuation` on a channel constructor stays `/v1` (engine
|
|
5
|
-
* minting). Deploy onto the v2 control plane with a root architecture
|
|
6
|
-
* flag; omitted channels then inherit the kind `/v2` default:
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* export default defineAgent({
|
|
10
|
-
* architecture: "v2",
|
|
11
|
-
* });
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Per-channel selectors still override type (`"github.issue/v2"`,
|
|
15
|
-
* `"github.none/v2"`). Other `/v2` selectors: `"slack.thread/v2"`,
|
|
16
|
-
* `"origin.pr/v2"`, `"deployments.deployment/v2"`, `"none/v2"`.
|
|
17
|
-
*/
|
|
18
|
-
export { BUILTINS, bindMailboxContinuationSend, builtinForType, CONTINUATION_SELECTORS, continuationSource, defaultContinuationSelector, extractContinuation, formatConversationKey, handshakeContinuation, isContinuationSelector, isV2DurableContinuationKey, mintClaim, newEvtKey, normalizeIdentity, parseContinuationSelector, resolveContinuation, resolveV2Key, stampMailboxContinuation, V2EngineError, } from "./internal/continuation-identity.js";
|