@cursor/july 0.1.102 → 0.1.104
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/change-monitors/change-monitors-channel.d.ts +5 -0
- package/dist/channels/change-monitors/change-monitors-channel.d.ts.map +1 -0
- package/dist/channels/change-monitors/change-monitors-channel.js +41 -0
- package/dist/channels/change-monitors/index.d.ts +4 -0
- package/dist/channels/change-monitors/index.d.ts.map +1 -0
- package/dist/channels/change-monitors/index.js +2 -0
- package/dist/channels/change-monitors/types.d.ts +39 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/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/defaults.d.ts.map +1 -1
- package/dist/channels/github/defaults.js +4 -0
- 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/progress.d.ts +22 -0
- package/dist/channels/github/progress.d.ts.map +1 -1
- package/dist/channels/github/progress.js +32 -5
- 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/issues/index.d.ts +4 -0
- package/dist/channels/issues/index.d.ts.map +1 -0
- package/dist/channels/issues/index.js +2 -0
- package/dist/channels/issues/issues-channel.d.ts +5 -0
- package/dist/channels/issues/issues-channel.d.ts.map +1 -0
- package/dist/channels/issues/issues-channel.js +37 -0
- package/dist/channels/issues/types.d.ts +33 -0
- package/dist/channels/issues/types.d.ts.map +1 -0
- package/dist/channels/issues/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.DbMWUyGb.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.Bqsulb9K.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.ifxv-cJV.js → VPLocalSearchBox.DcNeTh9o.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DWCwM6p-.js → theme.DMjhY3gl.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.c0gdGJ-D.js} +1 -1
- package/dist/docs/assets/{guides_github.md.BtPr9GaP.lean.js → guides_github.md.c0gdGJ-D.lean.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.DBGcaB7m.js} +2 -2
- package/dist/docs/assets/{reference_channels.md.Cd2f2iyV.lean.js → reference_channels.md.DBGcaB7m.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/filesystem.md +376 -0
- 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 +5 -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 +907 -262
- package/dist/docs/llms.txt +3 -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 +38 -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/filesystem.d.ts +440 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1694 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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 +18 -2
- package/dist/internal/continuation-channel.d.ts.map +1 -1
- package/dist/internal/continuation-channel.js +67 -5
- package/dist/internal/continuation-identity.d.ts +24 -17
- package/dist/internal/continuation-identity.d.ts.map +1 -1
- package/dist/internal/continuation-identity.js +246 -32
- 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 +141 -120
- 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 +10 -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/factory-resource-channel.d.ts +33 -0
- package/dist/internal/factory-resource-channel.d.ts.map +1 -0
- package/dist/internal/factory-resource-channel.js +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +175 -0
- package/dist/internal/filesystem/format.d.ts +28 -0
- package/dist/internal/filesystem/format.d.ts.map +1 -0
- package/dist/internal/filesystem/format.js +213 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +212 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +618 -0
- package/dist/internal/filesystem/walk.d.ts +74 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +339 -0
- 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 +104 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +309 -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 +258 -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 +1 -1
- package/dist/internal/sdk-runner.d.ts.map +1 -1
- package/dist/internal/sdk-runner.js +6 -7
- 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 +48 -11
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +507 -115
- 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/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -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-8YiozU89.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 +141 -26
- package/dist/types.d.ts.map +1 -1
- package/docs/README.md +2 -2
- package/docs/concepts.md +2 -4
- package/docs/design/filesystem.md +376 -0
- 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 +5 -1
- package/docs/guides/opentelemetry.md +41 -17
- package/docs/reference/agent-config.md +6 -10
- package/docs/reference/channels.md +38 -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 +42 -9
- 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/change-monitors/change-monitors-channel.ts +62 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +44 -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/defaults.ts +4 -0
- 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/progress.ts +76 -10
- 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/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +51 -0
- package/src/channels/issues/types.ts +41 -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/filesystem.ts +2074 -0
- package/src/index.ts +48 -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 +102 -4
- package/src/internal/continuation-identity.ts +338 -35
- 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 +181 -136
- 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 +10 -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/factory-resource-channel.ts +122 -0
- package/src/internal/filesystem/errors.ts +220 -0
- package/src/internal/filesystem/format.ts +276 -0
- package/src/internal/filesystem/merge.ts +195 -0
- package/src/internal/filesystem/scratch.ts +255 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +821 -0
- package/src/internal/filesystem/walk.ts +369 -0
- package/src/internal/framework-file-storage.ts +8 -8
- package/src/internal/github-fanout.ts +1 -1
- package/src/internal/guest-network.ts +389 -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 +393 -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 +7 -7
- package/src/internal/server.ts +153 -44
- package/src/internal/session-cost.ts +3 -3
- package/src/internal/session-engine.ts +621 -103
- 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/factory-resource-fixtures.ts +85 -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 +154 -37
- 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/{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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default dispatch decisions for the Bitbucket channel: turn auth derived
|
|
3
|
+
* from the delivery's actor, the title / message a turn starts with, and
|
|
4
|
+
* which pull-request events dispatch when no `onPullRequest` hook exists.
|
|
5
|
+
*/
|
|
6
|
+
import type { AuthContext } from "../../types.js";
|
|
7
|
+
import type { BitbucketEventContext, BitbucketPullRequestEvent, BitbucketTurnDispatch } from "./types.js";
|
|
8
|
+
type DispatchContext = Omit<BitbucketEventContext, "host" | "artifacts" | "bitbucket" | "send">;
|
|
9
|
+
/**
|
|
10
|
+
* Derive the turn's auth from the actor that triggered the delivery — the
|
|
11
|
+
* standard `{ auth: defaultBitbucketAuth(ctx) }` dispatch from an inbound
|
|
12
|
+
* hook. The subscriber's Cursor identity is not the turn principal (same
|
|
13
|
+
* pattern as `defaultGitHubAuth` / `defaultGitLabAuth`).
|
|
14
|
+
*/
|
|
15
|
+
export declare function defaultBitbucketAuth(ctx: DispatchContext): AuthContext;
|
|
16
|
+
export declare function defaultBitbucketTitle(ctx: Pick<BitbucketEventContext, "repository" | "pullRequestId" | "eventType">): string;
|
|
17
|
+
export declare function defaultBitbucketPullRequestMessage(ctx: DispatchContext, pullRequest: BitbucketPullRequestEvent): string;
|
|
18
|
+
/**
|
|
19
|
+
* Default gate when no `onPullRequest` hook is declared: a new pull request,
|
|
20
|
+
* or an `updated` that pushed commits (Data Center `pr:from_ref_updated`
|
|
21
|
+
* carries `previousFromHash`; Cloud `pullrequest:updated` has no diff, so
|
|
22
|
+
* only a changed head dispatches), starts a turn as the actor.
|
|
23
|
+
*/
|
|
24
|
+
export declare function defaultBitbucketPullRequestDispatch(ctx: DispatchContext, pullRequest: BitbucketPullRequestEvent): BitbucketTurnDispatch | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/channels/bitbucket/defaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,KAAK,eAAe,GAAG,IAAI,CACzB,qBAAqB,EACrB,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAC5C,CAAC;AAeF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,eAAe,GAAG,WAAW,CAuBtE;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,eAAe,GAAG,WAAW,CAAC,GAC7E,MAAM,CAIR;AAED,wBAAgB,kCAAkC,CAChD,GAAG,EAAE,eAAe,EACpB,WAAW,EAAE,yBAAyB,GACrC,MAAM,CAeR;AAED;;;;;GAKG;AACH,wBAAgB,mCAAmC,CACjD,GAAG,EAAE,eAAe,EACpB,WAAW,EAAE,yBAAyB,GACrC,qBAAqB,GAAG,IAAI,CAU9B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default dispatch decisions for the Bitbucket channel: turn auth derived
|
|
3
|
+
* from the delivery's actor, the title / message a turn starts with, and
|
|
4
|
+
* which pull-request events dispatch when no `onPullRequest` hook exists.
|
|
5
|
+
*/
|
|
6
|
+
function issuerHost(ctx) {
|
|
7
|
+
if (ctx.repository.htmlUrl !== undefined) {
|
|
8
|
+
try {
|
|
9
|
+
return new URL(ctx.repository.htmlUrl).host;
|
|
10
|
+
}
|
|
11
|
+
catch (_a) {
|
|
12
|
+
// fall through to the dialect default
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return ctx.repository.dialect === "cloud"
|
|
16
|
+
? "bitbucket.org"
|
|
17
|
+
: "bitbucket-data-center";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Derive the turn's auth from the actor that triggered the delivery — the
|
|
21
|
+
* standard `{ auth: defaultBitbucketAuth(ctx) }` dispatch from an inbound
|
|
22
|
+
* hook. The subscriber's Cursor identity is not the turn principal (same
|
|
23
|
+
* pattern as `defaultGitHubAuth` / `defaultGitLabAuth`).
|
|
24
|
+
*/
|
|
25
|
+
export function defaultBitbucketAuth(ctx) {
|
|
26
|
+
const sender = ctx.sender;
|
|
27
|
+
return {
|
|
28
|
+
authenticator: "bitbucket-webhook",
|
|
29
|
+
principalId: sender === undefined ? "bitbucket" : sender.id,
|
|
30
|
+
principalType: "user",
|
|
31
|
+
attributes: Object.assign(Object.assign(Object.assign({ conversation_kind: ctx.pullRequestId === undefined ? ctx.eventType : "pull_request", repo: ctx.repository.fullName, dialect: ctx.repository.dialect }, (ctx.deliveryId === undefined ? {} : { delivery_id: ctx.deliveryId })), (sender === undefined
|
|
32
|
+
? {}
|
|
33
|
+
: Object.assign({ subject: sender.id }, (sender.username === undefined
|
|
34
|
+
? {}
|
|
35
|
+
: { username: sender.username })))), { issuer: `bitbucket:${issuerHost(ctx)}` }),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function defaultBitbucketTitle(ctx) {
|
|
39
|
+
return ctx.pullRequestId === undefined
|
|
40
|
+
? `Bitbucket ${ctx.repository.fullName} ${ctx.eventType}`
|
|
41
|
+
: `Bitbucket ${ctx.repository.fullName}#${ctx.pullRequestId}`;
|
|
42
|
+
}
|
|
43
|
+
export function defaultBitbucketPullRequestMessage(ctx, pullRequest) {
|
|
44
|
+
const head = pullRequest.sourceBranch !== undefined && pullRequest.headSha !== undefined
|
|
45
|
+
? `Head: ${pullRequest.sourceBranch} (${pullRequest.headSha})`
|
|
46
|
+
: undefined;
|
|
47
|
+
return [
|
|
48
|
+
`Bitbucket pull request trigger: ${ctx.repository.fullName}#${pullRequest.id}`,
|
|
49
|
+
`Action: ${pullRequest.action}`,
|
|
50
|
+
...(pullRequest.htmlUrl === undefined
|
|
51
|
+
? []
|
|
52
|
+
: [`URL: ${pullRequest.htmlUrl}`]),
|
|
53
|
+
...(pullRequest.title === undefined ? [] : [`Title: ${pullRequest.title}`]),
|
|
54
|
+
...(head === undefined ? [] : [head]),
|
|
55
|
+
"Handle this pull request event.",
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Default gate when no `onPullRequest` hook is declared: a new pull request,
|
|
60
|
+
* or an `updated` that pushed commits (Data Center `pr:from_ref_updated`
|
|
61
|
+
* carries `previousFromHash`; Cloud `pullrequest:updated` has no diff, so
|
|
62
|
+
* only a changed head dispatches), starts a turn as the actor.
|
|
63
|
+
*/
|
|
64
|
+
export function defaultBitbucketPullRequestDispatch(ctx, pullRequest) {
|
|
65
|
+
const dispatches = pullRequest.action === "created" ||
|
|
66
|
+
(pullRequest.action === "updated" &&
|
|
67
|
+
pullRequest.previousHeadSha !== undefined &&
|
|
68
|
+
pullRequest.previousHeadSha !== pullRequest.headSha);
|
|
69
|
+
if (!dispatches) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return { auth: defaultBitbucketAuth(ctx) };
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** {@link ChannelMeta.kind} value used by {@link bitbucketChannel}. */
|
|
2
|
+
export declare const BITBUCKET_CHANNEL_KIND = "bitbucket";
|
|
3
|
+
/**
|
|
4
|
+
* Data Center `X-Event-Key`s → the Cloud vocabulary the channel dispatches
|
|
5
|
+
* on. Pure copy of the backend ingress normalizer so local HTTP deliveries
|
|
6
|
+
* (which arrive raw) and hosted admission (already normalized) agree.
|
|
7
|
+
*/
|
|
8
|
+
export declare const BITBUCKET_DATA_CENTER_EVENT_KEYS: Readonly<Record<string, string>>;
|
|
9
|
+
/** `pr:opened` → `pullrequest:created`; Cloud keys pass through unchanged. */
|
|
10
|
+
export declare function normalizeBitbucketEventKey(eventKey: string): string;
|
|
11
|
+
/** Cloud pull-request event keys, grouped by the hook that receives them. */
|
|
12
|
+
export declare const BITBUCKET_PULL_REQUEST_EVENTS: readonly ["pullrequest:created", "pullrequest:updated", "pullrequest:approved", "pullrequest:unapproved", "pullrequest:changes_request_created", "pullrequest:fulfilled", "pullrequest:rejected"];
|
|
13
|
+
export declare const BITBUCKET_COMMENT_EVENTS: readonly ["pullrequest:comment_created"];
|
|
14
|
+
export declare const BITBUCKET_PUSH_EVENTS: readonly ["repo:push"];
|
|
15
|
+
export interface BitbucketWebhookEventOptions {
|
|
16
|
+
webhookEvents?: readonly string[];
|
|
17
|
+
onPullRequest?: unknown;
|
|
18
|
+
onPullRequestComment?: unknown;
|
|
19
|
+
onPush?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export declare function deriveBitbucketWebhookEvents(options: BitbucketWebhookEventOptions): string[];
|
|
22
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/channels/bitbucket/events.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CACrD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWvB,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED,6EAA6E;AAC7E,eAAO,MAAM,6BAA6B,YACxC,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,qCAAqC,EACrC,uBAAuB,EACvB,sBAAsB,CACd,CAAC;AAEX,eAAO,MAAM,wBAAwB,YACnC,6BAA6B,CACrB,CAAC;AACX,eAAO,MAAM,qBAAqB,YAAI,WAAW,CAAU,CAAC;AAe5D,MAAM,WAAW,4BAA4B;IAC3C,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,4BAA4B,GACpC,MAAM,EAAE,CAiBV"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** {@link ChannelMeta.kind} value used by {@link bitbucketChannel}. */
|
|
2
|
+
export const BITBUCKET_CHANNEL_KIND = "bitbucket";
|
|
3
|
+
/**
|
|
4
|
+
* Data Center `X-Event-Key`s → the Cloud vocabulary the channel dispatches
|
|
5
|
+
* on. Pure copy of the backend ingress normalizer so local HTTP deliveries
|
|
6
|
+
* (which arrive raw) and hosted admission (already normalized) agree.
|
|
7
|
+
*/
|
|
8
|
+
export const BITBUCKET_DATA_CENTER_EVENT_KEYS = {
|
|
9
|
+
"pr:opened": "pullrequest:created",
|
|
10
|
+
"pr:modified": "pullrequest:updated",
|
|
11
|
+
"pr:from_ref_updated": "pullrequest:updated",
|
|
12
|
+
"pr:merged": "pullrequest:fulfilled",
|
|
13
|
+
"pr:declined": "pullrequest:rejected",
|
|
14
|
+
"pr:comment:added": "pullrequest:comment_created",
|
|
15
|
+
"pr:reviewer:approved": "pullrequest:approved",
|
|
16
|
+
"pr:reviewer:needs_work": "pullrequest:changes_request_created",
|
|
17
|
+
"repo:refs_changed": "repo:push",
|
|
18
|
+
};
|
|
19
|
+
/** `pr:opened` → `pullrequest:created`; Cloud keys pass through unchanged. */
|
|
20
|
+
export function normalizeBitbucketEventKey(eventKey) {
|
|
21
|
+
var _a;
|
|
22
|
+
const trimmed = eventKey.trim();
|
|
23
|
+
return (_a = BITBUCKET_DATA_CENTER_EVENT_KEYS[trimmed]) !== null && _a !== void 0 ? _a : trimmed;
|
|
24
|
+
}
|
|
25
|
+
/** Cloud pull-request event keys, grouped by the hook that receives them. */
|
|
26
|
+
export const BITBUCKET_PULL_REQUEST_EVENTS = [
|
|
27
|
+
"pullrequest:created",
|
|
28
|
+
"pullrequest:updated",
|
|
29
|
+
"pullrequest:approved",
|
|
30
|
+
"pullrequest:unapproved",
|
|
31
|
+
"pullrequest:changes_request_created",
|
|
32
|
+
"pullrequest:fulfilled",
|
|
33
|
+
"pullrequest:rejected",
|
|
34
|
+
];
|
|
35
|
+
export const BITBUCKET_COMMENT_EVENTS = [
|
|
36
|
+
"pullrequest:comment_created",
|
|
37
|
+
];
|
|
38
|
+
export const BITBUCKET_PUSH_EVENTS = ["repo:push"];
|
|
39
|
+
/**
|
|
40
|
+
* `pullrequest:created` / `:updated` are always declared: they are the
|
|
41
|
+
* default dispatch when no `onPullRequest` hook exists. Other hooks add
|
|
42
|
+
* their event keys.
|
|
43
|
+
*/
|
|
44
|
+
const HOOK_EVENTS = [
|
|
45
|
+
["onPullRequest", BITBUCKET_PULL_REQUEST_EVENTS],
|
|
46
|
+
["onPullRequestComment", BITBUCKET_COMMENT_EVENTS],
|
|
47
|
+
["onPush", BITBUCKET_PUSH_EVENTS],
|
|
48
|
+
];
|
|
49
|
+
export function deriveBitbucketWebhookEvents(options) {
|
|
50
|
+
if (options.webhookEvents !== undefined) {
|
|
51
|
+
return [
|
|
52
|
+
...new Set(options.webhookEvents
|
|
53
|
+
.map((event) => normalizeBitbucketEventKey(event))
|
|
54
|
+
.filter(Boolean)),
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
const events = ["pullrequest:created", "pullrequest:updated"];
|
|
58
|
+
for (const [hook, hookEvents] of HOOK_EVENTS) {
|
|
59
|
+
if (options[hook] !== undefined) {
|
|
60
|
+
events.push(...hookEvents);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [...new Set(events)];
|
|
64
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitbucket webhook channel pack for agent-serve (Cloud and Data Center).
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { bitbucketChannel, defaultBitbucketAuth } from "@cursor/july/channels/bitbucket";
|
|
6
|
+
*
|
|
7
|
+
* export default bitbucketChannel({
|
|
8
|
+
* webhookSecret: () => process.env.BITBUCKET_WEBHOOK_SECRET,
|
|
9
|
+
* onPullRequest: (ctx) => ({ auth: defaultBitbucketAuth(ctx) }),
|
|
10
|
+
* onPullRequestComment: (ctx) => ({ auth: defaultBitbucketAuth(ctx) }),
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Direct webhook mode verifies the hook's `X-Hub-Signature` (`sha256=` HMAC
|
|
15
|
+
* over the raw body) against {@link BitbucketChannelOptions.webhookSecret}
|
|
16
|
+
* (or `BITBUCKET_WEBHOOK_SECRET`). Data Center `X-Event-Key`s (`pr:opened`)
|
|
17
|
+
* are normalized to the Cloud vocabulary (`pullrequest:created`) before
|
|
18
|
+
* hooks run, and payload fields from either dialect land on one shape.
|
|
19
|
+
* Hosted deployments receive deliveries the Cursor backend already verified
|
|
20
|
+
* and normalized. The turn principal is `bitbucket-webhook` plus the
|
|
21
|
+
* Bitbucket actor — not the Cursor subscriber.
|
|
22
|
+
*/
|
|
23
|
+
export * from "./api.js";
|
|
24
|
+
export { type BitbucketHandle, bitbucketCommentFromPayload, bitbucketDialectOf, bitbucketPullRequestFromPayload, bitbucketPullRequestUrl, bitbucketPushFromPayload, bitbucketRepositoryFromPayload, bitbucketUser, buildBitbucketBinding, } from "./binding.js";
|
|
25
|
+
export * from "./bitbucket-channel.js";
|
|
26
|
+
export * from "./bitbucket-webhook.js";
|
|
27
|
+
export * from "./checks.js";
|
|
28
|
+
export { CURSOR_BITBUCKET_MAX_REPOS, type CursorBitbucketRepoScope, parseCursorBitbucketRepoScope, resolveCursorBitbucketProxyUrl, } from "./cursor-account.js";
|
|
29
|
+
export * from "./defaults.js";
|
|
30
|
+
export * from "./events.js";
|
|
31
|
+
export * from "./replay.js";
|
|
32
|
+
export * from "./state.js";
|
|
33
|
+
export * from "./types.js";
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/channels/bitbucket/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,+BAA+B,EAC/B,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,aAAa,EACb,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitbucket webhook channel pack for agent-serve (Cloud and Data Center).
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { bitbucketChannel, defaultBitbucketAuth } from "@cursor/july/channels/bitbucket";
|
|
6
|
+
*
|
|
7
|
+
* export default bitbucketChannel({
|
|
8
|
+
* webhookSecret: () => process.env.BITBUCKET_WEBHOOK_SECRET,
|
|
9
|
+
* onPullRequest: (ctx) => ({ auth: defaultBitbucketAuth(ctx) }),
|
|
10
|
+
* onPullRequestComment: (ctx) => ({ auth: defaultBitbucketAuth(ctx) }),
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Direct webhook mode verifies the hook's `X-Hub-Signature` (`sha256=` HMAC
|
|
15
|
+
* over the raw body) against {@link BitbucketChannelOptions.webhookSecret}
|
|
16
|
+
* (or `BITBUCKET_WEBHOOK_SECRET`). Data Center `X-Event-Key`s (`pr:opened`)
|
|
17
|
+
* are normalized to the Cloud vocabulary (`pullrequest:created`) before
|
|
18
|
+
* hooks run, and payload fields from either dialect land on one shape.
|
|
19
|
+
* Hosted deployments receive deliveries the Cursor backend already verified
|
|
20
|
+
* and normalized. The turn principal is `bitbucket-webhook` plus the
|
|
21
|
+
* Bitbucket actor — not the Cursor subscriber.
|
|
22
|
+
*/
|
|
23
|
+
export * from "./api.js";
|
|
24
|
+
export { bitbucketCommentFromPayload, bitbucketDialectOf, bitbucketPullRequestFromPayload, bitbucketPullRequestUrl, bitbucketPushFromPayload, bitbucketRepositoryFromPayload, bitbucketUser, buildBitbucketBinding, } from "./binding.js";
|
|
25
|
+
export * from "./bitbucket-channel.js";
|
|
26
|
+
export * from "./bitbucket-webhook.js";
|
|
27
|
+
export * from "./checks.js";
|
|
28
|
+
export { CURSOR_BITBUCKET_MAX_REPOS, parseCursorBitbucketRepoScope, resolveCursorBitbucketProxyUrl, } from "./cursor-account.js";
|
|
29
|
+
export * from "./defaults.js";
|
|
30
|
+
export * from "./events.js";
|
|
31
|
+
export * from "./replay.js";
|
|
32
|
+
export * from "./state.js";
|
|
33
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthesize Bitbucket webhook payloads from data you can *read* about a
|
|
3
|
+
* pull request, so `agent-sdk bitbucket replay` can exercise a
|
|
4
|
+
* `bitbucketChannel()` without admin access to the repository hook and
|
|
5
|
+
* without a tunnel.
|
|
6
|
+
*
|
|
7
|
+
* Payloads are shaped in the dialect of the pull request's host — Cloud
|
|
8
|
+
* (`pullrequest`, `repository.full_name`) or Data Center (`pullRequest`,
|
|
9
|
+
* `repository.project.key`, `eventKey`) — so the channel's dialect detection
|
|
10
|
+
* and the Data Center → Cloud event-key normalizer both run on the local
|
|
11
|
+
* loop exactly as they do for a real delivery.
|
|
12
|
+
*/
|
|
13
|
+
import type { BitbucketApiPullRequest } from "./api.js";
|
|
14
|
+
import type { BitbucketDialect, BitbucketRepositoryRef } from "./types.js";
|
|
15
|
+
/** A parsed pull request reference. */
|
|
16
|
+
export interface BitbucketPrRef {
|
|
17
|
+
dialect: BitbucketDialect;
|
|
18
|
+
/** `https://bitbucket.org` or the Data Center origin. */
|
|
19
|
+
origin: string;
|
|
20
|
+
repository: BitbucketRepositoryRef;
|
|
21
|
+
id: number;
|
|
22
|
+
/** Web URL of the pull request. */
|
|
23
|
+
url: string;
|
|
24
|
+
/** `workspace/repo#N` / `PROJECT/repo#N`. */
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Parse a Cloud PR URL (`https://bitbucket.org/<ws>/<repo>/pull-requests/N`),
|
|
29
|
+
* a Data Center PR URL (`https://<host>/projects/<KEY>/repos/<repo>/pull-requests/N`),
|
|
30
|
+
* or `workspace/repo#N` (Cloud). Returns undefined otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseBitbucketPrRef(raw: string): BitbucketPrRef | undefined;
|
|
33
|
+
/** Cloud-vocabulary event keys replay knows how to synthesize. */
|
|
34
|
+
export declare const BITBUCKET_SYNTHESIZABLE_EVENTS: readonly ["pullrequest:created", "pullrequest:updated", "pullrequest:comment_created", "repo:push"];
|
|
35
|
+
export type BitbucketSynthesizableEvent = (typeof BITBUCKET_SYNTHESIZABLE_EVENTS)[number];
|
|
36
|
+
export declare function isBitbucketSynthesizableEvent(event: string): event is BitbucketSynthesizableEvent;
|
|
37
|
+
export interface SynthesizedBitbucketEvent {
|
|
38
|
+
/** Cloud-normalized event key (`pullrequest:created`). */
|
|
39
|
+
eventType: BitbucketSynthesizableEvent;
|
|
40
|
+
/** `X-Event-Key` header value: Cloud key, or the raw Data Center key. */
|
|
41
|
+
header: string;
|
|
42
|
+
payload: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
/** Build one Bitbucket-shaped payload for `event` in the ref's dialect. */
|
|
45
|
+
export declare function synthesizeBitbucketEvent(input: {
|
|
46
|
+
/** Cloud or Data Center event key; DC keys are normalized first. */
|
|
47
|
+
event: string;
|
|
48
|
+
ref: BitbucketPrRef;
|
|
49
|
+
pullRequest: BitbucketApiPullRequest;
|
|
50
|
+
/** comment body (default `@cursor please take a look`). */
|
|
51
|
+
comment?: string;
|
|
52
|
+
}): SynthesizedBitbucketEvent | {
|
|
53
|
+
error: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Choose events to replay: explicit list (either dialect's keys), `*` for
|
|
57
|
+
* every declared, else `pullrequest:created`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function selectBitbucketReplayEvents(requested: readonly string[] | undefined, declared: readonly string[]): {
|
|
60
|
+
events: BitbucketSynthesizableEvent[];
|
|
61
|
+
unsupported: string[];
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/channels/bitbucket/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAE3E,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,sBAAsB,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAqC3E;AAwBD,kEAAkE;AAClE,eAAO,MAAM,8BAA8B,YACzC,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,WAAW,CACH,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,GACZ,KAAK,IAAI,2BAA2B,CAEtC;AAED,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,SAAS,EAAE,2BAA2B,CAAC;IACvC,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AA+JD,2EAA2E;AAC3E,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,cAAc,CAAC;IACpB,WAAW,EAAE,uBAAuB,CAAC;IACrC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,yBAAyB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CA2HhD;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACxC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B;IAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAoBlE"}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synthesize Bitbucket webhook payloads from data you can *read* about a
|
|
3
|
+
* pull request, so `agent-sdk bitbucket replay` can exercise a
|
|
4
|
+
* `bitbucketChannel()` without admin access to the repository hook and
|
|
5
|
+
* without a tunnel.
|
|
6
|
+
*
|
|
7
|
+
* Payloads are shaped in the dialect of the pull request's host — Cloud
|
|
8
|
+
* (`pullrequest`, `repository.full_name`) or Data Center (`pullRequest`,
|
|
9
|
+
* `repository.project.key`, `eventKey`) — so the channel's dialect detection
|
|
10
|
+
* and the Data Center → Cloud event-key normalizer both run on the local
|
|
11
|
+
* loop exactly as they do for a real delivery.
|
|
12
|
+
*/
|
|
13
|
+
import { normalizeBitbucketEventKey } from "./events.js";
|
|
14
|
+
/**
|
|
15
|
+
* Parse a Cloud PR URL (`https://bitbucket.org/<ws>/<repo>/pull-requests/N`),
|
|
16
|
+
* a Data Center PR URL (`https://<host>/projects/<KEY>/repos/<repo>/pull-requests/N`),
|
|
17
|
+
* or `workspace/repo#N` (Cloud). Returns undefined otherwise.
|
|
18
|
+
*/
|
|
19
|
+
export function parseBitbucketPrRef(raw) {
|
|
20
|
+
const text = raw.trim();
|
|
21
|
+
const dc = text.match(/^(https?:\/\/[^/]+)(?:\/.*?)?\/projects\/([^/]+)\/repos\/([^/]+)\/pull-requests\/(\d+)(?:[/?#].*)?$/i);
|
|
22
|
+
if (dc !== null) {
|
|
23
|
+
return build("data-center", dc[1], dc[2], dc[3], Number(dc[4]));
|
|
24
|
+
}
|
|
25
|
+
const cloud = text.match(/^(https?:\/\/[^/]+)\/([^/]+)\/([^/]+)\/pull-requests\/(\d+)(?:[/?#].*)?$/i);
|
|
26
|
+
if (cloud !== null) {
|
|
27
|
+
return build("cloud", cloud[1], cloud[2], cloud[3], Number(cloud[4]));
|
|
28
|
+
}
|
|
29
|
+
const hash = text.match(/^([\w.-]+)\/([\w.-]+)#(\d+)$/);
|
|
30
|
+
if (hash !== null) {
|
|
31
|
+
return build("cloud", "https://bitbucket.org", hash[1], hash[2], Number(hash[3]));
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
function build(dialect, origin, owner, slug, id) {
|
|
36
|
+
const fullName = `${owner}/${slug}`;
|
|
37
|
+
const htmlUrl = dialect === "cloud"
|
|
38
|
+
? `${origin}/${fullName}`
|
|
39
|
+
: `${origin}/projects/${owner}/repos/${slug}`;
|
|
40
|
+
return {
|
|
41
|
+
dialect,
|
|
42
|
+
origin,
|
|
43
|
+
repository: { dialect, fullName, owner, slug, htmlUrl },
|
|
44
|
+
id,
|
|
45
|
+
url: `${htmlUrl}/pull-requests/${id}`,
|
|
46
|
+
label: `${fullName}#${id}`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Cloud-vocabulary event keys replay knows how to synthesize. */
|
|
50
|
+
export const BITBUCKET_SYNTHESIZABLE_EVENTS = [
|
|
51
|
+
"pullrequest:created",
|
|
52
|
+
"pullrequest:updated",
|
|
53
|
+
"pullrequest:comment_created",
|
|
54
|
+
"repo:push",
|
|
55
|
+
];
|
|
56
|
+
export function isBitbucketSynthesizableEvent(event) {
|
|
57
|
+
return BITBUCKET_SYNTHESIZABLE_EVENTS.includes(event);
|
|
58
|
+
}
|
|
59
|
+
/** Cloud key → the Data Center `X-Event-Key` that normalizes to it. */
|
|
60
|
+
const DATA_CENTER_HEADER = {
|
|
61
|
+
"pullrequest:created": "pr:opened",
|
|
62
|
+
"pullrequest:updated": "pr:from_ref_updated",
|
|
63
|
+
"pullrequest:comment_created": "pr:comment:added",
|
|
64
|
+
"repo:push": "repo:refs_changed",
|
|
65
|
+
};
|
|
66
|
+
const ZERO_SHA = "0000000000000000000000000000000000000000";
|
|
67
|
+
const FALLBACK_ACTOR = {
|
|
68
|
+
id: "agent-sdk-replay",
|
|
69
|
+
username: "agent-sdk-replay",
|
|
70
|
+
displayName: "agent-sdk replay",
|
|
71
|
+
};
|
|
72
|
+
function asRecord(value) {
|
|
73
|
+
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
74
|
+
? value
|
|
75
|
+
: undefined;
|
|
76
|
+
}
|
|
77
|
+
function str(value) {
|
|
78
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
79
|
+
}
|
|
80
|
+
/** PR author from the raw REST record (Cloud `author`, DC `author.user`). */
|
|
81
|
+
function actorFromPullRequest(raw) {
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
83
|
+
const record = asRecord(raw);
|
|
84
|
+
const author = asRecord(record === null || record === void 0 ? void 0 : record.author);
|
|
85
|
+
const user = (_a = asRecord(author === null || author === void 0 ? void 0 : author.user)) !== null && _a !== void 0 ? _a : author;
|
|
86
|
+
if (user === undefined) {
|
|
87
|
+
return FALLBACK_ACTOR;
|
|
88
|
+
}
|
|
89
|
+
const id = (_c = (_b = str(user.uuid)) !== null && _b !== void 0 ? _b : str(user.account_id)) !== null && _c !== void 0 ? _c : (typeof user.id === "number" ? String(user.id) : undefined);
|
|
90
|
+
const username = (_e = (_d = str(user.nickname)) !== null && _d !== void 0 ? _d : str(user.name)) !== null && _e !== void 0 ? _e : str(user.slug);
|
|
91
|
+
const displayName = (_f = str(user.display_name)) !== null && _f !== void 0 ? _f : str(user.displayName);
|
|
92
|
+
return {
|
|
93
|
+
id: id !== null && id !== void 0 ? id : FALLBACK_ACTOR.id,
|
|
94
|
+
username: username !== null && username !== void 0 ? username : FALLBACK_ACTOR.username,
|
|
95
|
+
displayName: (_g = displayName !== null && displayName !== void 0 ? displayName : username) !== null && _g !== void 0 ? _g : FALLBACK_ACTOR.displayName,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function cloudActor(actor) {
|
|
99
|
+
return {
|
|
100
|
+
type: "user",
|
|
101
|
+
uuid: actor.id,
|
|
102
|
+
nickname: actor.username,
|
|
103
|
+
display_name: actor.displayName,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function dcActor(actor) {
|
|
107
|
+
const numeric = Number(actor.id);
|
|
108
|
+
return {
|
|
109
|
+
id: Number.isInteger(numeric) && numeric > 0 ? numeric : 1,
|
|
110
|
+
name: actor.username,
|
|
111
|
+
displayName: actor.displayName,
|
|
112
|
+
slug: actor.username,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function cloudRepository(repository) {
|
|
116
|
+
var _a;
|
|
117
|
+
return Object.assign(Object.assign({ type: "repository", full_name: repository.fullName, name: repository.slug }, (repository.uuid === undefined ? {} : { uuid: repository.uuid })), { links: {
|
|
118
|
+
html: {
|
|
119
|
+
href: (_a = repository.htmlUrl) !== null && _a !== void 0 ? _a : `https://bitbucket.org/${repository.fullName}`,
|
|
120
|
+
},
|
|
121
|
+
} });
|
|
122
|
+
}
|
|
123
|
+
function dcRepository(repository) {
|
|
124
|
+
return Object.assign(Object.assign(Object.assign({ slug: repository.slug }, (repository.id === undefined ? {} : { id: repository.id })), { name: repository.slug, project: { key: repository.owner } }), (repository.htmlUrl === undefined
|
|
125
|
+
? {}
|
|
126
|
+
: { links: { self: [{ href: `${repository.htmlUrl}/browse` }] } }));
|
|
127
|
+
}
|
|
128
|
+
function cloudPullRequest(pullRequest, actor, url) {
|
|
129
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
130
|
+
return {
|
|
131
|
+
id: pullRequest.id,
|
|
132
|
+
title: (_a = pullRequest.title) !== null && _a !== void 0 ? _a : "",
|
|
133
|
+
description: (_b = pullRequest.description) !== null && _b !== void 0 ? _b : "",
|
|
134
|
+
state: (_c = pullRequest.state) !== null && _c !== void 0 ? _c : "OPEN",
|
|
135
|
+
author: cloudActor(actor),
|
|
136
|
+
source: {
|
|
137
|
+
branch: { name: (_d = pullRequest.sourceBranch) !== null && _d !== void 0 ? _d : "" },
|
|
138
|
+
commit: { hash: (_e = pullRequest.headSha) !== null && _e !== void 0 ? _e : ZERO_SHA },
|
|
139
|
+
},
|
|
140
|
+
destination: {
|
|
141
|
+
branch: { name: (_f = pullRequest.targetBranch) !== null && _f !== void 0 ? _f : "" },
|
|
142
|
+
commit: { hash: (_g = pullRequest.baseSha) !== null && _g !== void 0 ? _g : ZERO_SHA },
|
|
143
|
+
},
|
|
144
|
+
links: { html: { href: (_h = pullRequest.htmlUrl) !== null && _h !== void 0 ? _h : url } },
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function dcPullRequest(pullRequest, repository, actor, url) {
|
|
148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
149
|
+
const repo = dcRepository(repository);
|
|
150
|
+
return {
|
|
151
|
+
id: pullRequest.id,
|
|
152
|
+
title: (_a = pullRequest.title) !== null && _a !== void 0 ? _a : "",
|
|
153
|
+
description: (_b = pullRequest.description) !== null && _b !== void 0 ? _b : "",
|
|
154
|
+
state: (_c = pullRequest.state) !== null && _c !== void 0 ? _c : "OPEN",
|
|
155
|
+
author: { user: dcActor(actor), role: "AUTHOR", approved: false },
|
|
156
|
+
fromRef: {
|
|
157
|
+
id: `refs/heads/${(_d = pullRequest.sourceBranch) !== null && _d !== void 0 ? _d : ""}`,
|
|
158
|
+
displayId: (_e = pullRequest.sourceBranch) !== null && _e !== void 0 ? _e : "",
|
|
159
|
+
latestCommit: (_f = pullRequest.headSha) !== null && _f !== void 0 ? _f : ZERO_SHA,
|
|
160
|
+
repository: repo,
|
|
161
|
+
},
|
|
162
|
+
toRef: {
|
|
163
|
+
id: `refs/heads/${(_g = pullRequest.targetBranch) !== null && _g !== void 0 ? _g : ""}`,
|
|
164
|
+
displayId: (_h = pullRequest.targetBranch) !== null && _h !== void 0 ? _h : "",
|
|
165
|
+
latestCommit: (_j = pullRequest.baseSha) !== null && _j !== void 0 ? _j : ZERO_SHA,
|
|
166
|
+
repository: repo,
|
|
167
|
+
},
|
|
168
|
+
links: { self: [{ href: (_k = pullRequest.htmlUrl) !== null && _k !== void 0 ? _k : url }] },
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/** Build one Bitbucket-shaped payload for `event` in the ref's dialect. */
|
|
172
|
+
export function synthesizeBitbucketEvent(input) {
|
|
173
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
174
|
+
const event = normalizeBitbucketEventKey(input.event);
|
|
175
|
+
if (!isBitbucketSynthesizableEvent(event)) {
|
|
176
|
+
return { error: `cannot synthesize ${input.event}` };
|
|
177
|
+
}
|
|
178
|
+
const { ref, pullRequest } = input;
|
|
179
|
+
const actor = actorFromPullRequest(pullRequest.raw);
|
|
180
|
+
const headSha = (_a = pullRequest.headSha) !== null && _a !== void 0 ? _a : ZERO_SHA;
|
|
181
|
+
const baseSha = (_b = pullRequest.baseSha) !== null && _b !== void 0 ? _b : ZERO_SHA;
|
|
182
|
+
const comment = (_c = input.comment) !== null && _c !== void 0 ? _c : "@cursor please take a look";
|
|
183
|
+
const commentId = Date.now() % 1000000000;
|
|
184
|
+
if (ref.dialect === "cloud") {
|
|
185
|
+
const base = {
|
|
186
|
+
repository: cloudRepository(ref.repository),
|
|
187
|
+
actor: cloudActor(actor),
|
|
188
|
+
};
|
|
189
|
+
const pullrequest = cloudPullRequest(pullRequest, actor, ref.url);
|
|
190
|
+
switch (event) {
|
|
191
|
+
case "pullrequest:created":
|
|
192
|
+
case "pullrequest:updated":
|
|
193
|
+
return {
|
|
194
|
+
eventType: event,
|
|
195
|
+
header: event,
|
|
196
|
+
payload: Object.assign(Object.assign({}, base), { pullrequest }),
|
|
197
|
+
};
|
|
198
|
+
case "pullrequest:comment_created":
|
|
199
|
+
return {
|
|
200
|
+
eventType: event,
|
|
201
|
+
header: event,
|
|
202
|
+
payload: Object.assign(Object.assign({}, base), { pullrequest, comment: {
|
|
203
|
+
id: commentId,
|
|
204
|
+
content: { raw: comment },
|
|
205
|
+
user: cloudActor(actor),
|
|
206
|
+
links: { html: { href: `${ref.url}#comment-${commentId}` } },
|
|
207
|
+
} }),
|
|
208
|
+
};
|
|
209
|
+
case "repo:push":
|
|
210
|
+
return {
|
|
211
|
+
eventType: event,
|
|
212
|
+
header: event,
|
|
213
|
+
payload: Object.assign(Object.assign({}, base), { push: {
|
|
214
|
+
changes: [
|
|
215
|
+
{
|
|
216
|
+
new: {
|
|
217
|
+
type: "branch",
|
|
218
|
+
name: (_d = pullRequest.sourceBranch) !== null && _d !== void 0 ? _d : "",
|
|
219
|
+
target: { hash: headSha },
|
|
220
|
+
},
|
|
221
|
+
old: {
|
|
222
|
+
type: "branch",
|
|
223
|
+
name: (_e = pullRequest.sourceBranch) !== null && _e !== void 0 ? _e : "",
|
|
224
|
+
target: { hash: baseSha },
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
} }),
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const header = DATA_CENTER_HEADER[event];
|
|
233
|
+
const base = {
|
|
234
|
+
eventKey: header,
|
|
235
|
+
date: new Date().toISOString(),
|
|
236
|
+
actor: dcActor(actor),
|
|
237
|
+
};
|
|
238
|
+
const dcPr = dcPullRequest(pullRequest, ref.repository, actor, ref.url);
|
|
239
|
+
switch (event) {
|
|
240
|
+
case "pullrequest:created":
|
|
241
|
+
return {
|
|
242
|
+
eventType: event,
|
|
243
|
+
header,
|
|
244
|
+
payload: Object.assign(Object.assign({}, base), { pullRequest: dcPr }),
|
|
245
|
+
};
|
|
246
|
+
case "pullrequest:updated":
|
|
247
|
+
// `pr:from_ref_updated` carries the previous head; the default dispatch
|
|
248
|
+
// keys on it to tell a push from a title edit.
|
|
249
|
+
return {
|
|
250
|
+
eventType: event,
|
|
251
|
+
header,
|
|
252
|
+
payload: Object.assign(Object.assign({}, base), { pullRequest: dcPr, previousFromHash: baseSha }),
|
|
253
|
+
};
|
|
254
|
+
case "pullrequest:comment_created":
|
|
255
|
+
return {
|
|
256
|
+
eventType: event,
|
|
257
|
+
header,
|
|
258
|
+
payload: Object.assign(Object.assign({}, base), { pullRequest: dcPr, comment: { id: commentId, text: comment, author: dcActor(actor) } }),
|
|
259
|
+
};
|
|
260
|
+
case "repo:push":
|
|
261
|
+
return {
|
|
262
|
+
eventType: event,
|
|
263
|
+
header,
|
|
264
|
+
payload: Object.assign(Object.assign({}, base), { repository: dcRepository(ref.repository), changes: [
|
|
265
|
+
{
|
|
266
|
+
ref: {
|
|
267
|
+
id: `refs/heads/${(_f = pullRequest.sourceBranch) !== null && _f !== void 0 ? _f : ""}`,
|
|
268
|
+
displayId: (_g = pullRequest.sourceBranch) !== null && _g !== void 0 ? _g : "",
|
|
269
|
+
type: "BRANCH",
|
|
270
|
+
},
|
|
271
|
+
refId: `refs/heads/${(_h = pullRequest.sourceBranch) !== null && _h !== void 0 ? _h : ""}`,
|
|
272
|
+
fromHash: baseSha,
|
|
273
|
+
toHash: headSha,
|
|
274
|
+
type: "UPDATE",
|
|
275
|
+
},
|
|
276
|
+
] }),
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Choose events to replay: explicit list (either dialect's keys), `*` for
|
|
282
|
+
* every declared, else `pullrequest:created`.
|
|
283
|
+
*/
|
|
284
|
+
export function selectBitbucketReplayEvents(requested, declared) {
|
|
285
|
+
const wanted = requested === undefined
|
|
286
|
+
? ["pullrequest:created"]
|
|
287
|
+
: requested.includes("*")
|
|
288
|
+
? [...declared]
|
|
289
|
+
: [...requested];
|
|
290
|
+
const events = [];
|
|
291
|
+
const unsupported = [];
|
|
292
|
+
for (const raw of new Set(wanted)) {
|
|
293
|
+
const event = normalizeBitbucketEventKey(raw);
|
|
294
|
+
if (isBitbucketSynthesizableEvent(event)) {
|
|
295
|
+
if (!events.includes(event)) {
|
|
296
|
+
events.push(event);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
unsupported.push(raw);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return { events, unsupported };
|
|
304
|
+
}
|