@grok/agent-sdk 0.0.0-stage → 0.2.27
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 +336 -0
- package/CHANGELOG.md +3 -0
- package/LICENSE.md +3 -0
- package/README.md +106 -2
- package/dist/artifacts.d.ts +37 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +52 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +20 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1703 -0
- package/dist/channels/bitbucket/api.d.ts +217 -0
- package/dist/channels/bitbucket/api.d.ts.map +1 -0
- package/dist/channels/bitbucket/api.js +648 -0
- package/dist/channels/bitbucket/binding.d.ts +75 -0
- package/dist/channels/bitbucket/binding.d.ts.map +1 -0
- package/dist/channels/bitbucket/binding.js +313 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +47 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +173 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +73 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +399 -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 +90 -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 +77 -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 +59 -0
- package/dist/channels/bitbucket/index.d.ts +38 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +37 -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 +326 -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 +30 -0
- package/dist/channels/bitbucket/types.d.ts +236 -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 +45 -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 +42 -0
- package/dist/channels/change-monitors/types.d.ts.map +1 -0
- package/dist/channels/change-monitors/types.js +1 -0
- package/dist/channels/checks.d.ts +121 -0
- package/dist/channels/checks.d.ts.map +1 -0
- package/dist/channels/checks.js +76 -0
- package/dist/channels/deployments/deployments-channel.d.ts +95 -0
- package/dist/channels/deployments/deployments-channel.d.ts.map +1 -0
- package/dist/channels/deployments/deployments-channel.js +188 -0
- package/dist/channels/deployments/index.d.ts +25 -0
- package/dist/channels/deployments/index.d.ts.map +1 -0
- package/dist/channels/deployments/index.js +24 -0
- package/dist/channels/deployments/types.d.ts +83 -0
- package/dist/channels/deployments/types.d.ts.map +1 -0
- package/dist/channels/deployments/types.js +7 -0
- package/dist/channels/github/api.d.ts +133 -0
- package/dist/channels/github/api.d.ts.map +1 -0
- package/dist/channels/github/api.js +373 -0
- package/dist/channels/github/auth.d.ts +71 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +247 -0
- package/dist/channels/github/binding.d.ts +86 -0
- package/dist/channels/github/binding.d.ts.map +1 -0
- package/dist/channels/github/binding.js +123 -0
- package/dist/channels/github/checks.d.ts +64 -0
- package/dist/channels/github/checks.d.ts.map +1 -0
- package/dist/channels/github/checks.js +93 -0
- package/dist/channels/github/cursor-account.d.ts +109 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +206 -0
- package/dist/channels/github/defaults.d.ts +23 -0
- package/dist/channels/github/defaults.d.ts.map +1 -0
- package/dist/channels/github/defaults.js +132 -0
- package/dist/channels/github/events.d.ts +18 -0
- package/dist/channels/github/events.d.ts.map +1 -0
- package/dist/channels/github/events.js +56 -0
- package/dist/channels/github/forward.d.ts +139 -0
- package/dist/channels/github/forward.d.ts.map +1 -0
- package/dist/channels/github/forward.js +263 -0
- package/dist/channels/github/github-channel.d.ts +187 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +2089 -0
- package/dist/channels/github/index.d.ts +64 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +52 -0
- package/dist/channels/github/progress.d.ts +84 -0
- package/dist/channels/github/progress.d.ts.map +1 -0
- package/dist/channels/github/progress.js +235 -0
- package/dist/channels/github/replay.d.ts +115 -0
- package/dist/channels/github/replay.d.ts.map +1 -0
- package/dist/channels/github/replay.js +269 -0
- package/dist/channels/github/state.d.ts +47 -0
- package/dist/channels/github/state.d.ts.map +1 -0
- package/dist/channels/github/state.js +77 -0
- package/dist/channels/github/types.d.ts +515 -0
- package/dist/channels/github/types.d.ts.map +1 -0
- package/dist/channels/github/types.js +1 -0
- package/dist/channels/gitlab/api.d.ts +118 -0
- package/dist/channels/gitlab/api.d.ts.map +1 -0
- package/dist/channels/gitlab/api.js +220 -0
- package/dist/channels/gitlab/binding.d.ts +63 -0
- package/dist/channels/gitlab/binding.d.ts.map +1 -0
- package/dist/channels/gitlab/binding.js +166 -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 +121 -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 +64 -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 +61 -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 +26 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts +48 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +173 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +54 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +421 -0
- package/dist/channels/gitlab/index.d.ts +35 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +34 -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 +222 -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 +31 -0
- package/dist/channels/gitlab/types.d.ts +222 -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 +35 -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 +157 -0
- package/dist/channels/origin/api.d.ts.map +1 -0
- package/dist/channels/origin/api.js +363 -0
- package/dist/channels/origin/binding.d.ts +57 -0
- package/dist/channels/origin/binding.d.ts.map +1 -0
- package/dist/channels/origin/binding.js +56 -0
- package/dist/channels/origin/checks.d.ts +119 -0
- package/dist/channels/origin/checks.d.ts.map +1 -0
- package/dist/channels/origin/checks.js +147 -0
- package/dist/channels/origin/cursor-account.d.ts +24 -0
- package/dist/channels/origin/cursor-account.d.ts.map +1 -0
- package/dist/channels/origin/cursor-account.js +35 -0
- package/dist/channels/origin/defaults.d.ts +43 -0
- package/dist/channels/origin/defaults.d.ts.map +1 -0
- package/dist/channels/origin/defaults.js +94 -0
- package/dist/channels/origin/events.d.ts +10 -0
- package/dist/channels/origin/events.d.ts.map +1 -0
- package/dist/channels/origin/events.js +25 -0
- package/dist/channels/origin/index.d.ts +45 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +33 -0
- package/dist/channels/origin/origin-channel.d.ts +72 -0
- package/dist/channels/origin/origin-channel.d.ts.map +1 -0
- package/dist/channels/origin/origin-channel.js +628 -0
- package/dist/channels/origin/origin-webhook.d.ts +69 -0
- package/dist/channels/origin/origin-webhook.d.ts.map +1 -0
- package/dist/channels/origin/origin-webhook.js +213 -0
- package/dist/channels/origin/reactions.d.ts +56 -0
- package/dist/channels/origin/reactions.d.ts.map +1 -0
- package/dist/channels/origin/reactions.js +46 -0
- package/dist/channels/origin/state.d.ts +32 -0
- package/dist/channels/origin/state.d.ts.map +1 -0
- package/dist/channels/origin/state.js +31 -0
- package/dist/channels/origin/types.d.ts +257 -0
- package/dist/channels/origin/types.d.ts.map +1 -0
- package/dist/channels/origin/types.js +1 -0
- package/dist/channels/pagerduty/api.d.ts +74 -0
- package/dist/channels/pagerduty/api.d.ts.map +1 -0
- package/dist/channels/pagerduty/api.js +101 -0
- package/dist/channels/pagerduty/defaults.d.ts +42 -0
- package/dist/channels/pagerduty/defaults.d.ts.map +1 -0
- package/dist/channels/pagerduty/defaults.js +132 -0
- package/dist/channels/pagerduty/events.d.ts +24 -0
- package/dist/channels/pagerduty/events.d.ts.map +1 -0
- package/dist/channels/pagerduty/events.js +38 -0
- package/dist/channels/pagerduty/index.d.ts +31 -0
- package/dist/channels/pagerduty/index.d.ts.map +1 -0
- package/dist/channels/pagerduty/index.js +30 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts +64 -0
- package/dist/channels/pagerduty/pagerduty-channel.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-channel.js +195 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts +70 -0
- package/dist/channels/pagerduty/pagerduty-webhook.d.ts.map +1 -0
- package/dist/channels/pagerduty/pagerduty-webhook.js +280 -0
- package/dist/channels/pagerduty/payload.d.ts +33 -0
- package/dist/channels/pagerduty/payload.d.ts.map +1 -0
- package/dist/channels/pagerduty/payload.js +150 -0
- package/dist/channels/pagerduty/replay.d.ts +35 -0
- package/dist/channels/pagerduty/replay.d.ts.map +1 -0
- package/dist/channels/pagerduty/replay.js +115 -0
- package/dist/channels/pagerduty/secrets.d.ts +16 -0
- package/dist/channels/pagerduty/secrets.d.ts.map +1 -0
- package/dist/channels/pagerduty/secrets.js +23 -0
- package/dist/channels/pagerduty/self-user.d.ts +51 -0
- package/dist/channels/pagerduty/self-user.d.ts.map +1 -0
- package/dist/channels/pagerduty/self-user.js +157 -0
- package/dist/channels/pagerduty/state.d.ts +31 -0
- package/dist/channels/pagerduty/state.d.ts.map +1 -0
- package/dist/channels/pagerduty/state.js +30 -0
- package/dist/channels/pagerduty/types.d.ts +217 -0
- package/dist/channels/pagerduty/types.d.ts.map +1 -0
- package/dist/channels/pagerduty/types.js +1 -0
- package/dist/channels/runs/index.d.ts +4 -0
- package/dist/channels/runs/index.d.ts.map +1 -0
- package/dist/channels/runs/index.js +2 -0
- package/dist/channels/runs/runs-channel.d.ts +5 -0
- package/dist/channels/runs/runs-channel.d.ts.map +1 -0
- package/dist/channels/runs/runs-channel.js +34 -0
- package/dist/channels/runs/types.d.ts +34 -0
- package/dist/channels/runs/types.d.ts.map +1 -0
- package/dist/channels/runs/types.js +1 -0
- package/dist/channels/slack/agentic-delivery.d.ts +24 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +510 -0
- package/dist/channels/slack/agentic-posted.d.ts +30 -0
- package/dist/channels/slack/agentic-posted.d.ts.map +1 -0
- package/dist/channels/slack/agentic-posted.js +101 -0
- package/dist/channels/slack/agentic-signals.d.ts +43 -0
- package/dist/channels/slack/agentic-signals.d.ts.map +1 -0
- package/dist/channels/slack/agentic-signals.js +199 -0
- package/dist/channels/slack/api.d.ts +172 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +642 -0
- package/dist/channels/slack/approvals.d.ts +48 -0
- package/dist/channels/slack/approvals.d.ts.map +1 -0
- package/dist/channels/slack/approvals.js +233 -0
- package/dist/channels/slack/assistant.d.ts +23 -0
- package/dist/channels/slack/assistant.d.ts.map +1 -0
- package/dist/channels/slack/assistant.js +57 -0
- package/dist/channels/slack/attachments.d.ts +85 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +507 -0
- package/dist/channels/slack/auth.d.ts +46 -0
- package/dist/channels/slack/auth.d.ts.map +1 -0
- package/dist/channels/slack/auth.js +97 -0
- package/dist/channels/slack/blocks.d.ts +61 -0
- package/dist/channels/slack/blocks.d.ts.map +1 -0
- package/dist/channels/slack/blocks.js +90 -0
- package/dist/channels/slack/bot-mentions.d.ts +108 -0
- package/dist/channels/slack/bot-mentions.d.ts.map +1 -0
- package/dist/channels/slack/bot-mentions.js +243 -0
- package/dist/channels/slack/channel-watch.d.ts +80 -0
- package/dist/channels/slack/channel-watch.d.ts.map +1 -0
- package/dist/channels/slack/channel-watch.js +264 -0
- package/dist/channels/slack/cli-project.d.ts +19 -0
- package/dist/channels/slack/cli-project.d.ts.map +1 -0
- package/dist/channels/slack/cli-project.js +203 -0
- package/dist/channels/slack/code-fences.d.ts +17 -0
- package/dist/channels/slack/code-fences.d.ts.map +1 -0
- package/dist/channels/slack/code-fences.js +164 -0
- package/dist/channels/slack/constants.d.ts +27 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +37 -0
- package/dist/channels/slack/credentials.d.ts +35 -0
- package/dist/channels/slack/credentials.d.ts.map +1 -0
- package/dist/channels/slack/credentials.js +73 -0
- package/dist/channels/slack/defaults.d.ts +50 -0
- package/dist/channels/slack/defaults.d.ts.map +1 -0
- package/dist/channels/slack/defaults.js +592 -0
- package/dist/channels/slack/dispatch.d.ts +153 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +820 -0
- package/dist/channels/slack/doctor.d.ts +40 -0
- package/dist/channels/slack/doctor.d.ts.map +1 -0
- package/dist/channels/slack/doctor.js +277 -0
- package/dist/channels/slack/eval-directive.d.ts +59 -0
- package/dist/channels/slack/eval-directive.d.ts.map +1 -0
- package/dist/channels/slack/eval-directive.js +252 -0
- package/dist/channels/slack/event-id-dedupe.d.ts +10 -0
- package/dist/channels/slack/event-id-dedupe.d.ts.map +1 -0
- package/dist/channels/slack/event-id-dedupe.js +23 -0
- package/dist/channels/slack/external-policy.d.ts +28 -0
- package/dist/channels/slack/external-policy.d.ts.map +1 -0
- package/dist/channels/slack/external-policy.js +51 -0
- package/dist/channels/slack/footer.d.ts +33 -0
- package/dist/channels/slack/footer.d.ts.map +1 -0
- package/dist/channels/slack/footer.js +72 -0
- package/dist/channels/slack/inbound.d.ts +104 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +350 -0
- package/dist/channels/slack/index.d.ts +56 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +55 -0
- package/dist/channels/slack/init.d.ts +41 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +109 -0
- package/dist/channels/slack/interactive.d.ts +73 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +309 -0
- package/dist/channels/slack/links.d.ts +10 -0
- package/dist/channels/slack/links.d.ts.map +1 -0
- package/dist/channels/slack/links.js +18 -0
- package/dist/channels/slack/live-delivery.d.ts +80 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +386 -0
- package/dist/channels/slack/log.d.ts +25 -0
- package/dist/channels/slack/log.d.ts.map +1 -0
- package/dist/channels/slack/log.js +44 -0
- package/dist/channels/slack/manifest.d.ts +80 -0
- package/dist/channels/slack/manifest.d.ts.map +1 -0
- package/dist/channels/slack/manifest.js +186 -0
- package/dist/channels/slack/message-body.d.ts +13 -0
- package/dist/channels/slack/message-body.d.ts.map +1 -0
- package/dist/channels/slack/message-body.js +74 -0
- package/dist/channels/slack/nudge-carrier.d.ts +21 -0
- package/dist/channels/slack/nudge-carrier.d.ts.map +1 -0
- package/dist/channels/slack/nudge-carrier.js +201 -0
- package/dist/channels/slack/nudge-store.d.ts +77 -0
- package/dist/channels/slack/nudge-store.d.ts.map +1 -0
- package/dist/channels/slack/nudge-store.js +288 -0
- package/dist/channels/slack/paint-start.d.ts +22 -0
- package/dist/channels/slack/paint-start.d.ts.map +1 -0
- package/dist/channels/slack/paint-start.js +76 -0
- package/dist/channels/slack/placeholder.d.ts +62 -0
- package/dist/channels/slack/placeholder.d.ts.map +1 -0
- package/dist/channels/slack/placeholder.js +237 -0
- package/dist/channels/slack/pr-ref.d.ts +24 -0
- package/dist/channels/slack/pr-ref.d.ts.map +1 -0
- package/dist/channels/slack/pr-ref.js +55 -0
- package/dist/channels/slack/progress-delivery.d.ts +28 -0
- package/dist/channels/slack/progress-delivery.d.ts.map +1 -0
- package/dist/channels/slack/progress-delivery.js +109 -0
- package/dist/channels/slack/reasoning-card.d.ts +38 -0
- package/dist/channels/slack/reasoning-card.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-card.js +90 -0
- package/dist/channels/slack/reasoning-chip.d.ts +8 -0
- package/dist/channels/slack/reasoning-chip.d.ts.map +1 -0
- package/dist/channels/slack/reasoning-chip.js +30 -0
- package/dist/channels/slack/recording-sink.d.ts +29 -0
- package/dist/channels/slack/recording-sink.d.ts.map +1 -0
- package/dist/channels/slack/recording-sink.js +128 -0
- package/dist/channels/slack/redact.d.ts +2 -0
- package/dist/channels/slack/redact.d.ts.map +1 -0
- package/dist/channels/slack/redact.js +5 -0
- package/dist/channels/slack/reply-options.d.ts +56 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +218 -0
- package/dist/channels/slack/self-identity.d.ts +18 -0
- package/dist/channels/slack/self-identity.d.ts.map +1 -0
- package/dist/channels/slack/self-identity.js +49 -0
- package/dist/channels/slack/sender-name.d.ts +26 -0
- package/dist/channels/slack/sender-name.d.ts.map +1 -0
- package/dist/channels/slack/sender-name.js +79 -0
- package/dist/channels/slack/setup.d.ts +33 -0
- package/dist/channels/slack/setup.d.ts.map +1 -0
- package/dist/channels/slack/setup.js +99 -0
- package/dist/channels/slack/slack-channel.d.ts +46 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +683 -0
- package/dist/channels/slack/socket-mode.d.ts +26 -0
- package/dist/channels/slack/socket-mode.d.ts.map +1 -0
- package/dist/channels/slack/socket-mode.js +100 -0
- package/dist/channels/slack/stop.d.ts +14 -0
- package/dist/channels/slack/stop.d.ts.map +1 -0
- package/dist/channels/slack/stop.js +22 -0
- package/dist/channels/slack/stream.d.ts +42 -0
- package/dist/channels/slack/stream.d.ts.map +1 -0
- package/dist/channels/slack/stream.js +30 -0
- package/dist/channels/slack/thread-context.d.ts +89 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +459 -0
- package/dist/channels/slack/tool-approval-events.d.ts +38 -0
- package/dist/channels/slack/tool-approval-events.d.ts.map +1 -0
- package/dist/channels/slack/tool-approval-events.js +207 -0
- package/dist/channels/slack/tool-cards.d.ts +22 -0
- package/dist/channels/slack/tool-cards.d.ts.map +1 -0
- package/dist/channels/slack/tool-cards.js +167 -0
- package/dist/channels/slack/tool-chip.d.ts +9 -0
- package/dist/channels/slack/tool-chip.d.ts.map +1 -0
- package/dist/channels/slack/tool-chip.js +22 -0
- package/dist/channels/slack/types.d.ts +811 -0
- package/dist/channels/slack/types.d.ts.map +1 -0
- package/dist/channels/slack/types.js +4 -0
- package/dist/channels/slack/upload.d.ts +13 -0
- package/dist/channels/slack/upload.d.ts.map +1 -0
- package/dist/channels/slack/upload.js +122 -0
- package/dist/channels/slack/user-info.d.ts +16 -0
- package/dist/channels/slack/user-info.d.ts.map +1 -0
- package/dist/channels/slack/user-info.js +58 -0
- package/dist/channels.d.ts +188 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +421 -0
- package/dist/connections.d.ts +160 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +185 -0
- package/dist/dashboard-session-url.d.ts +15 -0
- package/dist/dashboard-session-url.d.ts.map +1 -0
- package/dist/dashboard-session-url.js +24 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.wA5xBBcd.js +309 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.js +9 -0
- package/dist/docs/assets/building-with-agents.md.FZXrY8Nk.lean.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.js +1 -0
- package/dist/docs/assets/changelog.md.BvHRIiMH.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.BoDEJQWv.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.C29HLCVL.js +9 -0
- package/dist/docs/assets/chunks/arc.BOaoYWmh.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.MfG0itQh.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.CUeJciCF.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.BrXMZRtK.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.DfkDHeB9.js +10 -0
- package/dist/docs/assets/chunks/channel.D2BTz0L-.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.xKz8CiXK.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.kkfBh4zk.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BClJGb94.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.P9BpQ9L3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.R4iYi58S.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.Cpn8L1dw.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BLftECqU.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BWDV1AYt.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.DqByliAC.js +1 -0
- package/dist/docs/assets/chunks/clone.CldT1lbQ.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.DGpAcJ55.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.BBXxGEaD.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.EKqOwmK2.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.CB8pdkoZ.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.aHh4WGg9.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.YIsbRH20.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.B3bTCW_e.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.M81hXIXZ.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.BKg7WY--.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CLEMZgO3.js +106 -0
- package/dist/docs/assets/chunks/graph.DS38W_Q-.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.BTiWTi82.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.DcqY_KQL.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.0lQNZ40U.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.L5sKlf7X.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.7u4gFhQa.js +1 -0
- package/dist/docs/assets/chunks/linear.D5v33SOb.js +1 -0
- package/dist/docs/assets/chunks/min.Dc9uCxf9.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.B56nGoB_.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.Cba8e8lS.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.2YjBycHF.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.D4P5RqVI.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.C0Hn8NUm.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BZm7EaoT.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.DcR4f3X2.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2.Bb4oMe0P.js +1 -0
- package/dist/docs/assets/chunks/theme.DvfKzyXq.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.CgDh96vg.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.B4fagbC8.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.Ck68omim.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DBUg0bvz.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.DnKSGQE1.js +7 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.js +31 -0
- package/dist/docs/assets/deployment.md.3MMWuPeV.lean.js +1 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.js +68 -0
- package/dist/docs/assets/evals.md.CHR34K1Y.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.js +42 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CwL5cwuE.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.CKUayYtD.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.js +9 -0
- package/dist/docs/assets/guides_cloud-agents.md.BzbzcOyj.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.DMEX9nF-.lean.js +1 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.js +55 -0
- package/dist/docs/assets/guides_export-grokbot.md.qo5bxi4h.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.js +162 -0
- package/dist/docs/assets/guides_github.md.TuNiZAOQ.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.CtNI4fSH.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.js +15 -0
- package/dist/docs/assets/guides_grokbot-agents.md.BwAykJ7U.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.js +54 -0
- package/dist/docs/assets/guides_hooks.md.B2XfGX50.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.js +21 -0
- package/dist/docs/assets/guides_improve.md.CZKVt1cT.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.js +151 -0
- package/dist/docs/assets/guides_jev.md.D7XH4JH3.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.js +38 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cxq2TxBB.lean.js +1 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.js +7 -0
- package/dist/docs/assets/guides_migrate.md.CQlGaBKX.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.js +37 -0
- package/dist/docs/assets/guides_opentelemetry.md.D4wO7_8v.lean.js +1 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.js +60 -0
- package/dist/docs/assets/guides_pagerduty.md.BHXMcMtx.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.js +75 -0
- package/dist/docs/assets/guides_slack.md.ClIyi7FI.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.js +93 -0
- package/dist/docs/assets/guides_webhooks.md.Cpdc3BDX.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Dxvd-0gT.lean.js +1 -0
- package/dist/docs/assets/index.md.CAnsLl8D.js +27 -0
- package/dist/docs/assets/index.md.CAnsLl8D.lean.js +1 -0
- package/dist/docs/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 +0 -0
- package/dist/docs/assets/inter-italic-cyrillic.By2_1cv3.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek-ext.1u6EdAuj.woff2 +0 -0
- package/dist/docs/assets/inter-italic-greek.DJ8dCoTZ.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin-ext.CN1xVJS-.woff2 +0 -0
- package/dist/docs/assets/inter-italic-latin.C2AdPX0b.woff2 +0 -0
- package/dist/docs/assets/inter-italic-vietnamese.BSbpV94h.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 +0 -0
- package/dist/docs/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 +0 -0
- package/dist/docs/assets/inter-roman-greek.BBVDIX6e.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 +0 -0
- package/dist/docs/assets/inter-roman-latin.Di8DUHzh.woff2 +0 -0
- package/dist/docs/assets/inter-roman-vietnamese.BjW4sHH5.woff2 +0 -0
- package/dist/docs/assets/quickstart.md.D8JDfkKO.js +170 -0
- package/dist/docs/assets/quickstart.md.D8JDfkKO.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.js +38 -0
- package/dist/docs/assets/reference_agent-config.md.CZrbHOfT.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.DLV9MZES.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.js +22 -0
- package/dist/docs/assets/reference_channels.md.CNNIS6K7.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.js +103 -0
- package/dist/docs/assets/reference_cli.md.1o_TqKdt.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.js +66 -0
- package/dist/docs/assets/reference_connections.md.BJE2Zllp.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.js +56 -0
- package/dist/docs/assets/reference_evals.md.Ccwp4x3o.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.js +62 -0
- package/dist/docs/assets/reference_extensions.md.DKxTuCIw.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.js +51 -0
- package/dist/docs/assets/reference_hooks.md.CROr0QgC.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.js +11 -0
- package/dist/docs/assets/reference_http-api.md.Dji-DD_Z.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.js +14 -0
- package/dist/docs/assets/reference_instructions.md.BYMVxAkw.lean.js +1 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.js +4 -0
- package/dist/docs/assets/reference_memory.md.BwyJXYZe.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.js +1 -0
- package/dist/docs/assets/reference_playground.md.q4MI-0td.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.mFcS8yDD.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.js +9 -0
- package/dist/docs/assets/reference_prompt.md.DqPh71XN.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BqWnJES4.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.js +22 -0
- package/dist/docs/assets/reference_sessions.md.Bi6lHttM.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.js +15 -0
- package/dist/docs/assets/reference_skills.md.Ckddg6KX.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.js +10 -0
- package/dist/docs/assets/reference_subagents.md.ChNGh6HK.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.js +79 -0
- package/dist/docs/assets/reference_tools.md.Bo0UfT0a.lean.js +1 -0
- package/dist/docs/assets/style.B9o0luvp.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.js +13 -0
- package/dist/docs/assets/templates_agentic-owners.md.CTEnR0jp.lean.js +1 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.js +5 -0
- package/dist/docs/assets/templates_grokbot-agents.md.DgpPEs7B.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.js +3 -0
- package/dist/docs/assets/templates_security-reviewer.md.Gh6EF9Us.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.B77UyTrX.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.DRJ7mC5U.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.js +9 -0
- package/dist/docs/assets/templates_triage.md.CNN6b0JZ.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.js +1 -0
- package/dist/docs/assets/troubleshooting.md.DFnoTDlQ.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +134 -0
- package/dist/docs/changelog.html +60 -0
- package/dist/docs/changelog.md +114 -0
- package/dist/docs/deployment.html +90 -0
- package/dist/docs/deployment.md +309 -0
- package/dist/docs/evals.html +127 -0
- package/dist/docs/evals.md +239 -0
- package/dist/docs/guides/agent-to-agent.html +101 -0
- package/dist/docs/guides/agent-to-agent.md +162 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +293 -0
- package/dist/docs/guides/cloud-agents.html +68 -0
- package/dist/docs/guides/cloud-agents.md +81 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +180 -0
- package/dist/docs/guides/export-grokbot.html +114 -0
- package/dist/docs/guides/export-grokbot.md +239 -0
- package/dist/docs/guides/github.html +221 -0
- package/dist/docs/guides/github.md +373 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +299 -0
- package/dist/docs/guides/grokbot-agents.html +74 -0
- package/dist/docs/guides/grokbot-agents.md +135 -0
- package/dist/docs/guides/hooks.html +113 -0
- package/dist/docs/guides/hooks.md +116 -0
- package/dist/docs/guides/improve.html +80 -0
- package/dist/docs/guides/improve.md +129 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +298 -0
- package/dist/docs/guides/mcp-oauth.html +97 -0
- package/dist/docs/guides/mcp-oauth.md +148 -0
- package/dist/docs/guides/migrate.html +66 -0
- package/dist/docs/guides/migrate.md +164 -0
- package/dist/docs/guides/opentelemetry.html +96 -0
- package/dist/docs/guides/opentelemetry.md +205 -0
- package/dist/docs/guides/pagerduty.html +119 -0
- package/dist/docs/guides/pagerduty.md +336 -0
- package/dist/docs/guides/slack.html +134 -0
- package/dist/docs/guides/slack.md +309 -0
- package/dist/docs/guides/webhooks.html +152 -0
- package/dist/docs/guides/webhooks.md +250 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +134 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +110 -0
- package/dist/docs/llms-full.txt +10077 -0
- package/dist/docs/llms.txt +68 -0
- package/dist/docs/quickstart.html +229 -0
- package/dist/docs/quickstart.md +307 -0
- package/dist/docs/reference/agent-config.html +97 -0
- package/dist/docs/reference/agent-config.md +238 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +113 -0
- package/dist/docs/reference/channels.html +81 -0
- package/dist/docs/reference/channels.md +214 -0
- package/dist/docs/reference/cli.html +162 -0
- package/dist/docs/reference/cli.md +1098 -0
- package/dist/docs/reference/connections.html +125 -0
- package/dist/docs/reference/connections.md +307 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +294 -0
- package/dist/docs/reference/extensions.html +121 -0
- package/dist/docs/reference/extensions.md +209 -0
- package/dist/docs/reference/hooks.html +110 -0
- package/dist/docs/reference/hooks.md +197 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +221 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +64 -0
- package/dist/docs/reference/memory.html +63 -0
- package/dist/docs/reference/memory.md +114 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +36 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +117 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +47 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +190 -0
- package/dist/docs/reference/sessions.html +81 -0
- package/dist/docs/reference/sessions.md +200 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +72 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +61 -0
- package/dist/docs/reference/tools.html +138 -0
- package/dist/docs/reference/tools.md +306 -0
- package/dist/docs/templates/agentic-owners.html +72 -0
- package/dist/docs/templates/agentic-owners.md +126 -0
- package/dist/docs/templates/grokbot-agents.html +64 -0
- package/dist/docs/templates/grokbot-agents.md +55 -0
- package/dist/docs/templates/security-reviewer.html +62 -0
- package/dist/docs/templates/security-reviewer.md +81 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +75 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +75 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +101 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +149 -0
- package/dist/docs/vp-icons.css +0 -0
- package/dist/evals/assertions.d.ts +199 -0
- package/dist/evals/assertions.d.ts.map +1 -0
- package/dist/evals/assertions.js +447 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +184 -0
- package/dist/evals/judge.d.ts +134 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +221 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +107 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +141 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +196 -0
- package/dist/evals/results.d.ts +103 -0
- package/dist/evals/results.d.ts.map +1 -0
- package/dist/evals/results.js +27 -0
- package/dist/evals/run-facts.d.ts +77 -0
- package/dist/evals/run-facts.d.ts.map +1 -0
- package/dist/evals/run-facts.js +213 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +304 -0
- package/dist/executors.d.ts +11 -0
- package/dist/executors.d.ts.map +1 -0
- package/dist/executors.js +21 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +94 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +104 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +118 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +290 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts +3 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/channels.js +11 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts +25 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/fleet.js +65 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts +5 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/inputs.js +4 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts +47 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/launch-agent.js +62 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +60 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +14 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts +17 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/watch.js +85 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts +19 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/reminders/cloud-agent-stop-watch.js +60 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +41 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/cancel.js +19 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +43 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +14 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +49 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/list.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/reply.js +26 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts +77 -0
- package/dist/extensions/cursor-grokbot-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/extension.js +70 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts +11 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/agents.js +31 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts +56 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/backend.js +138 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts +28 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/contacts.js +46 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts +53 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/conversation.js +186 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/inputs.js +15 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts +12 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/lib/lock.js +24 -0
- package/dist/extensions/cursor-grokbot-agents/skills/consult.md +40 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/ask.js +26 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/check.js +21 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/interrupt.js +13 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts +4 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.d.ts.map +1 -0
- package/dist/extensions/cursor-grokbot-agents/tools/list.js +22 -0
- package/dist/extensions/improve/extension.d.ts +48 -0
- package/dist/extensions/improve/extension.d.ts.map +1 -0
- package/dist/extensions/improve/extension.js +43 -0
- package/dist/extensions/improve/skills/yourself.d.ts +4 -0
- package/dist/extensions/improve/skills/yourself.d.ts.map +1 -0
- package/dist/extensions/improve/skills/yourself.js +43 -0
- package/dist/extensions/jev/extension.d.ts +46 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +56 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +105 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +154 -0
- package/dist/extensions/jev/skills/gated-write.md +25 -0
- package/dist/extensions/jev/skills/questions.md +33 -0
- package/dist/extensions/jev/tools/evaluate.d.ts +4 -0
- package/dist/extensions/jev/tools/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/tools/evaluate.js +72 -0
- package/dist/extensions/slack-communication/extension.d.ts +28 -0
- package/dist/extensions/slack-communication/extension.d.ts.map +1 -0
- package/dist/extensions/slack-communication/extension.js +32 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts +5 -0
- package/dist/extensions/slack-communication/skills/slack-voice.d.ts.map +1 -0
- package/dist/extensions/slack-communication/skills/slack-voice.js +52 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/delete-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/delete-message.js +29 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/edit-message.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/edit-message.js +34 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-card.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-card.js +25 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-file.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-file.js +75 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/post-update.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/post-update.js +33 -0
- package/dist/extensions/slack-communication/tools/react.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/react.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/react.js +27 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts +4 -0
- package/dist/extensions/slack-communication/tools/set-status.d.ts.map +1 -0
- package/dist/extensions/slack-communication/tools/set-status.js +18 -0
- package/dist/extensions.d.ts +87 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +141 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts +3 -0
- package/dist/files-backends/agent-store-presigned-url.d.ts.map +1 -0
- package/dist/files-backends/agent-store-presigned-url.js +223 -0
- package/dist/files-backends/cursor-hosted.d.ts +65 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +848 -0
- package/dist/files-backends/local-fs.d.ts +33 -0
- package/dist/files-backends/local-fs.d.ts.map +1 -0
- package/dist/files-backends/local-fs.js +133 -0
- package/dist/files.d.ts +203 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +129 -0
- package/dist/filesystem.d.ts +515 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1596 -0
- package/dist/hooks.d.ts +25 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +25 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/internal/advertise-tools.d.ts +96 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +255 -0
- package/dist/internal/approval-gate.d.ts +35 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +81 -0
- package/dist/internal/artifacts-store.d.ts +123 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +657 -0
- package/dist/internal/as-of.d.ts +39 -0
- package/dist/internal/as-of.d.ts.map +1 -0
- package/dist/internal/as-of.js +207 -0
- package/dist/internal/auth.d.ts +12 -0
- package/dist/internal/auth.d.ts.map +1 -0
- package/dist/internal/auth.js +34 -0
- package/dist/internal/authored-alias-hooks.d.ts +43 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +104 -0
- package/dist/internal/authored-loaders.d.ts +50 -0
- package/dist/internal/authored-loaders.d.ts.map +1 -0
- package/dist/internal/authored-loaders.js +183 -0
- package/dist/internal/bounded-int.d.ts +11 -0
- package/dist/internal/bounded-int.d.ts.map +1 -0
- package/dist/internal/bounded-int.js +12 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +21 -0
- package/dist/internal/brand.d.ts +6 -0
- package/dist/internal/brand.d.ts.map +1 -0
- package/dist/internal/brand.js +17 -0
- package/dist/internal/browser-origin-guard.d.ts +19 -0
- package/dist/internal/browser-origin-guard.d.ts.map +1 -0
- package/dist/internal/browser-origin-guard.js +51 -0
- package/dist/internal/builtin-tools/artifacts.d.ts +10 -0
- package/dist/internal/builtin-tools/artifacts.d.ts.map +1 -0
- package/dist/internal/builtin-tools/artifacts.js +87 -0
- package/dist/internal/builtin-tools/index.d.ts +17 -0
- package/dist/internal/builtin-tools/index.d.ts.map +1 -0
- package/dist/internal/builtin-tools/index.js +39 -0
- package/dist/internal/builtin-tools/reminders.d.ts +9 -0
- package/dist/internal/builtin-tools/reminders.d.ts.map +1 -0
- package/dist/internal/builtin-tools/reminders.js +115 -0
- package/dist/internal/channel-architecture.d.ts +21 -0
- package/dist/internal/channel-architecture.d.ts.map +1 -0
- package/dist/internal/channel-architecture.js +43 -0
- 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 +74 -0
- package/dist/internal/channel-route-dispatch.d.ts +13 -0
- package/dist/internal/channel-route-dispatch.d.ts.map +1 -0
- package/dist/internal/channel-route-dispatch.js +51 -0
- package/dist/internal/channel-state.d.ts +17 -0
- package/dist/internal/channel-state.d.ts.map +1 -0
- package/dist/internal/channel-state.js +69 -0
- package/dist/internal/chat-client.d.ts +45 -0
- package/dist/internal/chat-client.d.ts.map +1 -0
- package/dist/internal/chat-client.js +457 -0
- package/dist/internal/cli-ax.d.ts +227 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1825 -0
- 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 +332 -0
- package/dist/internal/cli-convert-automation.d.ts +39 -0
- package/dist/internal/cli-convert-automation.d.ts.map +1 -0
- package/dist/internal/cli-convert-automation.js +257 -0
- package/dist/internal/cli-cursor.d.ts +38 -0
- package/dist/internal/cli-cursor.d.ts.map +1 -0
- package/dist/internal/cli-cursor.js +205 -0
- package/dist/internal/cli-deploy.d.ts +171 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +2072 -0
- package/dist/internal/cli-docs.d.ts +34 -0
- package/dist/internal/cli-docs.d.ts.map +1 -0
- package/dist/internal/cli-docs.js +156 -0
- package/dist/internal/cli-github.d.ts +47 -0
- package/dist/internal/cli-github.d.ts.map +1 -0
- package/dist/internal/cli-github.js +600 -0
- 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 +350 -0
- package/dist/internal/cli-images.d.ts +68 -0
- package/dist/internal/cli-images.d.ts.map +1 -0
- package/dist/internal/cli-images.js +536 -0
- package/dist/internal/cli-init-grokbot.d.ts +29 -0
- package/dist/internal/cli-init-grokbot.d.ts.map +1 -0
- package/dist/internal/cli-init-grokbot.js +181 -0
- package/dist/internal/cli-manifest.d.ts +19 -0
- package/dist/internal/cli-manifest.d.ts.map +1 -0
- package/dist/internal/cli-manifest.js +37 -0
- package/dist/internal/cli-mcp-oauth.d.ts +51 -0
- package/dist/internal/cli-mcp-oauth.d.ts.map +1 -0
- package/dist/internal/cli-mcp-oauth.js +300 -0
- package/dist/internal/cli-mcp.d.ts +75 -0
- package/dist/internal/cli-mcp.d.ts.map +1 -0
- package/dist/internal/cli-mcp.js +659 -0
- package/dist/internal/cli-migrate.d.ts +18 -0
- package/dist/internal/cli-migrate.d.ts.map +1 -0
- package/dist/internal/cli-migrate.js +351 -0
- package/dist/internal/cli-pagerduty.d.ts +32 -0
- package/dist/internal/cli-pagerduty.d.ts.map +1 -0
- package/dist/internal/cli-pagerduty.js +242 -0
- package/dist/internal/cli-skills.d.ts +21 -0
- package/dist/internal/cli-skills.d.ts.map +1 -0
- package/dist/internal/cli-skills.js +65 -0
- package/dist/internal/cli-slack-manual.d.ts +41 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +296 -0
- package/dist/internal/cli-slack.d.ts +59 -0
- package/dist/internal/cli-slack.d.ts.map +1 -0
- package/dist/internal/cli-slack.js +708 -0
- package/dist/internal/cloud-merge.d.ts +25 -0
- package/dist/internal/cloud-merge.d.ts.map +1 -0
- package/dist/internal/cloud-merge.js +40 -0
- package/dist/internal/cloud-turn-usage.d.ts +34 -0
- package/dist/internal/cloud-turn-usage.d.ts.map +1 -0
- package/dist/internal/cloud-turn-usage.js +94 -0
- package/dist/internal/comment-safe.d.ts +8 -0
- package/dist/internal/comment-safe.d.ts.map +1 -0
- package/dist/internal/comment-safe.js +12 -0
- package/dist/internal/connection-env.d.ts +31 -0
- package/dist/internal/connection-env.d.ts.map +1 -0
- package/dist/internal/connection-env.js +83 -0
- package/dist/internal/continuation-channel.d.ts +48 -0
- package/dist/internal/continuation-channel.d.ts.map +1 -0
- package/dist/internal/continuation-channel.js +170 -0
- package/dist/internal/continuation-identity.d.ts +126 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +897 -0
- package/dist/internal/continuation.d.ts +3 -0
- package/dist/internal/continuation.d.ts.map +1 -0
- package/dist/internal/continuation.js +1 -0
- package/dist/internal/conversation-mirror.d.ts +72 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +401 -0
- package/dist/internal/conversation-pack.d.ts +29 -0
- package/dist/internal/conversation-pack.d.ts.map +1 -0
- package/dist/internal/conversation-pack.js +96 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts +10 -0
- package/dist/internal/convert-automation/convert-workflow.d.ts.map +1 -0
- package/dist/internal/convert-automation/convert-workflow.js +976 -0
- package/dist/internal/convert-automation/types.d.ts +202 -0
- package/dist/internal/convert-automation/types.d.ts.map +1 -0
- package/dist/internal/convert-automation/types.js +13 -0
- package/dist/internal/convert-grokbot/answers.d.ts +127 -0
- package/dist/internal/convert-grokbot/answers.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/answers.js +445 -0
- package/dist/internal/convert-grokbot/bot.d.ts +50 -0
- package/dist/internal/convert-grokbot/bot.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/bot.js +72 -0
- package/dist/internal/convert-grokbot/checks.d.ts +26 -0
- package/dist/internal/convert-grokbot/checks.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/checks.js +170 -0
- package/dist/internal/convert-grokbot/convert.d.ts +60 -0
- package/dist/internal/convert-grokbot/convert.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/convert.js +470 -0
- package/dist/internal/convert-grokbot/handoff.d.ts +44 -0
- package/dist/internal/convert-grokbot/handoff.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/handoff.js +160 -0
- package/dist/internal/convert-grokbot/recipe.d.ts +61 -0
- package/dist/internal/convert-grokbot/recipe.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/recipe.js +94 -0
- package/dist/internal/convert-grokbot/routine.d.ts +51 -0
- package/dist/internal/convert-grokbot/routine.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/routine.js +128 -0
- package/dist/internal/convert-grokbot/slack.d.ts +28 -0
- package/dist/internal/convert-grokbot/slack.d.ts.map +1 -0
- package/dist/internal/convert-grokbot/slack.js +50 -0
- package/dist/internal/cron.d.ts +17 -0
- package/dist/internal/cron.d.ts.map +1 -0
- package/dist/internal/cron.js +60 -0
- package/dist/internal/cursor/account-mcp.d.ts +135 -0
- package/dist/internal/cursor/account-mcp.d.ts.map +1 -0
- package/dist/internal/cursor/account-mcp.js +513 -0
- package/dist/internal/cursor/backend-client.d.ts +229 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +700 -0
- 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 +196 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +463 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts +37 -0
- package/dist/internal/cursor/cursor-api-transport.d.ts.map +1 -0
- package/dist/internal/cursor/cursor-api-transport.js +40 -0
- package/dist/internal/cursor/github-credentials.d.ts +44 -0
- package/dist/internal/cursor/github-credentials.d.ts.map +1 -0
- package/dist/internal/cursor/github-credentials.js +174 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +45 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +64 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +97 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +39 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +84 -0
- package/dist/internal/cursor/session-token.d.ts +45 -0
- package/dist/internal/cursor/session-token.d.ts.map +1 -0
- package/dist/internal/cursor/session-token.js +85 -0
- package/dist/internal/cursor/store-api-client.d.ts +60 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +189 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +70 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +233 -0
- package/dist/internal/cursor-agent-template.d.ts +9 -0
- package/dist/internal/cursor-agent-template.d.ts.map +1 -0
- package/dist/internal/cursor-agent-template.js +43 -0
- package/dist/internal/cursor-deployment-relay.d.ts +95 -0
- package/dist/internal/cursor-deployment-relay.d.ts.map +1 -0
- package/dist/internal/cursor-deployment-relay.js +212 -0
- package/dist/internal/cursor-event-relay.d.ts +243 -0
- package/dist/internal/cursor-event-relay.d.ts.map +1 -0
- package/dist/internal/cursor-event-relay.js +430 -0
- package/dist/internal/cursor-relay-core.d.ts +160 -0
- package/dist/internal/cursor-relay-core.d.ts.map +1 -0
- package/dist/internal/cursor-relay-core.js +442 -0
- package/dist/internal/deferred-channel-session.d.ts +21 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +55 -0
- package/dist/internal/deploy-client.d.ts +604 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +1009 -0
- package/dist/internal/deploy-manifest.d.ts +179 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +320 -0
- package/dist/internal/deploy-source.d.ts +38 -0
- package/dist/internal/deploy-source.d.ts.map +1 -0
- package/dist/internal/deploy-source.js +124 -0
- package/dist/internal/describe-error.d.ts +6 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +31 -0
- package/dist/internal/dev-mode.d.ts +13 -0
- package/dist/internal/dev-mode.d.ts.map +1 -0
- package/dist/internal/dev-mode.js +17 -0
- package/dist/internal/discovery/agent-config.d.ts +55 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +230 -0
- package/dist/internal/discovery/agent.d.ts +16 -0
- package/dist/internal/discovery/agent.d.ts.map +1 -0
- package/dist/internal/discovery/agent.js +347 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +88 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +430 -0
- package/dist/internal/discovery/context.d.ts +36 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +84 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +513 -0
- package/dist/internal/discovery/extension-overlay.d.ts +31 -0
- package/dist/internal/discovery/extension-overlay.d.ts.map +1 -0
- package/dist/internal/discovery/extension-overlay.js +142 -0
- package/dist/internal/discovery/extensions.d.ts +28 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +376 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +92 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +50 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +166 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +79 -0
- package/dist/internal/discovery/instrumentation.d.ts +10 -0
- package/dist/internal/discovery/instrumentation.d.ts.map +1 -0
- package/dist/internal/discovery/instrumentation.js +29 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +88 -0
- package/dist/internal/discovery/names.d.ts +14 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +39 -0
- package/dist/internal/discovery/project-public.d.ts +16 -0
- package/dist/internal/discovery/project-public.d.ts.map +1 -0
- package/dist/internal/discovery/project-public.js +54 -0
- package/dist/internal/discovery/project.d.ts +57 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +298 -0
- package/dist/internal/discovery/reminders.d.ts +7 -0
- package/dist/internal/discovery/reminders.d.ts.map +1 -0
- package/dist/internal/discovery/reminders.js +54 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +107 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +30 -0
- package/dist/internal/discovery/services.d.ts +27 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +122 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +139 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +113 -0
- package/dist/internal/discovery/tools.d.ts +18 -0
- package/dist/internal/discovery/tools.d.ts.map +1 -0
- package/dist/internal/discovery/tools.js +144 -0
- package/dist/internal/discovery.d.ts +15 -0
- package/dist/internal/discovery.d.ts.map +1 -0
- package/dist/internal/discovery.js +13 -0
- package/dist/internal/distribution.d.ts +65 -0
- package/dist/internal/distribution.d.ts.map +1 -0
- package/dist/internal/distribution.js +102 -0
- package/dist/internal/docs-site.d.ts +38 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +216 -0
- package/dist/internal/duration.d.ts +8 -0
- package/dist/internal/duration.d.ts.map +1 -0
- package/dist/internal/duration.js +35 -0
- package/dist/internal/env-file.d.ts +19 -0
- package/dist/internal/env-file.d.ts.map +1 -0
- package/dist/internal/env-file.js +74 -0
- package/dist/internal/estimate-cost.d.ts +55 -0
- package/dist/internal/estimate-cost.d.ts.map +1 -0
- package/dist/internal/estimate-cost.js +118 -0
- package/dist/internal/eval-judge-model.d.ts +64 -0
- package/dist/internal/eval-judge-model.d.ts.map +1 -0
- package/dist/internal/eval-judge-model.js +129 -0
- package/dist/internal/eval-run-store.d.ts +119 -0
- package/dist/internal/eval-run-store.d.ts.map +1 -0
- package/dist/internal/eval-run-store.js +479 -0
- package/dist/internal/eval-runner.d.ts +106 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +616 -0
- package/dist/internal/eval-transport.d.ts +24 -0
- package/dist/internal/eval-transport.d.ts.map +1 -0
- package/dist/internal/eval-transport.js +22 -0
- package/dist/internal/evals-client.d.ts +104 -0
- package/dist/internal/evals-client.d.ts.map +1 -0
- package/dist/internal/evals-client.js +299 -0
- package/dist/internal/event-log.d.ts +94 -0
- package/dist/internal/event-log.d.ts.map +1 -0
- package/dist/internal/event-log.js +302 -0
- package/dist/internal/event-mapper.d.ts +165 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +665 -0
- package/dist/internal/expected-delivery-failure.d.ts +3 -0
- package/dist/internal/expected-delivery-failure.d.ts.map +1 -0
- package/dist/internal/expected-delivery-failure.js +34 -0
- 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 +63 -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 +172 -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 +209 -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 +154 -0
- package/dist/internal/filesystem/nearest.d.ts +15 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +90 -0
- package/dist/internal/filesystem/scratch.d.ts +60 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +190 -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 +154 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts +39 -0
- package/dist/internal/filesystem/subagent-inherit.d.ts.map +1 -0
- package/dist/internal/filesystem/subagent-inherit.js +96 -0
- package/dist/internal/filesystem/tools.d.ts +48 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +648 -0
- package/dist/internal/filesystem/walk.d.ts +77 -0
- package/dist/internal/filesystem/walk.d.ts.map +1 -0
- package/dist/internal/filesystem/walk.js +283 -0
- package/dist/internal/framework-file-storage.d.ts +51 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +291 -0
- package/dist/internal/framework-storage-selection.d.ts +30 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +84 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +85 -0
- package/dist/internal/github-fanout.d.ts +32 -0
- package/dist/internal/github-fanout.d.ts.map +1 -0
- package/dist/internal/github-fanout.js +106 -0
- package/dist/internal/guest-network.d.ts +98 -0
- package/dist/internal/guest-network.d.ts.map +1 -0
- package/dist/internal/guest-network.js +313 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +98 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +194 -0
- package/dist/internal/hmac-secret-values.d.ts +48 -0
- package/dist/internal/hmac-secret-values.d.ts.map +1 -0
- package/dist/internal/hmac-secret-values.js +68 -0
- package/dist/internal/host-files.d.ts +29 -0
- package/dist/internal/host-files.d.ts.map +1 -0
- package/dist/internal/host-files.js +256 -0
- package/dist/internal/host-kv.d.ts +21 -0
- package/dist/internal/host-kv.d.ts.map +1 -0
- package/dist/internal/host-kv.js +62 -0
- package/dist/internal/host-otel.d.ts +26 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +184 -0
- package/dist/internal/host-platforms.d.ts +58 -0
- package/dist/internal/host-platforms.d.ts.map +1 -0
- package/dist/internal/host-platforms.js +118 -0
- package/dist/internal/hosted-admission-adapter.d.ts +36 -0
- package/dist/internal/hosted-admission-adapter.d.ts.map +1 -0
- package/dist/internal/hosted-admission-adapter.js +7 -0
- package/dist/internal/hosted-admission-context.d.ts +20 -0
- package/dist/internal/hosted-admission-context.d.ts.map +1 -0
- package/dist/internal/hosted-admission-context.js +31 -0
- package/dist/internal/hosted-catch-protocol.d.ts +54 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +90 -0
- package/dist/internal/hosted-catch.d.ts +42 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +154 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +275 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +708 -0
- package/dist/internal/hosted-delivery.d.ts +135 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +1098 -0
- package/dist/internal/hosted-eval-cases.d.ts +21 -0
- package/dist/internal/hosted-eval-cases.d.ts.map +1 -0
- package/dist/internal/hosted-eval-cases.js +162 -0
- package/dist/internal/hosted-execution-diag.d.ts +64 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +219 -0
- package/dist/internal/hosted-execution-flush.d.ts +65 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +113 -0
- package/dist/internal/hosted-execution-latency.d.ts +80 -0
- package/dist/internal/hosted-execution-latency.d.ts.map +1 -0
- package/dist/internal/hosted-execution-latency.js +226 -0
- package/dist/internal/hosted-managed-automation.d.ts +30 -0
- package/dist/internal/hosted-managed-automation.d.ts.map +1 -0
- package/dist/internal/hosted-managed-automation.js +83 -0
- package/dist/internal/hosting.d.ts +62 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +130 -0
- package/dist/internal/http-channel-define.d.ts +11 -0
- package/dist/internal/http-channel-define.d.ts.map +1 -0
- package/dist/internal/http-channel-define.js +21 -0
- package/dist/internal/http-channel.d.ts +54 -0
- package/dist/internal/http-channel.d.ts.map +1 -0
- package/dist/internal/http-channel.js +543 -0
- package/dist/internal/http-control-plane-session.d.ts +54 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +163 -0
- package/dist/internal/ids.d.ts +27 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +54 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts +10 -0
- package/dist/internal/incoming-headers-to-fetch.d.ts.map +1 -0
- package/dist/internal/incoming-headers-to-fetch.js +40 -0
- package/dist/internal/init-interview.d.ts +64 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +193 -0
- package/dist/internal/init-project.d.ts +188 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +492 -0
- package/dist/internal/init-scaffold.d.ts +20 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +194 -0
- package/dist/internal/inline-stdio-define-stub.d.ts +3 -0
- package/dist/internal/inline-stdio-define-stub.d.ts.map +1 -0
- package/dist/internal/inline-stdio-define-stub.js +4 -0
- package/dist/internal/inline-stdio-mcp.d.ts +34 -0
- package/dist/internal/inline-stdio-mcp.d.ts.map +1 -0
- package/dist/internal/inline-stdio-mcp.js +170 -0
- package/dist/internal/install-cursor-skills.d.ts +160 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +464 -0
- package/dist/internal/interview/agent-questions.d.ts +19 -0
- package/dist/internal/interview/agent-questions.d.ts.map +1 -0
- package/dist/internal/interview/agent-questions.js +120 -0
- package/dist/internal/interview/question.d.ts +82 -0
- package/dist/internal/interview/question.d.ts.map +1 -0
- package/dist/internal/interview/question.js +198 -0
- 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 +25 -0
- package/dist/internal/json-schema.d.ts.map +1 -0
- package/dist/internal/json-schema.js +69 -0
- package/dist/internal/legacy-command-guard.d.ts +24 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +47 -0
- package/dist/internal/listen-port.d.ts +22 -0
- package/dist/internal/listen-port.d.ts.map +1 -0
- package/dist/internal/listen-port.js +66 -0
- package/dist/internal/local-control-plane.d.ts +59 -0
- package/dist/internal/local-control-plane.d.ts.map +1 -0
- package/dist/internal/local-control-plane.js +341 -0
- package/dist/internal/local-env.d.ts +10 -0
- package/dist/internal/local-env.d.ts.map +1 -0
- package/dist/internal/local-env.js +55 -0
- package/dist/internal/local-ingress.d.ts +35 -0
- package/dist/internal/local-ingress.d.ts.map +1 -0
- package/dist/internal/local-ingress.js +50 -0
- package/dist/internal/log-ring.d.ts +23 -0
- package/dist/internal/log-ring.d.ts.map +1 -0
- package/dist/internal/log-ring.js +41 -0
- package/dist/internal/logs-client.d.ts +98 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +418 -0
- package/dist/internal/map-pool.d.ts +11 -0
- package/dist/internal/map-pool.d.ts.map +1 -0
- package/dist/internal/map-pool.js +34 -0
- package/dist/internal/mcp-endpoint.d.ts +84 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +566 -0
- package/dist/internal/mcp-host.d.ts +99 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +422 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts +68 -0
- package/dist/internal/mcp-oauth-on-demand.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-on-demand.js +250 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +76 -0
- package/dist/internal/mcp-oauth.d.ts +118 -0
- package/dist/internal/mcp-oauth.d.ts.map +1 -0
- package/dist/internal/mcp-oauth.js +393 -0
- package/dist/internal/memory-dir.d.ts +8 -0
- package/dist/internal/memory-dir.d.ts.map +1 -0
- package/dist/internal/memory-dir.js +7 -0
- package/dist/internal/model-config.d.ts +7 -0
- package/dist/internal/model-config.d.ts.map +1 -0
- package/dist/internal/model-config.js +67 -0
- package/dist/internal/named-webhook-secret.d.ts +39 -0
- package/dist/internal/named-webhook-secret.d.ts.map +1 -0
- package/dist/internal/named-webhook-secret.js +47 -0
- package/dist/internal/net.d.ts +5 -0
- package/dist/internal/net.d.ts.map +1 -0
- package/dist/internal/net.js +28 -0
- package/dist/internal/open-browser.d.ts +5 -0
- package/dist/internal/open-browser.d.ts.map +1 -0
- package/dist/internal/open-browser.js +33 -0
- package/dist/internal/otel/attrs.d.ts +7 -0
- package/dist/internal/otel/attrs.d.ts.map +1 -0
- package/dist/internal/otel/attrs.js +13 -0
- package/dist/internal/otel/collector.d.ts +50 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +765 -0
- package/dist/internal/otel/computer-use-attrs.d.ts +18 -0
- package/dist/internal/otel/computer-use-attrs.d.ts.map +1 -0
- package/dist/internal/otel/computer-use-attrs.js +30 -0
- package/dist/internal/otel/config.d.ts +59 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +236 -0
- package/dist/internal/otel/conversation-span-processor.d.ts +9 -0
- package/dist/internal/otel/conversation-span-processor.d.ts.map +1 -0
- package/dist/internal/otel/conversation-span-processor.js +34 -0
- package/dist/internal/otel/customer.d.ts +52 -0
- package/dist/internal/otel/customer.d.ts.map +1 -0
- package/dist/internal/otel/customer.js +727 -0
- package/dist/internal/otel/http.d.ts +13 -0
- package/dist/internal/otel/http.d.ts.map +1 -0
- package/dist/internal/otel/http.js +93 -0
- package/dist/internal/otel/mcp.d.ts +16 -0
- package/dist/internal/otel/mcp.d.ts.map +1 -0
- package/dist/internal/otel/mcp.js +46 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +41 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +92 -0
- package/dist/internal/otel/tool-error-class.d.ts +4 -0
- package/dist/internal/otel/tool-error-class.d.ts.map +1 -0
- package/dist/internal/otel/tool-error-class.js +36 -0
- package/dist/internal/otel-env.d.ts +6 -0
- package/dist/internal/otel-env.d.ts.map +1 -0
- package/dist/internal/otel-env.js +5 -0
- package/dist/internal/package-inline-stdio.d.ts +12 -0
- package/dist/internal/package-inline-stdio.d.ts.map +1 -0
- package/dist/internal/package-inline-stdio.js +107 -0
- package/dist/internal/peer-connections.d.ts +63 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +115 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts +57 -0
- package/dist/internal/persistent-stage-log-mirror.d.ts.map +1 -0
- package/dist/internal/persistent-stage-log-mirror.js +231 -0
- package/dist/internal/platform-schedule-sync.d.ts +17 -0
- package/dist/internal/platform-schedule-sync.d.ts.map +1 -0
- package/dist/internal/platform-schedule-sync.js +55 -0
- package/dist/internal/platform-timers.d.ts +42 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +251 -0
- package/dist/internal/playground/static.d.ts +52 -0
- package/dist/internal/playground/static.d.ts.map +1 -0
- package/dist/internal/playground/static.js +230 -0
- package/dist/internal/playground/toolchain.d.ts +57 -0
- package/dist/internal/playground/toolchain.d.ts.map +1 -0
- package/dist/internal/playground/toolchain.js +213 -0
- package/dist/internal/playground-proxy.d.ts +69 -0
- package/dist/internal/playground-proxy.d.ts.map +1 -0
- package/dist/internal/playground-proxy.js +434 -0
- package/dist/internal/process-memory-telemetry.d.ts +89 -0
- package/dist/internal/process-memory-telemetry.d.ts.map +1 -0
- package/dist/internal/process-memory-telemetry.js +226 -0
- package/dist/internal/project-layout.d.ts +7 -0
- package/dist/internal/project-layout.d.ts.map +1 -0
- package/dist/internal/project-layout.js +24 -0
- package/dist/internal/prompt-context.d.ts +38 -0
- package/dist/internal/prompt-context.d.ts.map +1 -0
- package/dist/internal/prompt-context.js +86 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +196 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +279 -0
- package/dist/internal/reminder-runner.d.ts +223 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1241 -0
- package/dist/internal/reminder-schedule.d.ts +26 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +83 -0
- package/dist/internal/reminder-store.d.ts +78 -0
- package/dist/internal/reminder-store.d.ts.map +1 -0
- package/dist/internal/reminder-store.js +105 -0
- package/dist/internal/request-error-status.d.ts +14 -0
- package/dist/internal/request-error-status.d.ts.map +1 -0
- package/dist/internal/request-error-status.js +77 -0
- package/dist/internal/request-headers.d.ts +11 -0
- package/dist/internal/request-headers.d.ts.map +1 -0
- package/dist/internal/request-headers.js +14 -0
- package/dist/internal/resolve-prod-target.d.ts +76 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +215 -0
- package/dist/internal/resolved-connections.d.ts +65 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +108 -0
- package/dist/internal/router.d.ts +33 -0
- package/dist/internal/router.d.ts.map +1 -0
- package/dist/internal/router.js +93 -0
- package/dist/internal/run-client.d.ts +78 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +369 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +25 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +35 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts +20 -0
- package/dist/internal/sanitize-mcp-tool-name.d.ts.map +1 -0
- package/dist/internal/sanitize-mcp-tool-name.js +28 -0
- package/dist/internal/schedule-runner.d.ts +42 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +157 -0
- package/dist/internal/scm/pr-url.d.ts +56 -0
- package/dist/internal/scm/pr-url.d.ts.map +1 -0
- package/dist/internal/scm/pr-url.js +153 -0
- package/dist/internal/sdk-runner.d.ts +204 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +1006 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts +9 -0
- package/dist/internal/sdk-subagent-inherit-support.d.ts.map +1 -0
- package/dist/internal/sdk-subagent-inherit-support.js +89 -0
- package/dist/internal/secret-alternatives.d.ts +11 -0
- package/dist/internal/secret-alternatives.d.ts.map +1 -0
- package/dist/internal/secret-alternatives.js +13 -0
- package/dist/internal/serve-restart.d.ts +42 -0
- package/dist/internal/serve-restart.d.ts.map +1 -0
- package/dist/internal/serve-restart.js +72 -0
- package/dist/internal/server.d.ts +45 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2566 -0
- package/dist/internal/session-cost.d.ts +49 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +147 -0
- package/dist/internal/session-engine.d.ts +955 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4880 -0
- package/dist/internal/session-links.d.ts +14 -0
- package/dist/internal/session-links.d.ts.map +1 -0
- package/dist/internal/session-links.js +64 -0
- package/dist/internal/session-live-publisher.d.ts +48 -0
- package/dist/internal/session-live-publisher.d.ts.map +1 -0
- package/dist/internal/session-live-publisher.js +415 -0
- package/dist/internal/session-run-log.d.ts +108 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +398 -0
- package/dist/internal/session-store.d.ts +73 -0
- package/dist/internal/session-store.d.ts.map +1 -0
- package/dist/internal/session-store.js +279 -0
- package/dist/internal/session-urls.d.ts +10 -0
- package/dist/internal/session-urls.d.ts.map +1 -0
- package/dist/internal/session-urls.js +25 -0
- package/dist/internal/sessions-client.d.ts +63 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +215 -0
- package/dist/internal/skill-catalog.d.ts +28 -0
- package/dist/internal/skill-catalog.d.ts.map +1 -0
- package/dist/internal/skill-catalog.js +36 -0
- package/dist/internal/skills-sync.d.ts +22 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +40 -0
- package/dist/internal/slack-provision-client.d.ts +199 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +320 -0
- package/dist/internal/slack-thread-key.d.ts +7 -0
- package/dist/internal/slack-thread-key.d.ts.map +1 -0
- package/dist/internal/slack-thread-key.js +10 -0
- 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/slug.d.ts +12 -0
- package/dist/internal/slug.d.ts.map +1 -0
- package/dist/internal/slug.js +38 -0
- package/dist/internal/sqlite-experimental-warning.d.ts +2 -0
- package/dist/internal/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/internal/sqlite-experimental-warning.js +22 -0
- package/dist/internal/start-log-store.d.ts +53 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +155 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +17 -0
- package/dist/internal/storage-coordinator.d.ts +200 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +747 -0
- package/dist/internal/storage-roles.d.ts +83 -0
- package/dist/internal/storage-roles.d.ts.map +1 -0
- package/dist/internal/storage-roles.js +24 -0
- package/dist/internal/storage.d.ts +2 -0
- package/dist/internal/storage.d.ts.map +1 -0
- package/dist/internal/storage.js +1 -0
- package/dist/internal/store-api-protocol.d.ts +164 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +145 -0
- package/dist/internal/store-mirror.d.ts +28 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +54 -0
- package/dist/internal/stream-progress.d.ts +14 -0
- package/dist/internal/stream-progress.d.ts.map +1 -0
- package/dist/internal/stream-progress.js +231 -0
- package/dist/internal/terminal-style.d.ts +40 -0
- package/dist/internal/terminal-style.d.ts.map +1 -0
- package/dist/internal/terminal-style.js +93 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts +53 -0
- package/dist/internal/testing/conversation-identity-vectors.d.ts.map +1 -0
- package/dist/internal/testing/conversation-identity-vectors.js +170 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +64 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +55 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts +38 -0
- package/dist/internal/testing/hmac-secret-vectors.d.ts.map +1 -0
- package/dist/internal/testing/hmac-secret-vectors.js +89 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts +42 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/pagerduty-continuation-fixtures.js +175 -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 +257 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts +26 -0
- package/dist/internal/testing/slack-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/slack-continuation-fixtures.js +136 -0
- package/dist/internal/tool-call-retry.d.ts +87 -0
- package/dist/internal/tool-call-retry.d.ts.map +1 -0
- package/dist/internal/tool-call-retry.js +387 -0
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +76 -0
- package/dist/internal/tool-policy.d.ts +110 -0
- package/dist/internal/tool-policy.d.ts.map +1 -0
- package/dist/internal/tool-policy.js +138 -0
- package/dist/internal/tool-result.d.ts +20 -0
- package/dist/internal/tool-result.d.ts.map +1 -0
- package/dist/internal/tool-result.js +50 -0
- package/dist/internal/trajectory.d.ts +68 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +336 -0
- package/dist/internal/turn-governor.d.ts +54 -0
- package/dist/internal/turn-governor.d.ts.map +1 -0
- package/dist/internal/turn-governor.js +108 -0
- package/dist/internal/turn-lease-store.d.ts +51 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +172 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +65 -0
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +401 -0
- package/dist/internal/v2-hosting.d.ts +34 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +35 -0
- package/dist/internal/workspace-sync.d.ts +44 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +85 -0
- package/dist/internal/workspace.d.ts +155 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +468 -0
- package/dist/internal/zod-schema.d.ts +14 -0
- package/dist/internal/zod-schema.d.ts.map +1 -0
- package/dist/internal/zod-schema.js +22 -0
- package/dist/internal/zod3-datetime.d.ts +12 -0
- package/dist/internal/zod3-datetime.d.ts.map +1 -0
- package/dist/internal/zod3-datetime.js +17 -0
- package/dist/kv/memory-kv.d.ts +24 -0
- package/dist/kv/memory-kv.d.ts.map +1 -0
- package/dist/kv/memory-kv.js +80 -0
- package/dist/kv.d.ts +18 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +16 -0
- package/dist/memory.d.ts +113 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +312 -0
- package/dist/otel-public.d.ts +6 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +31 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +146 -0
- package/dist/playground/assets/cursor-icons-16-DfKNljMZ.woff2 +0 -0
- package/dist/playground/assets/index-B3_YohwW.js +62 -0
- package/dist/playground/assets/index-Cn3-adsJ.css +1 -0
- package/dist/playground/index.html +17 -0
- package/dist/prompt.d.ts +39 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +68 -0
- package/dist/public-deprecated.d.ts +36 -0
- package/dist/public-deprecated.d.ts.map +1 -0
- package/dist/public-deprecated.js +39 -0
- package/dist/reminders.d.ts +42 -0
- package/dist/reminders.d.ts.map +1 -0
- package/dist/reminders.js +45 -0
- package/dist/schedules.d.ts +23 -0
- package/dist/schedules.d.ts.map +1 -0
- package/dist/schedules.js +26 -0
- package/dist/skills.d.ts +22 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +22 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts +54 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +113 -0
- package/dist/storage-backends/cursor-hosted.d.ts +94 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +225 -0
- package/dist/storage-backends/file-kv.d.ts +42 -0
- package/dist/storage-backends/file-kv.d.ts.map +1 -0
- package/dist/storage-backends/file-kv.js +226 -0
- package/dist/storage-protocol.d.ts +124 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +181 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +145 -0
- package/dist/tools.d.ts +135 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +78 -0
- package/dist/types.d.ts +3804 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +191 -0
- package/docs/README.md +115 -0
- package/docs/building-with-agents.md +139 -0
- package/docs/changelog.md +119 -0
- package/docs/deployment.md +314 -0
- package/docs/evals.md +244 -0
- package/docs/guides/agent-to-agent.md +167 -0
- package/docs/guides/bitbucket.md +298 -0
- package/docs/guides/cloud-agents.md +86 -0
- package/docs/guides/convert-automation.md +185 -0
- package/docs/guides/export-grokbot.md +244 -0
- package/docs/guides/github.md +378 -0
- package/docs/guides/gitlab.md +304 -0
- package/docs/guides/grokbot-agents.md +140 -0
- package/docs/guides/hooks.md +121 -0
- package/docs/guides/improve.md +134 -0
- package/docs/guides/jev.md +303 -0
- package/docs/guides/mcp-oauth.md +153 -0
- package/docs/guides/migrate.md +169 -0
- package/docs/guides/opentelemetry.md +205 -0
- package/docs/guides/pagerduty.md +341 -0
- package/docs/guides/slack.md +314 -0
- package/docs/guides/webhooks.md +255 -0
- package/docs/hillclimbing.md +139 -0
- package/docs/quickstart.md +312 -0
- package/docs/reference/agent-config.md +243 -0
- package/docs/reference/artifacts.md +118 -0
- package/docs/reference/channels.md +219 -0
- package/docs/reference/cli.md +1103 -0
- package/docs/reference/connections.md +312 -0
- package/docs/reference/evals.md +299 -0
- package/docs/reference/extensions.md +214 -0
- package/docs/reference/hooks.md +202 -0
- package/docs/reference/http-api.md +226 -0
- package/docs/reference/instructions.md +69 -0
- package/docs/reference/memory.md +119 -0
- package/docs/reference/playground.md +41 -0
- package/docs/reference/project-layout.md +122 -0
- package/docs/reference/prompt.md +52 -0
- package/docs/reference/schedules.md +195 -0
- package/docs/reference/sessions.md +205 -0
- package/docs/reference/skills.md +77 -0
- package/docs/reference/subagents.md +66 -0
- package/docs/reference/tools.md +311 -0
- package/docs/templates/agentic-owners.md +131 -0
- package/docs/templates/grokbot-agents.md +60 -0
- package/docs/templates/security-reviewer.md +86 -0
- package/docs/templates/thermo-quality-review.md +80 -0
- package/docs/templates/thermo-review.md +80 -0
- package/docs/templates/triage.md +106 -0
- package/docs/troubleshooting.md +154 -0
- package/package.json +429 -4
- package/schemas/grokbot-answers.schema.json +354 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +175 -0
- package/skills/debug/SKILL.md +43 -0
- package/skills/deploy/SKILL.md +169 -0
- package/skills/evals/SKILL.md +145 -0
- package/skills/framework-map/SKILL.md +128 -0
- package/skills/github/SKILL.md +133 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +60 -0
- package/skills/migrate-v2/SKILL.md +397 -0
- package/skills/otel/SKILL.md +48 -0
- package/skills/setup-slack/SKILL.md +136 -0
- package/templates/agentic-owners/README.md +78 -0
- package/templates/agentic-owners/bot/agent.ts +8 -0
- package/templates/agentic-owners/bot/channels/github.ts +63 -0
- package/templates/agentic-owners/bot/instructions.md +34 -0
- package/templates/agentic-owners/bot/lib/config.ts +5 -0
- package/templates/agentic-owners/bot/lib/github.ts +219 -0
- package/templates/agentic-owners/bot/lib/owners/README.md +50 -0
- package/templates/agentic-owners/bot/lib/owners/constants.ts +22 -0
- package/templates/agentic-owners/bot/lib/owners/decision.ts +480 -0
- package/templates/agentic-owners/bot/lib/owners/globalOverride.ts +60 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +287 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +147 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +696 -0
- package/templates/agentic-owners/bot/lib/owners/policyMode.ts +57 -0
- package/templates/agentic-owners/bot/lib/owners/prompt.ts +64 -0
- package/templates/agentic-owners/bot/lib/owners/prompts/base-review.md +105 -0
- package/templates/agentic-owners/bot/lib/owners/types.ts +73 -0
- package/templates/agentic-owners/bot/lib/review.ts +723 -0
- package/templates/agentic-owners/bot/tools/record_review.ts +62 -0
- package/templates/agentic-owners/evals/evals.config.ts +5 -0
- package/templates/agentic-owners/evals/owners.eval.ts +111 -0
- package/templates/agentic-owners/package.json +20 -0
- package/templates/agentic-owners/tsconfig.json +12 -0
- package/templates/agents-md/README.md +43 -0
- package/templates/agents-md/bot/agent.ts +8 -0
- package/templates/agents-md/bot/channels/github.ts +10 -0
- package/templates/agents-md/bot/channels/queue.ts +23 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +38 -0
- package/templates/agents-md/bot/lib/collect.ts +412 -0
- package/templates/agents-md/bot/lib/config.ts +8 -0
- package/templates/agents-md/bot/lib/paths.ts +49 -0
- package/templates/agents-md/bot/schedules/weekly.ts +17 -0
- package/templates/agents-md/bot/tools/apply_agents.ts +217 -0
- package/templates/agents-md/evals/agents.eval.ts +136 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/templates/code-wiki/README.md +34 -0
- package/templates/code-wiki/bot/agent.ts +8 -0
- package/templates/code-wiki/bot/channels/github.ts +125 -0
- package/templates/code-wiki/bot/instructions.md +39 -0
- package/templates/code-wiki/bot/lib/repos.ts +5 -0
- package/templates/code-wiki/bot/lib/wiki.ts +22 -0
- package/templates/code-wiki/bot/tools/apply_wiki.ts +210 -0
- package/templates/code-wiki/evals/evals.config.ts +5 -0
- package/templates/code-wiki/evals/wiki.eval.ts +124 -0
- package/templates/code-wiki/init.json +25 -0
- package/templates/code-wiki/package.json +18 -0
- package/templates/code-wiki/tsconfig.json +12 -0
- package/templates/demo/README.md +37 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +52 -0
- package/templates/demo/bot/channels/queue.ts +24 -0
- package/templates/demo/bot/instructions.md +8 -0
- package/templates/demo/bot/lib/collect.ts +66 -0
- package/templates/demo/bot/lib/repos.ts +5 -0
- package/templates/demo/bot/tools/record_demo.ts +37 -0
- package/templates/demo/evals/demo.eval.ts +29 -0
- package/templates/demo/evals/evals.config.ts +5 -0
- package/templates/demo/init.json +25 -0
- package/templates/demo/package.json +18 -0
- package/templates/demo/tsconfig.json +12 -0
- package/templates/grokbot-agents/README.md +27 -0
- package/templates/grokbot-agents/bot/agent.ts +6 -0
- package/templates/grokbot-agents/bot/extensions/grokbot.ts +5 -0
- package/templates/grokbot-agents/bot/instructions.md +7 -0
- package/templates/grokbot-agents/evals/evals.config.ts +5 -0
- package/templates/grokbot-agents/evals/grokbot-agents.eval.ts +18 -0
- package/templates/grokbot-agents/init.json +18 -0
- package/templates/grokbot-agents/package.json +17 -0
- package/templates/grokbot-agents/tsconfig.json +12 -0
- package/templates/pr-autofixer/bot/agent.ts +11 -0
- package/templates/pr-autofixer/bot/channels/drive.ts +24 -0
- package/templates/pr-autofixer/bot/channels/github.ts +155 -0
- package/templates/pr-autofixer/bot/channels/slack.ts +16 -0
- package/templates/pr-autofixer/bot/hooks/bind-agent.ts +19 -0
- package/templates/pr-autofixer/bot/instructions.md +83 -0
- package/templates/pr-autofixer/bot/lib/affinity.ts +24 -0
- package/templates/pr-autofixer/bot/lib/drive-schemas.ts +18 -0
- package/templates/pr-autofixer/bot/lib/drive.ts +73 -0
- package/templates/pr-autofixer/bot/lib/merge-watch.ts +116 -0
- package/templates/pr-autofixer/bot/lib/pr-state.ts +40 -0
- package/templates/pr-autofixer/bot/lib/repos.ts +18 -0
- package/templates/pr-autofixer/bot/lib/start-drive.ts +113 -0
- package/templates/pr-autofixer/bot/lib/webhook-buffer.ts +215 -0
- package/templates/pr-autofixer/bot/lib/webhook-routing.ts +231 -0
- package/templates/pr-autofixer/bot/tools/drive_pr.ts +21 -0
- package/templates/pr-autofixer/evals/coordinator.eval.ts +16 -0
- package/templates/pr-autofixer/evals/evals.config.ts +5 -0
- package/templates/pr-autofixer/init.json +25 -0
- package/templates/pr-autofixer/package.json +18 -0
- package/templates/pr-autofixer/tsconfig.json +12 -0
- package/templates/security-help/README.md +46 -0
- package/templates/security-help/bot/agent.ts +17 -0
- package/templates/security-help/bot/channels/github.ts +13 -0
- package/templates/security-help/bot/channels/slack.ts +84 -0
- package/templates/security-help/bot/instructions.md +19 -0
- package/templates/security-help/bot/lib/pr-first-pass.ts +40 -0
- package/templates/security-help/bot/lib/repos.ts +5 -0
- package/templates/security-help/bot/skills/access-request.md +10 -0
- package/templates/security-help/bot/skills/faq.md +31 -0
- package/templates/security-help/bot/skills/security-playbooks.md +12 -0
- package/templates/security-help/bot/skills/security-pr-first-pass.md +12 -0
- package/templates/security-help/evals/evals.config.ts +5 -0
- package/templates/security-help/evals/security-help.eval.ts +51 -0
- package/templates/security-help/init.json +31 -0
- package/templates/security-help/package.json +17 -0
- package/templates/security-help/tsconfig.json +12 -0
- package/templates/security-reviewer/README.md +33 -0
- package/templates/security-reviewer/bot/agent.ts +8 -0
- package/templates/security-reviewer/bot/channels/github.ts +43 -0
- package/templates/security-reviewer/bot/instructions.md +22 -0
- package/templates/security-reviewer/bot/lib/repos.ts +5 -0
- package/templates/security-reviewer/bot/tools/post_findings.ts +68 -0
- package/templates/security-reviewer/evals/evals.config.ts +5 -0
- package/templates/security-reviewer/evals/review.eval.ts +50 -0
- package/templates/security-reviewer/init.json +25 -0
- package/templates/security-reviewer/package.json +18 -0
- package/templates/security-reviewer/tsconfig.json +12 -0
- package/templates/thermo-quality-review/README.md +35 -0
- package/templates/thermo-quality-review/bot/agent.ts +8 -0
- package/templates/thermo-quality-review/bot/channels/github.ts +39 -0
- package/templates/thermo-quality-review/bot/instructions.md +43 -0
- package/templates/thermo-quality-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-quality-review/evals/evals.config.ts +5 -0
- package/templates/thermo-quality-review/evals/review.eval.ts +59 -0
- package/templates/thermo-quality-review/package.json +18 -0
- package/templates/thermo-quality-review/tsconfig.json +12 -0
- package/templates/thermo-review/README.md +35 -0
- package/templates/thermo-review/bot/agent.ts +8 -0
- package/templates/thermo-review/bot/channels/github.ts +39 -0
- package/templates/thermo-review/bot/instructions.md +40 -0
- package/templates/thermo-review/bot/tools/post_findings.ts +67 -0
- package/templates/thermo-review/evals/evals.config.ts +5 -0
- package/templates/thermo-review/evals/review.eval.ts +50 -0
- package/templates/thermo-review/package.json +18 -0
- package/templates/thermo-review/tsconfig.json +12 -0
- package/templates/triage/README.md +47 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +29 -0
- package/templates/triage/bot/channels/webhook.ts +41 -0
- package/templates/triage/bot/hooks/memory.ts +3 -0
- package/templates/triage/bot/instructions.md +38 -0
- package/templates/triage/bot/lib/actuate.ts +703 -0
- package/templates/triage/bot/lib/parse-queue-event.ts +160 -0
- package/templates/triage/bot/lib/tracker.ts +5 -0
- package/templates/triage/bot/lib/types.ts +48 -0
- package/templates/triage/bot/lib/verify-webhook.ts +79 -0
- package/templates/triage/bot/skills/triage-rubric.md +44 -0
- package/templates/triage/bot/tools/record_triage.ts +29 -0
- package/templates/triage/evals/evals.config.ts +5 -0
- package/templates/triage/evals/triage.eval.ts +64 -0
- package/templates/triage/overlays/jira/README.md +21 -0
- package/templates/triage/overlays/jira/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/jira/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/overlays/linear/README.md +21 -0
- package/templates/triage/overlays/linear/bot/lib/tracker.ts +8 -0
- package/templates/triage/overlays/linear/bot/mcp-connections/tracker.ts +6 -0
- package/templates/triage/package.json +18 -0
- package/templates/triage/tsconfig.json +12 -0
|
@@ -0,0 +1,2089 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { allowAll, defineChannel, hmacSignatureAuth, localDevStrict, loopbackGitHubDev, POST, } from "../../channels.js";
|
|
3
|
+
import { acknowledgeTask, acknowledgeTurn, isTaskDispatch, scheduleAfterAck, skipped, turnStarted, withPropagatingBackgroundErrors, } from "../../internal/channel-dispatch.js";
|
|
4
|
+
import { continuationSource, normalizeIdentity } from "../../internal/continuation-identity.js";
|
|
5
|
+
import { isDevMode } from "../../internal/dev-mode.js";
|
|
6
|
+
import { hmacSignatureMatchesAny, parseHmacSecrets } from "../../internal/hmac-secret-values.js";
|
|
7
|
+
import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
|
|
8
|
+
import { CATCH_DELIVERY_ID_HEADER, replayCatchRequest } from "../../internal/hosted-catch.js";
|
|
9
|
+
import { AGENT_SDK_CATCH_EVENT_TYPE } from "../../internal/hosted-catch-protocol.js";
|
|
10
|
+
import { bindLocalIngressSend } from "../../internal/local-ingress.js";
|
|
11
|
+
import { envSecretRef, namedWebhookSecretArchitectureError, } from "../../internal/named-webhook-secret.js";
|
|
12
|
+
import { isSecretRef, } from "../../types.js";
|
|
13
|
+
import { resolveCredentialValue } from "./auth.js";
|
|
14
|
+
import { buildGitHubBinding, } from "./binding.js";
|
|
15
|
+
import { createCursorAccountGithubTokenResolver, createPendingCursorGithubCredentials, cursorGithubPermissionsForChannel, isCursorAccountGithubTokenResolver, parseCursorGithubRepoScope, registerGithubCursorAccountRuntime, } from "./cursor-account.js";
|
|
16
|
+
import { buildDefaultGitHubEvents } from "./defaults.js";
|
|
17
|
+
import { deriveGitHubWebhookEvents, GITHUB_CHANNEL_KIND } from "./events.js";
|
|
18
|
+
import { emptyGitHubChannelState, githubBindingStateForEvent, } from "./state.js";
|
|
19
|
+
const DEFAULT_PULL_REQUEST_ACTIONS = new Set([
|
|
20
|
+
"opened",
|
|
21
|
+
"reopened",
|
|
22
|
+
"synchronize",
|
|
23
|
+
"ready_for_review",
|
|
24
|
+
]);
|
|
25
|
+
const repositorySchema = z.object({
|
|
26
|
+
id: z.number().optional(),
|
|
27
|
+
full_name: z.string().min(1),
|
|
28
|
+
html_url: z.string().url(),
|
|
29
|
+
name: z.string().optional(),
|
|
30
|
+
owner: z
|
|
31
|
+
.object({
|
|
32
|
+
login: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
});
|
|
36
|
+
const senderSchema = z
|
|
37
|
+
.object({
|
|
38
|
+
login: z.string().min(1).optional(),
|
|
39
|
+
id: z.number().optional(),
|
|
40
|
+
type: z.string().optional(),
|
|
41
|
+
})
|
|
42
|
+
.nullable()
|
|
43
|
+
.optional();
|
|
44
|
+
const installationSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
id: z.number().optional(),
|
|
47
|
+
})
|
|
48
|
+
.nullable()
|
|
49
|
+
.optional();
|
|
50
|
+
const githubPullRequestPayloadSchema = z.object({
|
|
51
|
+
action: z.string().min(1),
|
|
52
|
+
repository: repositorySchema,
|
|
53
|
+
pull_request: z.object({
|
|
54
|
+
number: z.number().int().positive(),
|
|
55
|
+
html_url: z.string().url(),
|
|
56
|
+
title: z.string(),
|
|
57
|
+
body: z.string().nullable().optional(),
|
|
58
|
+
draft: z.boolean().optional(),
|
|
59
|
+
merged: z.boolean().optional(),
|
|
60
|
+
user: z
|
|
61
|
+
.object({
|
|
62
|
+
login: z.string().min(1).optional(),
|
|
63
|
+
id: z.number().optional(),
|
|
64
|
+
type: z.string().optional(),
|
|
65
|
+
})
|
|
66
|
+
.nullable()
|
|
67
|
+
.optional(),
|
|
68
|
+
head: z.object({
|
|
69
|
+
ref: z.string().min(1),
|
|
70
|
+
sha: z.string().min(1),
|
|
71
|
+
}),
|
|
72
|
+
base: z.object({
|
|
73
|
+
ref: z.string().min(1),
|
|
74
|
+
sha: z.string().optional(),
|
|
75
|
+
}),
|
|
76
|
+
}),
|
|
77
|
+
changes: z
|
|
78
|
+
.object({
|
|
79
|
+
base: z
|
|
80
|
+
.object({
|
|
81
|
+
ref: z.object({ from: z.string().min(1).optional() }).optional(),
|
|
82
|
+
})
|
|
83
|
+
.optional(),
|
|
84
|
+
})
|
|
85
|
+
.nullable()
|
|
86
|
+
.optional(),
|
|
87
|
+
sender: senderSchema,
|
|
88
|
+
installation: installationSchema,
|
|
89
|
+
label: z
|
|
90
|
+
.object({
|
|
91
|
+
name: z.string().min(1),
|
|
92
|
+
})
|
|
93
|
+
.nullable()
|
|
94
|
+
.optional(),
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Derive the turn's auth from the actor that triggered the delivery — the
|
|
98
|
+
* standard `{ auth: defaultGitHubAuth(ctx) }` dispatch from an inbound hook.
|
|
99
|
+
*/
|
|
100
|
+
export function defaultGitHubAuth(ctx) {
|
|
101
|
+
const senderId = ctx.sender?.id;
|
|
102
|
+
return {
|
|
103
|
+
authenticator: "github-webhook",
|
|
104
|
+
principalId: senderId !== undefined ? `github:${senderId}` : (ctx.senderLogin ?? "github"),
|
|
105
|
+
principalType: ctx.sender?.type === "Bot" ? "service" : "user",
|
|
106
|
+
attributes: {
|
|
107
|
+
conversation_kind: ctx.conversation.kind,
|
|
108
|
+
...(ctx.deliveryId === undefined ? {} : { delivery_id: ctx.deliveryId }),
|
|
109
|
+
...(ctx.installationId === undefined ? {} : { installation_id: String(ctx.installationId) }),
|
|
110
|
+
repository: ctx.repository.fullName,
|
|
111
|
+
...(ctx.repository.id === undefined ? {} : { repository_id: String(ctx.repository.id) }),
|
|
112
|
+
...(ctx.senderLogin === undefined ? {} : { user_login: ctx.senderLogin }),
|
|
113
|
+
...(ctx.sender?.type === undefined ? {} : { user_type: ctx.sender.type }),
|
|
114
|
+
...(ctx.repository.owner === "" ? {} : { issuer: `github:${ctx.repository.owner}` }),
|
|
115
|
+
...(ctx.senderLogin === undefined ? {} : { subject: ctx.senderLogin }),
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export function githubContinuationKey(ctx) {
|
|
120
|
+
const kind = ctx.conversation.kind === "issue" ? "github-issue" : "github-pr";
|
|
121
|
+
return `${kind}:${ctx.repository.fullName}#${ctx.conversation.number}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Recover the pull request a session is pinned to from its continuation key,
|
|
125
|
+
* without trusting model-provided identifiers. Accepts `cont:github-pr:owner/repo#N`
|
|
126
|
+
* (`architecture: "v2"`, the default) and `github-pr:owner/repo#N` (`"v1"`).
|
|
127
|
+
* Undefined for any session not pinned to a pull request.
|
|
128
|
+
*/
|
|
129
|
+
export function parseGitHubPrContinuationKey(key) {
|
|
130
|
+
const match = /^(?:cont:)?github-pr:([^/#\s]+)\/([^#\s]+)#(\d+)$/.exec(key);
|
|
131
|
+
if (match === null) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
owner: match[1],
|
|
136
|
+
repo: match[2],
|
|
137
|
+
number: Number(match[3]),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export function defaultGitHubTitle(ctx) {
|
|
141
|
+
return `GitHub ${ctx.repository.fullName}#${ctx.conversation.number}`;
|
|
142
|
+
}
|
|
143
|
+
export function defaultGitHubPullRequestMessage(ctx, pullRequest) {
|
|
144
|
+
return [
|
|
145
|
+
`GitHub pull request trigger: ${ctx.repository.fullName}#${pullRequest.number}`,
|
|
146
|
+
`Action: ${pullRequest.action}`,
|
|
147
|
+
`PR: ${pullRequest.url}`,
|
|
148
|
+
`Title: ${pullRequest.title}`,
|
|
149
|
+
`Head: ${pullRequest.headRef} (${pullRequest.headSha})`,
|
|
150
|
+
`Base: ${pullRequest.baseRef}`,
|
|
151
|
+
...(pullRequest.authorLogin === undefined ? [] : [`Author: ${pullRequest.authorLogin}`]),
|
|
152
|
+
...(ctx.senderLogin === undefined ? [] : [`Sender: ${ctx.senderLogin}`]),
|
|
153
|
+
"",
|
|
154
|
+
"Handle this pull request event.",
|
|
155
|
+
].join("\n");
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Default dispatch gate when no `onPullRequest` hook is declared: the common
|
|
159
|
+
* review triggers start a turn as the delivery's actor.
|
|
160
|
+
*
|
|
161
|
+
* Eve has no default for `onPullRequest` (opt-in only). Agent-serve keeps this
|
|
162
|
+
* gate for backward compatibility with existing demos.
|
|
163
|
+
*/
|
|
164
|
+
export function defaultGitHubPullRequestDispatch(ctx, pullRequest) {
|
|
165
|
+
if (!DEFAULT_PULL_REQUEST_ACTIONS.has(pullRequest.action)) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return { auth: defaultGitHubAuth(ctx) };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Default comment hook (Eve-compatible): dispatch only when the comment
|
|
172
|
+
* `@mention`s {@link botName}.
|
|
173
|
+
*/
|
|
174
|
+
export function defaultOnComment(ctx, comment, options) {
|
|
175
|
+
if (!shouldDispatchGitHubComment({
|
|
176
|
+
body: comment.body,
|
|
177
|
+
author: comment.author,
|
|
178
|
+
botName: options.botName,
|
|
179
|
+
})) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
return { auth: defaultGitHubAuth(ctx) };
|
|
183
|
+
}
|
|
184
|
+
export function shouldDispatchGitHubComment(args) {
|
|
185
|
+
const botName = args.botName?.trim();
|
|
186
|
+
if (botName === undefined || botName === "") {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
if (isGitHubAppBotAuthor(args.author, botName)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
const mention = new RegExp(`(^|\\W)@${escapeRegExp(botName)}\\b`, "i");
|
|
193
|
+
return mention.test(args.body);
|
|
194
|
+
}
|
|
195
|
+
export function extractGitHubCommentTrigger(args) {
|
|
196
|
+
const botName = args.botName?.trim();
|
|
197
|
+
if (botName === undefined || botName === "") {
|
|
198
|
+
const trimmed = args.body.trim();
|
|
199
|
+
return trimmed === "" ? undefined : { message: trimmed };
|
|
200
|
+
}
|
|
201
|
+
const mention = new RegExp(`@${escapeRegExp(botName)}\\b[,:]?\\s*`, "i");
|
|
202
|
+
const stripped = args.body.replace(mention, "").trim();
|
|
203
|
+
if (stripped === "") {
|
|
204
|
+
return { message: args.body.trim() };
|
|
205
|
+
}
|
|
206
|
+
return { message: stripped };
|
|
207
|
+
}
|
|
208
|
+
export function parseGitHubPullRequestEvent(args) {
|
|
209
|
+
const parsed = githubPullRequestPayloadSchema.safeParse(args.payload);
|
|
210
|
+
if (!parsed.success) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
const payload = parsed.data;
|
|
214
|
+
const repository = toRepositoryRef(payload.repository);
|
|
215
|
+
const sender = toUser(payload.sender);
|
|
216
|
+
const installationId = payload.installation?.id;
|
|
217
|
+
const ctx = {
|
|
218
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
219
|
+
eventName: "pull_request",
|
|
220
|
+
repository,
|
|
221
|
+
conversation: {
|
|
222
|
+
kind: "pull_request",
|
|
223
|
+
number: payload.pull_request.number,
|
|
224
|
+
url: payload.pull_request.html_url,
|
|
225
|
+
},
|
|
226
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
227
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
228
|
+
};
|
|
229
|
+
const pullRequest = {
|
|
230
|
+
action: payload.action,
|
|
231
|
+
number: payload.pull_request.number,
|
|
232
|
+
url: payload.pull_request.html_url,
|
|
233
|
+
title: payload.pull_request.title,
|
|
234
|
+
...(payload.pull_request.body === undefined || payload.pull_request.body === null
|
|
235
|
+
? {}
|
|
236
|
+
: { body: payload.pull_request.body }),
|
|
237
|
+
headRef: payload.pull_request.head.ref,
|
|
238
|
+
headSha: payload.pull_request.head.sha,
|
|
239
|
+
baseRef: payload.pull_request.base.ref,
|
|
240
|
+
...(payload.pull_request.base.sha === undefined
|
|
241
|
+
? {}
|
|
242
|
+
: { baseSha: payload.pull_request.base.sha }),
|
|
243
|
+
...(payload.changes?.base?.ref?.from === undefined
|
|
244
|
+
? {}
|
|
245
|
+
: { baseRefChangedFrom: payload.changes.base.ref.from }),
|
|
246
|
+
draft: payload.pull_request.draft ?? false,
|
|
247
|
+
merged: payload.pull_request.merged === true,
|
|
248
|
+
...(payload.pull_request.user?.login === undefined
|
|
249
|
+
? {}
|
|
250
|
+
: { authorLogin: payload.pull_request.user.login }),
|
|
251
|
+
...(payload.label?.name === undefined ? {} : { label: { name: payload.label.name } }),
|
|
252
|
+
};
|
|
253
|
+
return { ctx, pullRequest };
|
|
254
|
+
}
|
|
255
|
+
export async function verifyGitHubWebhookSignature(args) {
|
|
256
|
+
// A value over the secret cap holds no usable secret, the same as unset.
|
|
257
|
+
const parsed = parseHmacSecrets(await resolveCredentialValue(args.secret));
|
|
258
|
+
if (!parsed.ok) {
|
|
259
|
+
return "missing_secret";
|
|
260
|
+
}
|
|
261
|
+
if (args.signatureHeader === null) {
|
|
262
|
+
return "missing_signature";
|
|
263
|
+
}
|
|
264
|
+
const isVerified = hmacSignatureMatchesAny({
|
|
265
|
+
body: args.body,
|
|
266
|
+
presented: args.signatureHeader,
|
|
267
|
+
secrets: parsed.secrets,
|
|
268
|
+
prefix: GITHUB_SIGNATURE_PREFIX,
|
|
269
|
+
separator: undefined,
|
|
270
|
+
});
|
|
271
|
+
return isVerified ? "verified" : "mismatch";
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Run the authored hooks for one GitHub delivery and `send()` the turn.
|
|
275
|
+
* Callers own delivery auth: the HTTP route verifies the HMAC; trigger
|
|
276
|
+
* fan-out and hosted admission arrive verified. The v2 mailbox is stamped
|
|
277
|
+
* upstream (local CP or hosted ingress), never here.
|
|
278
|
+
*/
|
|
279
|
+
export async function dispatchGitHubWebhook(input) {
|
|
280
|
+
const { options, eventName, payload, deliveryId, args } = input;
|
|
281
|
+
const botName = options.botName ?? process.env.GITHUB_APP_SLUG;
|
|
282
|
+
const bindingConfig = {
|
|
283
|
+
api: options.api,
|
|
284
|
+
credentials: options.credentials,
|
|
285
|
+
};
|
|
286
|
+
if (eventName === "ping") {
|
|
287
|
+
return Response.json({ ok: true, event: "ping" });
|
|
288
|
+
}
|
|
289
|
+
switch (eventName) {
|
|
290
|
+
case "pull_request":
|
|
291
|
+
return handlePullRequest({
|
|
292
|
+
options,
|
|
293
|
+
bindingConfig,
|
|
294
|
+
payload,
|
|
295
|
+
deliveryId,
|
|
296
|
+
args,
|
|
297
|
+
});
|
|
298
|
+
case "issue_comment":
|
|
299
|
+
return handleIssueComment({
|
|
300
|
+
options,
|
|
301
|
+
bindingConfig,
|
|
302
|
+
botName,
|
|
303
|
+
payload,
|
|
304
|
+
deliveryId,
|
|
305
|
+
args,
|
|
306
|
+
});
|
|
307
|
+
case "pull_request_review_comment":
|
|
308
|
+
return handleReviewComment({
|
|
309
|
+
options,
|
|
310
|
+
bindingConfig,
|
|
311
|
+
botName,
|
|
312
|
+
payload,
|
|
313
|
+
deliveryId,
|
|
314
|
+
args,
|
|
315
|
+
});
|
|
316
|
+
case "issues":
|
|
317
|
+
return handleIssue({
|
|
318
|
+
options,
|
|
319
|
+
bindingConfig,
|
|
320
|
+
payload,
|
|
321
|
+
deliveryId,
|
|
322
|
+
args,
|
|
323
|
+
});
|
|
324
|
+
case "check_suite":
|
|
325
|
+
return handleCheckSuite({
|
|
326
|
+
options,
|
|
327
|
+
bindingConfig,
|
|
328
|
+
payload,
|
|
329
|
+
deliveryId,
|
|
330
|
+
args,
|
|
331
|
+
});
|
|
332
|
+
case "check_run":
|
|
333
|
+
return handleCheckRun({
|
|
334
|
+
options,
|
|
335
|
+
bindingConfig,
|
|
336
|
+
payload,
|
|
337
|
+
deliveryId,
|
|
338
|
+
args,
|
|
339
|
+
});
|
|
340
|
+
case "workflow_run":
|
|
341
|
+
return handleWorkflowRun({
|
|
342
|
+
options,
|
|
343
|
+
bindingConfig,
|
|
344
|
+
payload,
|
|
345
|
+
deliveryId,
|
|
346
|
+
args,
|
|
347
|
+
});
|
|
348
|
+
case "status":
|
|
349
|
+
return handleStatus({
|
|
350
|
+
options,
|
|
351
|
+
bindingConfig,
|
|
352
|
+
payload,
|
|
353
|
+
deliveryId,
|
|
354
|
+
args,
|
|
355
|
+
});
|
|
356
|
+
default:
|
|
357
|
+
if (options.onEvent !== undefined && eventName !== null) {
|
|
358
|
+
return handleGenericEvent({
|
|
359
|
+
options,
|
|
360
|
+
bindingConfig,
|
|
361
|
+
eventName,
|
|
362
|
+
payload,
|
|
363
|
+
deliveryId,
|
|
364
|
+
args,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
return skipped("unsupported_event", { event: eventName });
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* HTTP entry for a single agent's GitHub channel: optional HMAC verify, then
|
|
372
|
+
* {@link dispatchGitHubWebhook}.
|
|
373
|
+
*/
|
|
374
|
+
export async function handleGitHubWebhookRequest(input) {
|
|
375
|
+
const bodyText = await input.request.text();
|
|
376
|
+
const webhookSecret = input.options.credentials?.webhookSecret ?? envWebhookSecret();
|
|
377
|
+
// A hosted public catch is reachable without an alias token. Require a
|
|
378
|
+
// verified Hub signature there even when no secret is configured, so a
|
|
379
|
+
// missing secret is a rejection rather than an unsigned accept. Local
|
|
380
|
+
// routes keep the existing rule: verify only when a secret is set.
|
|
381
|
+
const requireSignature = input.skipSignatureVerification !== true &&
|
|
382
|
+
(webhookSecret !== undefined || input.request.headers.has(CATCH_DELIVERY_ID_HEADER));
|
|
383
|
+
if (requireSignature) {
|
|
384
|
+
const signatureResult = await verifyGitHubWebhookSignature({
|
|
385
|
+
body: bodyText,
|
|
386
|
+
signatureHeader: input.request.headers.get(GITHUB_SIGNATURE_HEADER),
|
|
387
|
+
secret: webhookSecret,
|
|
388
|
+
});
|
|
389
|
+
if (signatureResult !== "verified") {
|
|
390
|
+
return Response.json({ ok: false, error: signatureResult }, { status: 401 });
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
let payload;
|
|
394
|
+
try {
|
|
395
|
+
payload = JSON.parse(bodyText);
|
|
396
|
+
}
|
|
397
|
+
catch {
|
|
398
|
+
return Response.json({ ok: false, error: "invalid_json" }, { status: 400 });
|
|
399
|
+
}
|
|
400
|
+
const eventName = input.request.headers.get("x-github-event");
|
|
401
|
+
const args = eventName === null
|
|
402
|
+
? input.args
|
|
403
|
+
: bindLocalIngressSend(input.args, {
|
|
404
|
+
identity: input.options.continuation,
|
|
405
|
+
kind: "github",
|
|
406
|
+
eventType: eventName,
|
|
407
|
+
payload,
|
|
408
|
+
});
|
|
409
|
+
return dispatchGitHubWebhook({
|
|
410
|
+
options: input.options,
|
|
411
|
+
eventName,
|
|
412
|
+
payload,
|
|
413
|
+
deliveryId: input.request.headers.get("x-github-delivery") ?? undefined,
|
|
414
|
+
args,
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
/** Options used to construct a github channel — for host-level fan-out. */
|
|
418
|
+
const githubChannelOptionsByDefinition = new WeakMap();
|
|
419
|
+
/**
|
|
420
|
+
* Recover the {@link GitHubChannelOptions} used to build a channel definition,
|
|
421
|
+
* if it was created via {@link githubChannel}.
|
|
422
|
+
*/
|
|
423
|
+
export function getGitHubChannelOptions(definition) {
|
|
424
|
+
return githubChannelOptionsByDefinition.get(definition);
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* GitHub webhook channel (Eve-compatible dispatch surface). Point a GitHub App
|
|
428
|
+
* or repository webhook at `/<agent>/v1/channels/github` and declare inbound
|
|
429
|
+
* hooks:
|
|
430
|
+
*
|
|
431
|
+
* ```ts
|
|
432
|
+
* import { defaultGitHubAuth, githubChannel } from "@cursor/bdk/channels/github";
|
|
433
|
+
*
|
|
434
|
+
* export default githubChannel({
|
|
435
|
+
* botName: "my-agent",
|
|
436
|
+
* // Named, not read: locally `process.env.GITHUB_WEBHOOK_SECRET`; hosted,
|
|
437
|
+
* // the deployment secret, which the control plane checks at ingestion.
|
|
438
|
+
* credentials: { webhookSecret: { secretName: "GITHUB_WEBHOOK_SECRET" } },
|
|
439
|
+
* // Replaces the @mention gate. Prefer typed Octokit via getOctokit().
|
|
440
|
+
* onComment: (ctx, comment) => ({ auth: defaultGitHubAuth(ctx) }),
|
|
441
|
+
* onPullRequest: (ctx, pr) => {
|
|
442
|
+
* if (pr.action !== "opened") {
|
|
443
|
+
* return null;
|
|
444
|
+
* }
|
|
445
|
+
* return { auth: defaultGitHubAuth(ctx) };
|
|
446
|
+
* },
|
|
447
|
+
* onStatus: (ctx, status) => {
|
|
448
|
+
* if (status.state !== "failure") {
|
|
449
|
+
* return null;
|
|
450
|
+
* }
|
|
451
|
+
* return {
|
|
452
|
+
* task: async () => {
|
|
453
|
+
* const octokit = await ctx.github.getOctokit();
|
|
454
|
+
* await octokit.rest.repos.createCommitStatus({
|
|
455
|
+
* owner: ctx.repository.owner,
|
|
456
|
+
* repo: ctx.repository.name,
|
|
457
|
+
* sha: status.sha,
|
|
458
|
+
* state: "pending",
|
|
459
|
+
* context: "agent/triage",
|
|
460
|
+
* });
|
|
461
|
+
* },
|
|
462
|
+
* };
|
|
463
|
+
* },
|
|
464
|
+
* onEvent: (ctx, event) => {
|
|
465
|
+
* if (event.eventName !== "label") {
|
|
466
|
+
* return null;
|
|
467
|
+
* }
|
|
468
|
+
* return { auth: defaultGitHubAuth(ctx) };
|
|
469
|
+
* },
|
|
470
|
+
* });
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
export function githubChannel(options = {}) {
|
|
474
|
+
const usesCursorAccount = options.cursorAccount === true || typeof options.cursorAccount === "object";
|
|
475
|
+
// Normalized scope lives on the private runtime — never rewrite authored
|
|
476
|
+
// `cursorAccount` on the options object the author passed in.
|
|
477
|
+
const cursorScope = typeof options.cursorAccount === "object"
|
|
478
|
+
? parseCursorGithubRepoScope(options.cursorAccount.repos, cursorGithubPermissionsForChannel(options, options.cursorAccount.permissions))
|
|
479
|
+
: undefined;
|
|
480
|
+
let cursorCredentials;
|
|
481
|
+
let credentials = options.credentials;
|
|
482
|
+
if (usesCursorAccount) {
|
|
483
|
+
if (hasDedicatedGitHubApiCredentials(options)) {
|
|
484
|
+
throw new Error("githubChannel({ cursorAccount: true }) cannot be combined with token or GitHub App credentials.");
|
|
485
|
+
}
|
|
486
|
+
const pending = createPendingCursorGithubCredentials();
|
|
487
|
+
cursorCredentials = pending;
|
|
488
|
+
credentials = {
|
|
489
|
+
...options.credentials,
|
|
490
|
+
token: createCursorAccountGithubTokenResolver(() => pending.getToken(), pending),
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
const routePath = options.path ?? "/";
|
|
494
|
+
const auth = options.auth ?? defaultGitHubRouteAuth(credentials?.webhookSecret ?? envWebhookSecret());
|
|
495
|
+
const channelOptions = {
|
|
496
|
+
...options,
|
|
497
|
+
credentials,
|
|
498
|
+
};
|
|
499
|
+
if (channelOptions.continuation !== undefined) {
|
|
500
|
+
channelOptions.continuation = normalizeIdentity(channelOptions.continuation, "github");
|
|
501
|
+
}
|
|
502
|
+
const events = {
|
|
503
|
+
...buildDefaultGitHubEvents({ ...channelOptions }),
|
|
504
|
+
...options.events,
|
|
505
|
+
};
|
|
506
|
+
const definition = defineChannel({
|
|
507
|
+
auth,
|
|
508
|
+
state: emptyGitHubChannelState(),
|
|
509
|
+
events,
|
|
510
|
+
meta: {
|
|
511
|
+
kind: GITHUB_CHANNEL_KIND,
|
|
512
|
+
githubWebhookEvents: deriveGitHubWebhookEvents(channelOptions),
|
|
513
|
+
},
|
|
514
|
+
onStart: options.onStart,
|
|
515
|
+
onStop: options.onStop,
|
|
516
|
+
routes: [
|
|
517
|
+
POST(routePath, {
|
|
518
|
+
// Webhook payloads vary by `X-GitHub-Event`; event-specific Zod
|
|
519
|
+
// parsing happens inside the dispatcher. Require a schema at the
|
|
520
|
+
// route boundary so /v1/info + Try always have something to show.
|
|
521
|
+
bodySchema: z.unknown(),
|
|
522
|
+
description: "GitHub webhook ingress",
|
|
523
|
+
handler: async (request, args) => handleGitHubWebhookRequest({
|
|
524
|
+
options: channelOptions,
|
|
525
|
+
request,
|
|
526
|
+
args,
|
|
527
|
+
}),
|
|
528
|
+
}),
|
|
529
|
+
],
|
|
530
|
+
});
|
|
531
|
+
githubChannelOptionsByDefinition.set(definition, channelOptions);
|
|
532
|
+
attachHostedAdmissionAdapter(definition, {
|
|
533
|
+
kind: GITHUB_CHANNEL_KIND,
|
|
534
|
+
prepareArgs: withPropagatingBackgroundErrors,
|
|
535
|
+
dispatch: ({ channelId, eventType, payload, deliveryId, args }) => {
|
|
536
|
+
// A catch (publicEndpoint() or a named webhook secret) is an
|
|
537
|
+
// http.request envelope. Replay it into the route handler, which
|
|
538
|
+
// verifies X-Hub-Signature-256 — the only check on a public catch,
|
|
539
|
+
// and a second one behind the control plane's on a named-secret
|
|
540
|
+
// catch. Forge deliveries carry a GitHub event name and stay on
|
|
541
|
+
// dispatchGitHubWebhook.
|
|
542
|
+
if (eventType === AGENT_SDK_CATCH_EVENT_TYPE) {
|
|
543
|
+
return replayCatchRequest({
|
|
544
|
+
channelId: channelId ?? "github",
|
|
545
|
+
deliveryId,
|
|
546
|
+
routes: definition.routes ?? [],
|
|
547
|
+
payload,
|
|
548
|
+
args,
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
return dispatchGitHubWebhook({
|
|
552
|
+
options: channelOptions,
|
|
553
|
+
eventName: eventType,
|
|
554
|
+
payload,
|
|
555
|
+
deliveryId,
|
|
556
|
+
args,
|
|
557
|
+
});
|
|
558
|
+
},
|
|
559
|
+
});
|
|
560
|
+
if (cursorCredentials !== undefined) {
|
|
561
|
+
registerGithubCursorAccountRuntime(definition, {
|
|
562
|
+
options,
|
|
563
|
+
credentials: cursorCredentials,
|
|
564
|
+
scope: cursorScope,
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
return definition;
|
|
568
|
+
}
|
|
569
|
+
/** Header GitHub signs deliveries with; `sha256=<hex hmac of the raw body>`. */
|
|
570
|
+
const GITHUB_SIGNATURE_HEADER = "x-hub-signature-256";
|
|
571
|
+
const GITHUB_SIGNATURE_PREFIX = "sha256=";
|
|
572
|
+
/** Env var / deployment secret an omitted `webhookSecret` falls back to. */
|
|
573
|
+
export const GITHUB_WEBHOOK_SECRET_ENV = "GITHUB_WEBHOOK_SECRET";
|
|
574
|
+
/**
|
|
575
|
+
* The secret name the v2 error suggests for each API credential: the env
|
|
576
|
+
* var the field falls back to when omitted, or for `installationToken`
|
|
577
|
+
* (which has no fallback) the conventional name.
|
|
578
|
+
*/
|
|
579
|
+
const GITHUB_API_CREDENTIAL_ENV = {
|
|
580
|
+
token: "GITHUB_TOKEN",
|
|
581
|
+
installationToken: "GITHUB_APP_INSTALLATION_TOKEN",
|
|
582
|
+
appId: "GITHUB_APP_ID",
|
|
583
|
+
privateKey: "GITHUB_APP_PRIVATE_KEY",
|
|
584
|
+
};
|
|
585
|
+
/**
|
|
586
|
+
* Why a `githubChannel` cannot deploy onto architecture v2 as authored, or
|
|
587
|
+
* `undefined` when it can.
|
|
588
|
+
*
|
|
589
|
+
* v2 terminates the Hub signature on the control plane, which can only do
|
|
590
|
+
* that for a secret it can name: a literal or getter `webhookSecret` never
|
|
591
|
+
* reaches the manifest, so the check would run inside the guest only —
|
|
592
|
+
* after compute was spent and after GitHub already got its 202.
|
|
593
|
+
*
|
|
594
|
+
* The API credentials (`token`, `installationToken`, `appId`,
|
|
595
|
+
* `privateKey`) follow the same rule on v2: a name is what lets `deploy`
|
|
596
|
+
* flag an unset deployment secret before the first API call fails inside
|
|
597
|
+
* the guest, and a getter is a hook that runs inside the guest with no
|
|
598
|
+
* declared input. A numeric `appId` is configuration, not a secret, and
|
|
599
|
+
* stays allowed. Omitting a field (its env fallback) and `publicEndpoint()`
|
|
600
|
+
* postures are both still allowed. Architecture `"v1"` accepts every shape.
|
|
601
|
+
*/
|
|
602
|
+
export function githubChannelArchitectureError(definition) {
|
|
603
|
+
const options = getGitHubChannelOptions(definition);
|
|
604
|
+
if (options === undefined) {
|
|
605
|
+
return undefined;
|
|
606
|
+
}
|
|
607
|
+
const webhookError = namedWebhookSecretArchitectureError({
|
|
608
|
+
option: "githubChannel credentials.webhookSecret",
|
|
609
|
+
webhookSecret: options.credentials?.webhookSecret,
|
|
610
|
+
envName: GITHUB_WEBHOOK_SECRET_ENV,
|
|
611
|
+
verifies: "X-Hub-Signature-256",
|
|
612
|
+
});
|
|
613
|
+
if (webhookError !== undefined) {
|
|
614
|
+
return webhookError;
|
|
615
|
+
}
|
|
616
|
+
for (const field of Object.keys(GITHUB_API_CREDENTIAL_ENV)) {
|
|
617
|
+
const value = options.credentials?.[field];
|
|
618
|
+
if (value === undefined ||
|
|
619
|
+
isSecretRef(value) ||
|
|
620
|
+
typeof value === "number" ||
|
|
621
|
+
// `cursorAccount: true` installs the SDK's own token resolver; it is
|
|
622
|
+
// not something the author wrote and the control plane mints it.
|
|
623
|
+
isCursorAccountGithubTokenResolver(value)) {
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
const envName = GITHUB_API_CREDENTIAL_ENV[field];
|
|
627
|
+
const authored = typeof value === "function" ? "a function" : "a literal value";
|
|
628
|
+
return (`githubChannel credentials.${field} is ${authored}; architecture "v2" requires a named secret: ` +
|
|
629
|
+
`{ secretName: "${envName}" }. The guest reads the deployment secret of that name from its ` +
|
|
630
|
+
`environment, and \`deploy\` warns when it is not set; a literal or function value is neither ` +
|
|
631
|
+
`declared nor checkable before the first API call. Set the value with ` +
|
|
632
|
+
`\`secrets set <slug> ${envName}\`.`);
|
|
633
|
+
}
|
|
634
|
+
return undefined;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Deployment secrets a `githubChannel`'s API credentials name
|
|
638
|
+
* (`{ secretName }` values of `token`, `installationToken`, `appId`, and
|
|
639
|
+
* `privateKey`). `deploy` declares them beside `hosting.secretNames` and the
|
|
640
|
+
* catch secrets so an unset one is flagged at deploy time rather than as a
|
|
641
|
+
* failed API call inside the guest. The webhook secret is not here: it is
|
|
642
|
+
* a catch secret and travels through the catch declaration.
|
|
643
|
+
*/
|
|
644
|
+
export function githubChannelCredentialSecretNames(definition) {
|
|
645
|
+
const credentials = getGitHubChannelOptions(definition)?.credentials;
|
|
646
|
+
if (credentials === undefined) {
|
|
647
|
+
return [];
|
|
648
|
+
}
|
|
649
|
+
const names = new Set();
|
|
650
|
+
for (const field of Object.keys(GITHUB_API_CREDENTIAL_ENV)) {
|
|
651
|
+
const value = credentials[field];
|
|
652
|
+
if (isSecretRef(value)) {
|
|
653
|
+
names.add(value.secretName);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
return [...names];
|
|
657
|
+
}
|
|
658
|
+
/** True for a `githubChannel({ cursorAccount })` definition. */
|
|
659
|
+
export function isCursorAccountGitHubChannel(definition) {
|
|
660
|
+
const cursorAccount = getGitHubChannelOptions(definition)?.cursorAccount;
|
|
661
|
+
return cursorAccount === true || typeof cursorAccount === "object";
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* The route policy for a GitHub webhook whose secret is named: verify
|
|
665
|
+
* `X-Hub-Signature-256` under the env var / deployment secret `secretName`.
|
|
666
|
+
* Being an {@link hmacSignatureAuth} policy, `deploy` writes it into the
|
|
667
|
+
* manifest, so on Cursor hosting the control plane runs the same check
|
|
668
|
+
* at ingestion and refuses a bad signature before any compute starts.
|
|
669
|
+
*/
|
|
670
|
+
export function githubWebhookSignatureAuth(secretName) {
|
|
671
|
+
return hmacSignatureAuth({
|
|
672
|
+
header: GITHUB_SIGNATURE_HEADER,
|
|
673
|
+
secret: secretName,
|
|
674
|
+
prefix: GITHUB_SIGNATURE_PREFIX,
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Default route auth for the resolved webhook secret:
|
|
679
|
+
*
|
|
680
|
+
* - A named secret makes the HMAC the route policy itself
|
|
681
|
+
* ({@link githubWebhookSignatureAuth}), which is also what makes the
|
|
682
|
+
* channel catchable on the control plane.
|
|
683
|
+
* - A literal or getter secret keeps the HMAC inside the handler, so the
|
|
684
|
+
* route admits everything (allowAll) and the handler is the request auth.
|
|
685
|
+
* - No secret: prod stays loopback-strict; dev admits unsigned deliveries
|
|
686
|
+
* from a loopback peer only (loopbackGitHubDev) — not the LAN. Admits
|
|
687
|
+
* `gh webhook forward` deliveries (loopback peer + GitHub forwarding /
|
|
688
|
+
* delivery headers) while rejecting loopback tunnels that relay unsigned
|
|
689
|
+
* traffic without `X-GitHub-Event`.
|
|
690
|
+
*
|
|
691
|
+
* `isDevMode()` is evaluated per request (not at channel construction):
|
|
692
|
+
* channel modules call `githubChannel()` at import, and discovery may cache
|
|
693
|
+
* the definition across serve() calls. `serve()` sets the flag before
|
|
694
|
+
* discovery, but request-time lookup stays correct if that ordering drifts.
|
|
695
|
+
*/
|
|
696
|
+
function defaultGitHubRouteAuth(webhookSecret) {
|
|
697
|
+
if (webhookSecret === undefined) {
|
|
698
|
+
return [
|
|
699
|
+
(request, info) => (isDevMode() ? loopbackGitHubDev() : localDevStrict())(request, info),
|
|
700
|
+
];
|
|
701
|
+
}
|
|
702
|
+
if (isSecretRef(webhookSecret)) {
|
|
703
|
+
return [githubWebhookSignatureAuth(webhookSecret.secretName)];
|
|
704
|
+
}
|
|
705
|
+
return [allowAll()];
|
|
706
|
+
}
|
|
707
|
+
function hasDedicatedGitHubApiCredentials(options) {
|
|
708
|
+
return (options.credentials?.token !== undefined ||
|
|
709
|
+
options.credentials?.installationToken !== undefined ||
|
|
710
|
+
options.credentials?.appId !== undefined ||
|
|
711
|
+
options.credentials?.privateKey !== undefined);
|
|
712
|
+
}
|
|
713
|
+
async function handlePullRequest(input) {
|
|
714
|
+
const parsed = parseGitHubPullRequestEvent({
|
|
715
|
+
payload: input.payload,
|
|
716
|
+
deliveryId: input.deliveryId,
|
|
717
|
+
});
|
|
718
|
+
if (parsed === null) {
|
|
719
|
+
return Response.json({ ok: false, error: "invalid_pull_request_payload" }, { status: 400 });
|
|
720
|
+
}
|
|
721
|
+
const { pullRequest } = parsed;
|
|
722
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
723
|
+
const binding = githubBindingStateForEvent({
|
|
724
|
+
kind: parsed.ctx.conversation.kind,
|
|
725
|
+
owner: parsed.ctx.repository.owner,
|
|
726
|
+
repo: parsed.ctx.repository.name,
|
|
727
|
+
number: parsed.ctx.conversation.number,
|
|
728
|
+
repositoryId: parsed.ctx.repository.id,
|
|
729
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
730
|
+
installationId,
|
|
731
|
+
});
|
|
732
|
+
const ctx = enrichEventContext({
|
|
733
|
+
bindingConfig: input.bindingConfig,
|
|
734
|
+
ctx: parsed.ctx,
|
|
735
|
+
payload: input.payload,
|
|
736
|
+
bindingState: binding,
|
|
737
|
+
installationId,
|
|
738
|
+
host: input.args.host,
|
|
739
|
+
artifacts: input.args.artifacts,
|
|
740
|
+
send: input.args.send,
|
|
741
|
+
});
|
|
742
|
+
const dispatch = input.options.onPullRequest === undefined
|
|
743
|
+
? defaultGitHubPullRequestDispatch(ctx, pullRequest)
|
|
744
|
+
: await input.options.onPullRequest(ctx, pullRequest);
|
|
745
|
+
if (dispatch === null) {
|
|
746
|
+
return skipped("not_dispatched", { action: pullRequest.action });
|
|
747
|
+
}
|
|
748
|
+
if (isTaskDispatch(dispatch)) {
|
|
749
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
750
|
+
action: pullRequest.action,
|
|
751
|
+
prUrl: pullRequest.url,
|
|
752
|
+
headSha: pullRequest.headSha,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
const message = [
|
|
756
|
+
dispatch.message ?? defaultGitHubPullRequestMessage(ctx, pullRequest),
|
|
757
|
+
...(dispatch.context ?? []),
|
|
758
|
+
].join("\n");
|
|
759
|
+
const cloud = dispatch.cloud ?? (await resolveCloudOptions(input.options.cloud, ctx, pullRequest));
|
|
760
|
+
return startTurn({
|
|
761
|
+
options: input.options,
|
|
762
|
+
args: input.args,
|
|
763
|
+
ctx,
|
|
764
|
+
message,
|
|
765
|
+
dispatch,
|
|
766
|
+
cloud,
|
|
767
|
+
state: sessionStateFromBinding({
|
|
768
|
+
binding,
|
|
769
|
+
deliveryId: ctx.deliveryId,
|
|
770
|
+
eventName: ctx.eventName,
|
|
771
|
+
headSha: pullRequest.headSha,
|
|
772
|
+
baseRef: pullRequest.baseRef,
|
|
773
|
+
headRef: pullRequest.headRef,
|
|
774
|
+
}),
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
async function handleIssueComment(input) {
|
|
778
|
+
const parsed = parseIssueCommentEvent({
|
|
779
|
+
payload: input.payload,
|
|
780
|
+
deliveryId: input.deliveryId,
|
|
781
|
+
});
|
|
782
|
+
if (parsed === null) {
|
|
783
|
+
return Response.json({ ok: false, error: "invalid_issue_comment_payload" }, { status: 400 });
|
|
784
|
+
}
|
|
785
|
+
if (parsed.action !== "created") {
|
|
786
|
+
return skipped("not_dispatched", { action: parsed.action });
|
|
787
|
+
}
|
|
788
|
+
if (isIgnoredInboundComment(parsed.comment.body, parsed.comment.author, input.botName)) {
|
|
789
|
+
return skipped("ignored_comment");
|
|
790
|
+
}
|
|
791
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
792
|
+
const binding = githubBindingStateForEvent({
|
|
793
|
+
kind: parsed.ctx.conversation.kind,
|
|
794
|
+
owner: parsed.ctx.repository.owner,
|
|
795
|
+
repo: parsed.ctx.repository.name,
|
|
796
|
+
number: parsed.ctx.conversation.number,
|
|
797
|
+
repositoryId: parsed.ctx.repository.id,
|
|
798
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
799
|
+
installationId,
|
|
800
|
+
triggeringCommentId: parsed.comment.id,
|
|
801
|
+
});
|
|
802
|
+
const ctx = enrichEventContext({
|
|
803
|
+
bindingConfig: input.bindingConfig,
|
|
804
|
+
ctx: parsed.ctx,
|
|
805
|
+
payload: input.payload,
|
|
806
|
+
bindingState: binding,
|
|
807
|
+
installationId,
|
|
808
|
+
host: input.args.host,
|
|
809
|
+
artifacts: input.args.artifacts,
|
|
810
|
+
send: input.args.send,
|
|
811
|
+
});
|
|
812
|
+
const dispatch = input.options.onComment === undefined
|
|
813
|
+
? defaultOnComment(ctx, parsed.comment, {
|
|
814
|
+
botName: input.botName,
|
|
815
|
+
})
|
|
816
|
+
: await input.options.onComment(ctx, parsed.comment);
|
|
817
|
+
if (dispatch === null) {
|
|
818
|
+
return skipped("not_dispatched");
|
|
819
|
+
}
|
|
820
|
+
if (isTaskDispatch(dispatch)) {
|
|
821
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
822
|
+
event: "issue_comment",
|
|
823
|
+
action: parsed.action,
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
const trigger = extractGitHubCommentTrigger({
|
|
827
|
+
body: parsed.comment.body,
|
|
828
|
+
botName: input.botName,
|
|
829
|
+
});
|
|
830
|
+
const message = [
|
|
831
|
+
dispatch.message ?? trigger?.message ?? parsed.comment.body.trim(),
|
|
832
|
+
...(dispatch.context ?? []),
|
|
833
|
+
].join("\n");
|
|
834
|
+
return startTurn({
|
|
835
|
+
options: input.options,
|
|
836
|
+
args: input.args,
|
|
837
|
+
ctx,
|
|
838
|
+
message,
|
|
839
|
+
dispatch,
|
|
840
|
+
state: sessionStateFromBinding({
|
|
841
|
+
binding,
|
|
842
|
+
deliveryId: ctx.deliveryId,
|
|
843
|
+
eventName: ctx.eventName,
|
|
844
|
+
}),
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
async function handleReviewComment(input) {
|
|
848
|
+
const parsed = parseReviewCommentEvent({
|
|
849
|
+
payload: input.payload,
|
|
850
|
+
deliveryId: input.deliveryId,
|
|
851
|
+
});
|
|
852
|
+
if (parsed === null) {
|
|
853
|
+
return Response.json({ ok: false, error: "invalid_review_comment_payload" }, { status: 400 });
|
|
854
|
+
}
|
|
855
|
+
if (parsed.action !== "created") {
|
|
856
|
+
return skipped("not_dispatched", { action: parsed.action });
|
|
857
|
+
}
|
|
858
|
+
if (isIgnoredInboundComment(parsed.comment.body, parsed.comment.author, input.botName)) {
|
|
859
|
+
return skipped("ignored_comment");
|
|
860
|
+
}
|
|
861
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
862
|
+
const binding = githubBindingStateForEvent({
|
|
863
|
+
kind: parsed.ctx.conversation.kind,
|
|
864
|
+
owner: parsed.ctx.repository.owner,
|
|
865
|
+
repo: parsed.ctx.repository.name,
|
|
866
|
+
number: parsed.ctx.conversation.number,
|
|
867
|
+
repositoryId: parsed.ctx.repository.id,
|
|
868
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
869
|
+
installationId,
|
|
870
|
+
triggeringCommentId: parsed.comment.id,
|
|
871
|
+
reviewCommentId: parsed.comment.id,
|
|
872
|
+
reviewThreadRootCommentId: parsed.comment.inReplyToId ?? parsed.comment.id,
|
|
873
|
+
});
|
|
874
|
+
const ctx = enrichEventContext({
|
|
875
|
+
bindingConfig: input.bindingConfig,
|
|
876
|
+
ctx: parsed.ctx,
|
|
877
|
+
payload: input.payload,
|
|
878
|
+
bindingState: binding,
|
|
879
|
+
installationId,
|
|
880
|
+
host: input.args.host,
|
|
881
|
+
artifacts: input.args.artifacts,
|
|
882
|
+
send: input.args.send,
|
|
883
|
+
});
|
|
884
|
+
const dispatch = input.options.onComment === undefined
|
|
885
|
+
? defaultOnComment(ctx, parsed.comment, {
|
|
886
|
+
botName: input.botName,
|
|
887
|
+
})
|
|
888
|
+
: await input.options.onComment(ctx, parsed.comment);
|
|
889
|
+
if (dispatch === null) {
|
|
890
|
+
return skipped("not_dispatched");
|
|
891
|
+
}
|
|
892
|
+
if (isTaskDispatch(dispatch)) {
|
|
893
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
894
|
+
event: "pull_request_review_comment",
|
|
895
|
+
action: parsed.action,
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
const trigger = extractGitHubCommentTrigger({
|
|
899
|
+
body: parsed.comment.body,
|
|
900
|
+
botName: input.botName,
|
|
901
|
+
});
|
|
902
|
+
const message = [
|
|
903
|
+
dispatch.message ?? trigger?.message ?? parsed.comment.body.trim(),
|
|
904
|
+
...(dispatch.context ?? []),
|
|
905
|
+
].join("\n");
|
|
906
|
+
return startTurn({
|
|
907
|
+
options: input.options,
|
|
908
|
+
args: input.args,
|
|
909
|
+
ctx,
|
|
910
|
+
message,
|
|
911
|
+
dispatch,
|
|
912
|
+
state: sessionStateFromBinding({
|
|
913
|
+
binding,
|
|
914
|
+
deliveryId: ctx.deliveryId,
|
|
915
|
+
eventName: ctx.eventName,
|
|
916
|
+
headSha: parsed.headSha,
|
|
917
|
+
headRef: parsed.headRef,
|
|
918
|
+
baseRef: parsed.baseRef,
|
|
919
|
+
}),
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
async function handleIssue(input) {
|
|
923
|
+
if (input.options.onIssue === undefined) {
|
|
924
|
+
return skipped("no_handler", { event: "issues" });
|
|
925
|
+
}
|
|
926
|
+
const parsed = parseIssueEvent({
|
|
927
|
+
payload: input.payload,
|
|
928
|
+
deliveryId: input.deliveryId,
|
|
929
|
+
});
|
|
930
|
+
if (parsed === null) {
|
|
931
|
+
return Response.json({ ok: false, error: "invalid_issues_payload" }, { status: 400 });
|
|
932
|
+
}
|
|
933
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
934
|
+
const binding = githubBindingStateForEvent({
|
|
935
|
+
kind: parsed.ctx.conversation.kind,
|
|
936
|
+
owner: parsed.ctx.repository.owner,
|
|
937
|
+
repo: parsed.ctx.repository.name,
|
|
938
|
+
number: parsed.ctx.conversation.number,
|
|
939
|
+
repositoryId: parsed.ctx.repository.id,
|
|
940
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
941
|
+
installationId,
|
|
942
|
+
});
|
|
943
|
+
const ctx = enrichEventContext({
|
|
944
|
+
bindingConfig: input.bindingConfig,
|
|
945
|
+
ctx: parsed.ctx,
|
|
946
|
+
payload: input.payload,
|
|
947
|
+
bindingState: binding,
|
|
948
|
+
installationId,
|
|
949
|
+
host: input.args.host,
|
|
950
|
+
artifacts: input.args.artifacts,
|
|
951
|
+
send: input.args.send,
|
|
952
|
+
});
|
|
953
|
+
const dispatch = await input.options.onIssue(ctx, parsed.issue);
|
|
954
|
+
if (dispatch === null) {
|
|
955
|
+
return skipped("not_dispatched", { action: parsed.issue.action });
|
|
956
|
+
}
|
|
957
|
+
if (isTaskDispatch(dispatch)) {
|
|
958
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
959
|
+
event: "issues",
|
|
960
|
+
action: parsed.issue.action,
|
|
961
|
+
issueNumber: parsed.issue.number,
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
const message = [
|
|
965
|
+
dispatch.message ??
|
|
966
|
+
`Issue ${parsed.issue.action}: #${parsed.issue.number} ${parsed.issue.title}`,
|
|
967
|
+
...(dispatch.context ?? []),
|
|
968
|
+
].join("\n");
|
|
969
|
+
return startTurn({
|
|
970
|
+
options: input.options,
|
|
971
|
+
args: input.args,
|
|
972
|
+
ctx,
|
|
973
|
+
message,
|
|
974
|
+
dispatch,
|
|
975
|
+
state: sessionStateFromBinding({
|
|
976
|
+
binding,
|
|
977
|
+
deliveryId: ctx.deliveryId,
|
|
978
|
+
eventName: ctx.eventName,
|
|
979
|
+
}),
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
async function handleCheckSuite(input) {
|
|
983
|
+
if (input.options.onCheckSuite === undefined) {
|
|
984
|
+
return skipped("no_handler", { event: "check_suite" });
|
|
985
|
+
}
|
|
986
|
+
const parsed = parseCheckSuiteEvent({
|
|
987
|
+
payload: input.payload,
|
|
988
|
+
deliveryId: input.deliveryId,
|
|
989
|
+
});
|
|
990
|
+
if (parsed === null) {
|
|
991
|
+
return Response.json({ ok: false, error: "invalid_check_suite_payload" }, { status: 400 });
|
|
992
|
+
}
|
|
993
|
+
const installationId = readInstallationId(input.payload) ?? parsed.unanchoredCtx.installationId;
|
|
994
|
+
if (parsed.ctx === null) {
|
|
995
|
+
const dispatch = await input.options.onCheckSuite(enrichCiContext({
|
|
996
|
+
bindingConfig: input.bindingConfig,
|
|
997
|
+
ctx: parsed.unanchoredCtx,
|
|
998
|
+
payload: input.payload,
|
|
999
|
+
installationId,
|
|
1000
|
+
host: input.args.host,
|
|
1001
|
+
artifacts: input.args.artifacts,
|
|
1002
|
+
send: input.args.send,
|
|
1003
|
+
}), parsed.checkSuite);
|
|
1004
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
1005
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1006
|
+
event: "check_suite",
|
|
1007
|
+
action: parsed.checkSuite.action,
|
|
1008
|
+
checkSuiteId: parsed.checkSuite.checkSuiteId,
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
return skipped("no_pull_request", { event: "check_suite" });
|
|
1012
|
+
}
|
|
1013
|
+
const binding = githubBindingStateForEvent({
|
|
1014
|
+
kind: parsed.ctx.conversation.kind,
|
|
1015
|
+
owner: parsed.ctx.repository.owner,
|
|
1016
|
+
repo: parsed.ctx.repository.name,
|
|
1017
|
+
number: parsed.ctx.conversation.number,
|
|
1018
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1019
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1020
|
+
installationId,
|
|
1021
|
+
});
|
|
1022
|
+
const ctx = enrichEventContext({
|
|
1023
|
+
bindingConfig: input.bindingConfig,
|
|
1024
|
+
ctx: parsed.ctx,
|
|
1025
|
+
payload: input.payload,
|
|
1026
|
+
bindingState: binding,
|
|
1027
|
+
installationId,
|
|
1028
|
+
host: input.args.host,
|
|
1029
|
+
artifacts: input.args.artifacts,
|
|
1030
|
+
send: input.args.send,
|
|
1031
|
+
});
|
|
1032
|
+
const dispatch = await input.options.onCheckSuite(ctx, parsed.checkSuite);
|
|
1033
|
+
if (dispatch === null) {
|
|
1034
|
+
return skipped("not_dispatched", { action: parsed.checkSuite.action });
|
|
1035
|
+
}
|
|
1036
|
+
if (isTaskDispatch(dispatch)) {
|
|
1037
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1038
|
+
event: "check_suite",
|
|
1039
|
+
action: parsed.checkSuite.action,
|
|
1040
|
+
checkSuiteId: parsed.checkSuite.checkSuiteId,
|
|
1041
|
+
});
|
|
1042
|
+
}
|
|
1043
|
+
const message = [
|
|
1044
|
+
dispatch.message ??
|
|
1045
|
+
formatCiMessage("Check suite", parsed.checkSuite.checkSuiteId, parsed.checkSuite),
|
|
1046
|
+
...(dispatch.context ?? []),
|
|
1047
|
+
].join("\n");
|
|
1048
|
+
return startTurn({
|
|
1049
|
+
options: input.options,
|
|
1050
|
+
args: input.args,
|
|
1051
|
+
ctx,
|
|
1052
|
+
message,
|
|
1053
|
+
dispatch,
|
|
1054
|
+
state: sessionStateFromBinding({
|
|
1055
|
+
binding,
|
|
1056
|
+
deliveryId: ctx.deliveryId,
|
|
1057
|
+
eventName: ctx.eventName,
|
|
1058
|
+
headSha: parsed.checkSuite.headSha,
|
|
1059
|
+
}),
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
async function handleCheckRun(input) {
|
|
1063
|
+
if (input.options.onCheckRun === undefined) {
|
|
1064
|
+
return skipped("no_handler", { event: "check_run" });
|
|
1065
|
+
}
|
|
1066
|
+
const parsed = parseCheckRunEvent({
|
|
1067
|
+
payload: input.payload,
|
|
1068
|
+
deliveryId: input.deliveryId,
|
|
1069
|
+
});
|
|
1070
|
+
if (parsed === null) {
|
|
1071
|
+
return Response.json({ ok: false, error: "invalid_check_run_payload" }, { status: 400 });
|
|
1072
|
+
}
|
|
1073
|
+
const installationId = readInstallationId(input.payload) ?? parsed.unanchoredCtx.installationId;
|
|
1074
|
+
if (parsed.ctx === null) {
|
|
1075
|
+
const dispatch = await input.options.onCheckRun(enrichCiContext({
|
|
1076
|
+
bindingConfig: input.bindingConfig,
|
|
1077
|
+
ctx: parsed.unanchoredCtx,
|
|
1078
|
+
payload: input.payload,
|
|
1079
|
+
installationId,
|
|
1080
|
+
host: input.args.host,
|
|
1081
|
+
artifacts: input.args.artifacts,
|
|
1082
|
+
send: input.args.send,
|
|
1083
|
+
}), parsed.checkRun);
|
|
1084
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
1085
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1086
|
+
event: "check_run",
|
|
1087
|
+
action: parsed.checkRun.action,
|
|
1088
|
+
checkRunId: parsed.checkRun.checkRunId,
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
return skipped("no_pull_request", { event: "check_run" });
|
|
1092
|
+
}
|
|
1093
|
+
const binding = githubBindingStateForEvent({
|
|
1094
|
+
kind: parsed.ctx.conversation.kind,
|
|
1095
|
+
owner: parsed.ctx.repository.owner,
|
|
1096
|
+
repo: parsed.ctx.repository.name,
|
|
1097
|
+
number: parsed.ctx.conversation.number,
|
|
1098
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1099
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1100
|
+
installationId,
|
|
1101
|
+
});
|
|
1102
|
+
const ctx = enrichEventContext({
|
|
1103
|
+
bindingConfig: input.bindingConfig,
|
|
1104
|
+
ctx: parsed.ctx,
|
|
1105
|
+
payload: input.payload,
|
|
1106
|
+
bindingState: binding,
|
|
1107
|
+
installationId,
|
|
1108
|
+
host: input.args.host,
|
|
1109
|
+
artifacts: input.args.artifacts,
|
|
1110
|
+
send: input.args.send,
|
|
1111
|
+
});
|
|
1112
|
+
const dispatch = await input.options.onCheckRun(ctx, parsed.checkRun);
|
|
1113
|
+
if (dispatch === null) {
|
|
1114
|
+
return skipped("not_dispatched", { action: parsed.checkRun.action });
|
|
1115
|
+
}
|
|
1116
|
+
if (isTaskDispatch(dispatch)) {
|
|
1117
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1118
|
+
event: "check_run",
|
|
1119
|
+
action: parsed.checkRun.action,
|
|
1120
|
+
checkRunId: parsed.checkRun.checkRunId,
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
const message = [
|
|
1124
|
+
dispatch.message ?? formatCiMessage("Check run", parsed.checkRun.checkRunId, parsed.checkRun),
|
|
1125
|
+
...(dispatch.context ?? []),
|
|
1126
|
+
].join("\n");
|
|
1127
|
+
return startTurn({
|
|
1128
|
+
options: input.options,
|
|
1129
|
+
args: input.args,
|
|
1130
|
+
ctx,
|
|
1131
|
+
message,
|
|
1132
|
+
dispatch,
|
|
1133
|
+
state: sessionStateFromBinding({
|
|
1134
|
+
binding,
|
|
1135
|
+
deliveryId: ctx.deliveryId,
|
|
1136
|
+
eventName: ctx.eventName,
|
|
1137
|
+
headSha: parsed.checkRun.headSha,
|
|
1138
|
+
}),
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
async function handleWorkflowRun(input) {
|
|
1142
|
+
if (input.options.onWorkflowRun === undefined) {
|
|
1143
|
+
return skipped("no_handler", { event: "workflow_run" });
|
|
1144
|
+
}
|
|
1145
|
+
const parsed = parseWorkflowRunEvent({
|
|
1146
|
+
payload: input.payload,
|
|
1147
|
+
deliveryId: input.deliveryId,
|
|
1148
|
+
});
|
|
1149
|
+
if (parsed === null) {
|
|
1150
|
+
return Response.json({ ok: false, error: "invalid_workflow_run_payload" }, { status: 400 });
|
|
1151
|
+
}
|
|
1152
|
+
const installationId = readInstallationId(input.payload) ?? parsed.unanchoredCtx.installationId;
|
|
1153
|
+
if (parsed.ctx === null) {
|
|
1154
|
+
const dispatch = await input.options.onWorkflowRun(enrichCiContext({
|
|
1155
|
+
bindingConfig: input.bindingConfig,
|
|
1156
|
+
ctx: parsed.unanchoredCtx,
|
|
1157
|
+
payload: input.payload,
|
|
1158
|
+
installationId,
|
|
1159
|
+
host: input.args.host,
|
|
1160
|
+
artifacts: input.args.artifacts,
|
|
1161
|
+
send: input.args.send,
|
|
1162
|
+
}), parsed.workflowRun);
|
|
1163
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
1164
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1165
|
+
event: "workflow_run",
|
|
1166
|
+
action: parsed.workflowRun.action,
|
|
1167
|
+
workflowRunId: parsed.workflowRun.workflowRunId,
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
return skipped("no_pull_request", { event: "workflow_run" });
|
|
1171
|
+
}
|
|
1172
|
+
const binding = githubBindingStateForEvent({
|
|
1173
|
+
kind: parsed.ctx.conversation.kind,
|
|
1174
|
+
owner: parsed.ctx.repository.owner,
|
|
1175
|
+
repo: parsed.ctx.repository.name,
|
|
1176
|
+
number: parsed.ctx.conversation.number,
|
|
1177
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1178
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1179
|
+
installationId,
|
|
1180
|
+
});
|
|
1181
|
+
const ctx = enrichEventContext({
|
|
1182
|
+
bindingConfig: input.bindingConfig,
|
|
1183
|
+
ctx: parsed.ctx,
|
|
1184
|
+
payload: input.payload,
|
|
1185
|
+
bindingState: binding,
|
|
1186
|
+
installationId,
|
|
1187
|
+
host: input.args.host,
|
|
1188
|
+
artifacts: input.args.artifacts,
|
|
1189
|
+
send: input.args.send,
|
|
1190
|
+
});
|
|
1191
|
+
const dispatch = await input.options.onWorkflowRun(ctx, parsed.workflowRun);
|
|
1192
|
+
if (dispatch === null) {
|
|
1193
|
+
return skipped("not_dispatched", { action: parsed.workflowRun.action });
|
|
1194
|
+
}
|
|
1195
|
+
if (isTaskDispatch(dispatch)) {
|
|
1196
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1197
|
+
event: "workflow_run",
|
|
1198
|
+
action: parsed.workflowRun.action,
|
|
1199
|
+
workflowRunId: parsed.workflowRun.workflowRunId,
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
const message = [
|
|
1203
|
+
dispatch.message ??
|
|
1204
|
+
formatCiMessage("Workflow run", parsed.workflowRun.workflowRunId, parsed.workflowRun),
|
|
1205
|
+
...(dispatch.context ?? []),
|
|
1206
|
+
].join("\n");
|
|
1207
|
+
return startTurn({
|
|
1208
|
+
options: input.options,
|
|
1209
|
+
args: input.args,
|
|
1210
|
+
ctx,
|
|
1211
|
+
message,
|
|
1212
|
+
dispatch,
|
|
1213
|
+
state: sessionStateFromBinding({
|
|
1214
|
+
binding,
|
|
1215
|
+
deliveryId: ctx.deliveryId,
|
|
1216
|
+
eventName: ctx.eventName,
|
|
1217
|
+
headSha: parsed.workflowRun.headSha,
|
|
1218
|
+
}),
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
async function handleStatus(input) {
|
|
1222
|
+
if (input.options.onStatus === undefined) {
|
|
1223
|
+
return skipped("no_handler", { event: "status" });
|
|
1224
|
+
}
|
|
1225
|
+
const parsed = parseStatusEvent({
|
|
1226
|
+
payload: input.payload,
|
|
1227
|
+
deliveryId: input.deliveryId,
|
|
1228
|
+
});
|
|
1229
|
+
if (parsed === null) {
|
|
1230
|
+
return Response.json({ ok: false, error: "invalid_status_payload" }, { status: 400 });
|
|
1231
|
+
}
|
|
1232
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
1233
|
+
const binding = githubBindingStateForEvent({
|
|
1234
|
+
kind: parsed.ctx.conversation.kind,
|
|
1235
|
+
owner: parsed.ctx.repository.owner,
|
|
1236
|
+
repo: parsed.ctx.repository.name,
|
|
1237
|
+
number: parsed.ctx.conversation.number,
|
|
1238
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1239
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1240
|
+
installationId,
|
|
1241
|
+
});
|
|
1242
|
+
const ctx = enrichEventContext({
|
|
1243
|
+
bindingConfig: input.bindingConfig,
|
|
1244
|
+
ctx: parsed.ctx,
|
|
1245
|
+
payload: input.payload,
|
|
1246
|
+
bindingState: binding,
|
|
1247
|
+
installationId,
|
|
1248
|
+
host: input.args.host,
|
|
1249
|
+
artifacts: input.args.artifacts,
|
|
1250
|
+
send: input.args.send,
|
|
1251
|
+
});
|
|
1252
|
+
const dispatch = await input.options.onStatus(ctx, parsed.status);
|
|
1253
|
+
if (dispatch === null) {
|
|
1254
|
+
return skipped("not_dispatched", {
|
|
1255
|
+
event: "status",
|
|
1256
|
+
state: parsed.status.state,
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
if (isTaskDispatch(dispatch)) {
|
|
1260
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1261
|
+
event: "status",
|
|
1262
|
+
state: parsed.status.state,
|
|
1263
|
+
sha: parsed.status.sha,
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
// A turn needs a thread to anchor to; commit statuses often have no PR.
|
|
1267
|
+
if (ctx.conversation.number === 0) {
|
|
1268
|
+
return skipped("no_pull_request", { event: "status" });
|
|
1269
|
+
}
|
|
1270
|
+
const message = [
|
|
1271
|
+
dispatch.message ??
|
|
1272
|
+
`Commit status ${parsed.status.state} for ${parsed.status.context} at ${parsed.status.sha}`,
|
|
1273
|
+
...(dispatch.context ?? []),
|
|
1274
|
+
].join("\n");
|
|
1275
|
+
return startTurn({
|
|
1276
|
+
options: input.options,
|
|
1277
|
+
args: input.args,
|
|
1278
|
+
ctx,
|
|
1279
|
+
message,
|
|
1280
|
+
dispatch,
|
|
1281
|
+
state: sessionStateFromBinding({
|
|
1282
|
+
binding,
|
|
1283
|
+
deliveryId: ctx.deliveryId,
|
|
1284
|
+
eventName: ctx.eventName,
|
|
1285
|
+
headSha: parsed.status.sha,
|
|
1286
|
+
}),
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
async function handleGenericEvent(input) {
|
|
1290
|
+
if (input.options.onEvent === undefined) {
|
|
1291
|
+
return skipped("no_handler", { event: input.eventName });
|
|
1292
|
+
}
|
|
1293
|
+
const parsed = parseGenericEvent({
|
|
1294
|
+
eventName: input.eventName,
|
|
1295
|
+
payload: input.payload,
|
|
1296
|
+
deliveryId: input.deliveryId,
|
|
1297
|
+
});
|
|
1298
|
+
if (parsed === null) {
|
|
1299
|
+
return skipped("unsupported_event", { event: input.eventName });
|
|
1300
|
+
}
|
|
1301
|
+
const installationId = readInstallationId(input.payload) ?? parsed.ctx.installationId;
|
|
1302
|
+
const binding = githubBindingStateForEvent({
|
|
1303
|
+
kind: parsed.ctx.conversation.kind,
|
|
1304
|
+
owner: parsed.ctx.repository.owner,
|
|
1305
|
+
repo: parsed.ctx.repository.name,
|
|
1306
|
+
number: parsed.ctx.conversation.number,
|
|
1307
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1308
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1309
|
+
installationId,
|
|
1310
|
+
});
|
|
1311
|
+
const ctx = enrichEventContext({
|
|
1312
|
+
bindingConfig: input.bindingConfig,
|
|
1313
|
+
ctx: parsed.ctx,
|
|
1314
|
+
payload: input.payload,
|
|
1315
|
+
bindingState: binding,
|
|
1316
|
+
installationId,
|
|
1317
|
+
host: input.args.host,
|
|
1318
|
+
artifacts: input.args.artifacts,
|
|
1319
|
+
send: input.args.send,
|
|
1320
|
+
});
|
|
1321
|
+
const dispatch = await input.options.onEvent(ctx, parsed.event);
|
|
1322
|
+
if (dispatch === null) {
|
|
1323
|
+
return skipped("not_dispatched", { event: input.eventName });
|
|
1324
|
+
}
|
|
1325
|
+
if (isTaskDispatch(dispatch)) {
|
|
1326
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1327
|
+
event: input.eventName,
|
|
1328
|
+
...(parsed.event.action === undefined ? {} : { action: parsed.event.action }),
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
if (ctx.conversation.number === 0) {
|
|
1332
|
+
return skipped("no_conversation", { event: input.eventName });
|
|
1333
|
+
}
|
|
1334
|
+
const message = [
|
|
1335
|
+
dispatch.message ?? `GitHub ${input.eventName} event`,
|
|
1336
|
+
...(dispatch.context ?? []),
|
|
1337
|
+
].join("\n");
|
|
1338
|
+
return startTurn({
|
|
1339
|
+
options: input.options,
|
|
1340
|
+
args: input.args,
|
|
1341
|
+
ctx,
|
|
1342
|
+
message,
|
|
1343
|
+
dispatch,
|
|
1344
|
+
state: sessionStateFromBinding({
|
|
1345
|
+
binding,
|
|
1346
|
+
deliveryId: ctx.deliveryId,
|
|
1347
|
+
eventName: ctx.eventName,
|
|
1348
|
+
}),
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
async function startTurn(input) {
|
|
1352
|
+
const files = input.dispatch.workspaceFiles;
|
|
1353
|
+
const lazy = typeof files === "function";
|
|
1354
|
+
const cloud = input.dispatch.cloud ?? input.cloud;
|
|
1355
|
+
const state = { ...input.dispatch.state, ...input.state };
|
|
1356
|
+
const sendTurn = async () => {
|
|
1357
|
+
const workspaceFiles = lazy ? await files() : files;
|
|
1358
|
+
const source = continuationSource(input.options.continuation, "github");
|
|
1359
|
+
return input.args.send(input.message, {
|
|
1360
|
+
auth: input.dispatch.auth,
|
|
1361
|
+
...(source === "engine" ? { continuationToken: githubContinuationKey(input.ctx) } : {}),
|
|
1362
|
+
title: input.dispatch.title ?? defaultGitHubTitle(input.ctx),
|
|
1363
|
+
cloud,
|
|
1364
|
+
...(workspaceFiles === undefined ? {} : { workspaceFiles }),
|
|
1365
|
+
state: state,
|
|
1366
|
+
// Resume must refresh headSha / refs without wiping sticky banner id.
|
|
1367
|
+
refreshState: state,
|
|
1368
|
+
});
|
|
1369
|
+
};
|
|
1370
|
+
if (lazy) {
|
|
1371
|
+
scheduleAfterAck(input.args, GITHUB_CHANNEL_KIND, async () => {
|
|
1372
|
+
await sendTurn();
|
|
1373
|
+
});
|
|
1374
|
+
return acknowledgeTurn();
|
|
1375
|
+
}
|
|
1376
|
+
return turnStarted(await sendTurn());
|
|
1377
|
+
}
|
|
1378
|
+
function formatCiMessage(label, id, event) {
|
|
1379
|
+
const outcome = event.conclusion ?? event.status;
|
|
1380
|
+
return `${label} ${event.action}: ${id}${outcome ? ` (${outcome})` : ""}`;
|
|
1381
|
+
}
|
|
1382
|
+
function isIgnoredInboundComment(body, author, botName) {
|
|
1383
|
+
if (body.includes("<!-- agent-serve-github -->")) {
|
|
1384
|
+
return true;
|
|
1385
|
+
}
|
|
1386
|
+
if (isGitHubAppBotAuthor(author, botName)) {
|
|
1387
|
+
return true;
|
|
1388
|
+
}
|
|
1389
|
+
return false;
|
|
1390
|
+
}
|
|
1391
|
+
/** Match GitHub App bot actors (`slug` config vs `slug[bot]` login). */
|
|
1392
|
+
export function isGitHubAppBotAuthor(author, botName) {
|
|
1393
|
+
const normalizedBot = botName?.trim();
|
|
1394
|
+
if (normalizedBot === undefined || normalizedBot === "") {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
if (author?.type !== "Bot") {
|
|
1398
|
+
return false;
|
|
1399
|
+
}
|
|
1400
|
+
const login = author.login;
|
|
1401
|
+
const stripBotSuffix = (value) => value.replace(/\[bot\]$/i, "").toLowerCase();
|
|
1402
|
+
return (login.toLowerCase() === normalizedBot.toLowerCase() ||
|
|
1403
|
+
stripBotSuffix(login) === stripBotSuffix(normalizedBot));
|
|
1404
|
+
}
|
|
1405
|
+
function parseIssueCommentEvent(args) {
|
|
1406
|
+
const schema = z.object({
|
|
1407
|
+
action: z.string().min(1),
|
|
1408
|
+
repository: repositorySchema,
|
|
1409
|
+
issue: z.object({
|
|
1410
|
+
number: z.number().int().positive(),
|
|
1411
|
+
html_url: z.string().url(),
|
|
1412
|
+
pull_request: z.unknown().optional(),
|
|
1413
|
+
}),
|
|
1414
|
+
comment: z.object({
|
|
1415
|
+
id: z.number(),
|
|
1416
|
+
body: z.string(),
|
|
1417
|
+
html_url: z.string().url(),
|
|
1418
|
+
url: z.string().url().optional(),
|
|
1419
|
+
user: z
|
|
1420
|
+
.object({
|
|
1421
|
+
login: z.string().optional(),
|
|
1422
|
+
id: z.number().optional(),
|
|
1423
|
+
type: z.string().optional(),
|
|
1424
|
+
})
|
|
1425
|
+
.nullable()
|
|
1426
|
+
.optional(),
|
|
1427
|
+
}),
|
|
1428
|
+
sender: senderSchema,
|
|
1429
|
+
installation: installationSchema,
|
|
1430
|
+
});
|
|
1431
|
+
const parsed = schema.safeParse(args.payload);
|
|
1432
|
+
if (!parsed.success)
|
|
1433
|
+
return null;
|
|
1434
|
+
const payload = parsed.data;
|
|
1435
|
+
const kind = payload.issue.pull_request === undefined ? "issue" : "pull_request";
|
|
1436
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1437
|
+
const sender = toUser(payload.sender);
|
|
1438
|
+
const author = toUser(payload.comment.user);
|
|
1439
|
+
const installationId = payload.installation?.id;
|
|
1440
|
+
const ctx = {
|
|
1441
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1442
|
+
eventName: "issue_comment",
|
|
1443
|
+
repository,
|
|
1444
|
+
conversation: {
|
|
1445
|
+
kind,
|
|
1446
|
+
number: payload.issue.number,
|
|
1447
|
+
url: payload.issue.html_url,
|
|
1448
|
+
},
|
|
1449
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
1450
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
1451
|
+
};
|
|
1452
|
+
const comment = {
|
|
1453
|
+
id: payload.comment.id,
|
|
1454
|
+
body: payload.comment.body,
|
|
1455
|
+
htmlUrl: payload.comment.html_url,
|
|
1456
|
+
url: payload.comment.url ?? payload.comment.html_url,
|
|
1457
|
+
...(author === undefined ? {} : { author }),
|
|
1458
|
+
};
|
|
1459
|
+
return { action: payload.action, ctx, comment };
|
|
1460
|
+
}
|
|
1461
|
+
function parseReviewCommentEvent(args) {
|
|
1462
|
+
const schema = z.object({
|
|
1463
|
+
action: z.string().min(1),
|
|
1464
|
+
repository: repositorySchema,
|
|
1465
|
+
pull_request: z.object({
|
|
1466
|
+
number: z.number().int().positive(),
|
|
1467
|
+
html_url: z.string().url(),
|
|
1468
|
+
head: z
|
|
1469
|
+
.object({
|
|
1470
|
+
sha: z.string().min(1).optional(),
|
|
1471
|
+
ref: z.string().min(1).optional(),
|
|
1472
|
+
})
|
|
1473
|
+
.optional(),
|
|
1474
|
+
base: z
|
|
1475
|
+
.object({
|
|
1476
|
+
ref: z.string().min(1).optional(),
|
|
1477
|
+
})
|
|
1478
|
+
.optional(),
|
|
1479
|
+
}),
|
|
1480
|
+
comment: z.object({
|
|
1481
|
+
id: z.number(),
|
|
1482
|
+
body: z.string(),
|
|
1483
|
+
html_url: z.string().url(),
|
|
1484
|
+
url: z.string().url().optional(),
|
|
1485
|
+
path: z.string().optional(),
|
|
1486
|
+
line: z.number().nullable().optional(),
|
|
1487
|
+
pull_request_review_id: z.number().nullable().optional(),
|
|
1488
|
+
in_reply_to_id: z.number().optional(),
|
|
1489
|
+
user: z
|
|
1490
|
+
.object({
|
|
1491
|
+
login: z.string().optional(),
|
|
1492
|
+
id: z.number().optional(),
|
|
1493
|
+
type: z.string().optional(),
|
|
1494
|
+
})
|
|
1495
|
+
.nullable()
|
|
1496
|
+
.optional(),
|
|
1497
|
+
}),
|
|
1498
|
+
sender: senderSchema,
|
|
1499
|
+
installation: installationSchema,
|
|
1500
|
+
});
|
|
1501
|
+
const parsed = schema.safeParse(args.payload);
|
|
1502
|
+
if (!parsed.success)
|
|
1503
|
+
return null;
|
|
1504
|
+
const payload = parsed.data;
|
|
1505
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1506
|
+
const sender = toUser(payload.sender);
|
|
1507
|
+
const author = toUser(payload.comment.user);
|
|
1508
|
+
const installationId = payload.installation?.id;
|
|
1509
|
+
const ctx = {
|
|
1510
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1511
|
+
eventName: "pull_request_review_comment",
|
|
1512
|
+
repository,
|
|
1513
|
+
conversation: {
|
|
1514
|
+
kind: "review_thread",
|
|
1515
|
+
number: payload.pull_request.number,
|
|
1516
|
+
url: payload.pull_request.html_url,
|
|
1517
|
+
},
|
|
1518
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
1519
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
1520
|
+
};
|
|
1521
|
+
const comment = {
|
|
1522
|
+
id: payload.comment.id,
|
|
1523
|
+
body: payload.comment.body,
|
|
1524
|
+
htmlUrl: payload.comment.html_url,
|
|
1525
|
+
url: payload.comment.url ?? payload.comment.html_url,
|
|
1526
|
+
...(author === undefined ? {} : { author }),
|
|
1527
|
+
...(payload.comment.path === undefined ? {} : { path: payload.comment.path }),
|
|
1528
|
+
...(payload.comment.line === undefined ? {} : { line: payload.comment.line }),
|
|
1529
|
+
...(payload.comment.pull_request_review_id === undefined
|
|
1530
|
+
? {}
|
|
1531
|
+
: { pullRequestReviewId: payload.comment.pull_request_review_id }),
|
|
1532
|
+
...(payload.comment.in_reply_to_id === undefined
|
|
1533
|
+
? {}
|
|
1534
|
+
: { inReplyToId: payload.comment.in_reply_to_id }),
|
|
1535
|
+
};
|
|
1536
|
+
return {
|
|
1537
|
+
action: payload.action,
|
|
1538
|
+
ctx,
|
|
1539
|
+
comment,
|
|
1540
|
+
headSha: payload.pull_request.head?.sha,
|
|
1541
|
+
headRef: payload.pull_request.head?.ref,
|
|
1542
|
+
baseRef: payload.pull_request.base?.ref,
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1545
|
+
function parseIssueEvent(args) {
|
|
1546
|
+
const schema = z.object({
|
|
1547
|
+
action: z.string().min(1),
|
|
1548
|
+
repository: repositorySchema,
|
|
1549
|
+
issue: z.object({
|
|
1550
|
+
number: z.number().int().positive(),
|
|
1551
|
+
html_url: z.string().url(),
|
|
1552
|
+
title: z.string(),
|
|
1553
|
+
body: z.string().nullable().optional(),
|
|
1554
|
+
user: z
|
|
1555
|
+
.object({
|
|
1556
|
+
login: z.string().optional(),
|
|
1557
|
+
})
|
|
1558
|
+
.nullable()
|
|
1559
|
+
.optional(),
|
|
1560
|
+
}),
|
|
1561
|
+
sender: senderSchema,
|
|
1562
|
+
installation: installationSchema,
|
|
1563
|
+
});
|
|
1564
|
+
const parsed = schema.safeParse(args.payload);
|
|
1565
|
+
if (!parsed.success)
|
|
1566
|
+
return null;
|
|
1567
|
+
const payload = parsed.data;
|
|
1568
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1569
|
+
const sender = toUser(payload.sender);
|
|
1570
|
+
const installationId = payload.installation?.id;
|
|
1571
|
+
const ctx = {
|
|
1572
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1573
|
+
eventName: "issues",
|
|
1574
|
+
repository,
|
|
1575
|
+
conversation: {
|
|
1576
|
+
kind: "issue",
|
|
1577
|
+
number: payload.issue.number,
|
|
1578
|
+
url: payload.issue.html_url,
|
|
1579
|
+
},
|
|
1580
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
1581
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
1582
|
+
};
|
|
1583
|
+
const issue = {
|
|
1584
|
+
action: payload.action,
|
|
1585
|
+
number: payload.issue.number,
|
|
1586
|
+
url: payload.issue.html_url,
|
|
1587
|
+
title: payload.issue.title,
|
|
1588
|
+
...(payload.issue.body === undefined || payload.issue.body === null
|
|
1589
|
+
? {}
|
|
1590
|
+
: { body: payload.issue.body }),
|
|
1591
|
+
...(payload.issue.user?.login === undefined ? {} : { authorLogin: payload.issue.user.login }),
|
|
1592
|
+
};
|
|
1593
|
+
return { ctx, issue };
|
|
1594
|
+
}
|
|
1595
|
+
function parseCheckSuiteEvent(args) {
|
|
1596
|
+
const schema = z.object({
|
|
1597
|
+
action: z.string().min(1),
|
|
1598
|
+
repository: repositorySchema,
|
|
1599
|
+
check_suite: z.object({
|
|
1600
|
+
id: z.number(),
|
|
1601
|
+
head_sha: z.string().min(1),
|
|
1602
|
+
status: z.string().optional(),
|
|
1603
|
+
conclusion: z.string().nullable().optional(),
|
|
1604
|
+
app: z
|
|
1605
|
+
.object({
|
|
1606
|
+
slug: z.string().optional(),
|
|
1607
|
+
name: z.string().optional(),
|
|
1608
|
+
})
|
|
1609
|
+
.nullable()
|
|
1610
|
+
.optional(),
|
|
1611
|
+
pull_requests: z
|
|
1612
|
+
.array(z.object({
|
|
1613
|
+
number: z.number(),
|
|
1614
|
+
url: z.string().optional(),
|
|
1615
|
+
html_url: z.string().optional(),
|
|
1616
|
+
}))
|
|
1617
|
+
.optional(),
|
|
1618
|
+
}),
|
|
1619
|
+
sender: senderSchema,
|
|
1620
|
+
installation: installationSchema,
|
|
1621
|
+
});
|
|
1622
|
+
const parsed = schema.safeParse(args.payload);
|
|
1623
|
+
if (!parsed.success)
|
|
1624
|
+
return null;
|
|
1625
|
+
const payload = parsed.data;
|
|
1626
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1627
|
+
const sender = toUser(payload.sender);
|
|
1628
|
+
const installationId = payload.installation?.id;
|
|
1629
|
+
const pullRequests = toCiPullRequests(payload.check_suite.pull_requests);
|
|
1630
|
+
const checkSuite = {
|
|
1631
|
+
action: payload.action,
|
|
1632
|
+
checkSuiteId: payload.check_suite.id,
|
|
1633
|
+
headSha: payload.check_suite.head_sha,
|
|
1634
|
+
...(payload.check_suite.status === undefined ? {} : { status: payload.check_suite.status }),
|
|
1635
|
+
conclusion: (payload.check_suite.conclusion ?? null),
|
|
1636
|
+
app: toCiApp(payload.check_suite.app),
|
|
1637
|
+
pullRequests,
|
|
1638
|
+
};
|
|
1639
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1640
|
+
deliveryId: args.deliveryId,
|
|
1641
|
+
eventName: "check_suite",
|
|
1642
|
+
repository,
|
|
1643
|
+
sender,
|
|
1644
|
+
installationId,
|
|
1645
|
+
});
|
|
1646
|
+
const first = pullRequests[0];
|
|
1647
|
+
if (first === undefined) {
|
|
1648
|
+
return { ctx: null, unanchoredCtx, checkSuite };
|
|
1649
|
+
}
|
|
1650
|
+
return {
|
|
1651
|
+
ctx: {
|
|
1652
|
+
...unanchoredCtx,
|
|
1653
|
+
conversation: {
|
|
1654
|
+
kind: "pull_request",
|
|
1655
|
+
number: first.number,
|
|
1656
|
+
url: first.url ?? `${repository.url}/pull/${first.number}`,
|
|
1657
|
+
},
|
|
1658
|
+
},
|
|
1659
|
+
unanchoredCtx,
|
|
1660
|
+
checkSuite,
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
function parseCheckRunEvent(args) {
|
|
1664
|
+
const schema = z.object({
|
|
1665
|
+
action: z.string().min(1),
|
|
1666
|
+
repository: repositorySchema,
|
|
1667
|
+
check_run: z.object({
|
|
1668
|
+
id: z.number(),
|
|
1669
|
+
name: z.string().optional(),
|
|
1670
|
+
head_sha: z.string().min(1),
|
|
1671
|
+
status: z.string().optional(),
|
|
1672
|
+
conclusion: z.string().nullable().optional(),
|
|
1673
|
+
html_url: z.string().optional(),
|
|
1674
|
+
check_suite: z
|
|
1675
|
+
.object({
|
|
1676
|
+
id: z.number().optional(),
|
|
1677
|
+
})
|
|
1678
|
+
.optional(),
|
|
1679
|
+
app: z
|
|
1680
|
+
.object({
|
|
1681
|
+
slug: z.string().optional(),
|
|
1682
|
+
name: z.string().optional(),
|
|
1683
|
+
})
|
|
1684
|
+
.nullable()
|
|
1685
|
+
.optional(),
|
|
1686
|
+
pull_requests: z
|
|
1687
|
+
.array(z.object({
|
|
1688
|
+
number: z.number(),
|
|
1689
|
+
url: z.string().optional(),
|
|
1690
|
+
html_url: z.string().optional(),
|
|
1691
|
+
}))
|
|
1692
|
+
.optional(),
|
|
1693
|
+
}),
|
|
1694
|
+
sender: senderSchema,
|
|
1695
|
+
installation: installationSchema,
|
|
1696
|
+
});
|
|
1697
|
+
const parsed = schema.safeParse(args.payload);
|
|
1698
|
+
if (!parsed.success)
|
|
1699
|
+
return null;
|
|
1700
|
+
const payload = parsed.data;
|
|
1701
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1702
|
+
const sender = toUser(payload.sender);
|
|
1703
|
+
const installationId = payload.installation?.id;
|
|
1704
|
+
const pullRequests = toCiPullRequests(payload.check_run.pull_requests);
|
|
1705
|
+
const checkRun = {
|
|
1706
|
+
action: payload.action,
|
|
1707
|
+
checkRunId: payload.check_run.id,
|
|
1708
|
+
headSha: payload.check_run.head_sha,
|
|
1709
|
+
...(payload.check_run.name === undefined ? {} : { name: payload.check_run.name }),
|
|
1710
|
+
...(payload.check_run.check_suite?.id === undefined
|
|
1711
|
+
? {}
|
|
1712
|
+
: { checkSuiteId: payload.check_run.check_suite.id }),
|
|
1713
|
+
...(payload.check_run.status === undefined ? {} : { status: payload.check_run.status }),
|
|
1714
|
+
conclusion: (payload.check_run.conclusion ?? null),
|
|
1715
|
+
app: toCiApp(payload.check_run.app),
|
|
1716
|
+
pullRequests,
|
|
1717
|
+
};
|
|
1718
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1719
|
+
deliveryId: args.deliveryId,
|
|
1720
|
+
eventName: "check_run",
|
|
1721
|
+
repository,
|
|
1722
|
+
sender,
|
|
1723
|
+
installationId,
|
|
1724
|
+
});
|
|
1725
|
+
const first = pullRequests[0];
|
|
1726
|
+
if (first === undefined) {
|
|
1727
|
+
return { ctx: null, unanchoredCtx, checkRun };
|
|
1728
|
+
}
|
|
1729
|
+
return {
|
|
1730
|
+
ctx: {
|
|
1731
|
+
...unanchoredCtx,
|
|
1732
|
+
conversation: {
|
|
1733
|
+
kind: "pull_request",
|
|
1734
|
+
number: first.number,
|
|
1735
|
+
url: first.url ?? `${repository.url}/pull/${first.number}`,
|
|
1736
|
+
},
|
|
1737
|
+
},
|
|
1738
|
+
unanchoredCtx,
|
|
1739
|
+
checkRun,
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
function parseWorkflowRunEvent(args) {
|
|
1743
|
+
const schema = z.object({
|
|
1744
|
+
action: z.string().min(1),
|
|
1745
|
+
repository: repositorySchema,
|
|
1746
|
+
workflow_run: z.object({
|
|
1747
|
+
id: z.number(),
|
|
1748
|
+
name: z.string().nullable().optional(),
|
|
1749
|
+
workflow_id: z.number().optional(),
|
|
1750
|
+
head_sha: z.string().min(1),
|
|
1751
|
+
status: z.string().optional(),
|
|
1752
|
+
conclusion: z.string().nullable().optional(),
|
|
1753
|
+
html_url: z.string().optional(),
|
|
1754
|
+
pull_requests: z
|
|
1755
|
+
.array(z.object({
|
|
1756
|
+
number: z.number(),
|
|
1757
|
+
url: z.string().optional(),
|
|
1758
|
+
html_url: z.string().optional(),
|
|
1759
|
+
}))
|
|
1760
|
+
.optional(),
|
|
1761
|
+
}),
|
|
1762
|
+
sender: senderSchema,
|
|
1763
|
+
installation: installationSchema,
|
|
1764
|
+
});
|
|
1765
|
+
const parsed = schema.safeParse(args.payload);
|
|
1766
|
+
if (!parsed.success)
|
|
1767
|
+
return null;
|
|
1768
|
+
const payload = parsed.data;
|
|
1769
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1770
|
+
const sender = toUser(payload.sender);
|
|
1771
|
+
const installationId = payload.installation?.id;
|
|
1772
|
+
const pullRequests = toCiPullRequests(payload.workflow_run.pull_requests);
|
|
1773
|
+
const workflowRun = {
|
|
1774
|
+
action: payload.action,
|
|
1775
|
+
workflowRunId: payload.workflow_run.id,
|
|
1776
|
+
headSha: payload.workflow_run.head_sha,
|
|
1777
|
+
...(payload.workflow_run.name === undefined || payload.workflow_run.name === null
|
|
1778
|
+
? {}
|
|
1779
|
+
: { name: payload.workflow_run.name }),
|
|
1780
|
+
...(payload.workflow_run.workflow_id === undefined
|
|
1781
|
+
? {}
|
|
1782
|
+
: { workflowId: payload.workflow_run.workflow_id }),
|
|
1783
|
+
...(payload.workflow_run.html_url === undefined
|
|
1784
|
+
? {}
|
|
1785
|
+
: { htmlUrl: payload.workflow_run.html_url }),
|
|
1786
|
+
...(payload.workflow_run.status === undefined ? {} : { status: payload.workflow_run.status }),
|
|
1787
|
+
conclusion: (payload.workflow_run.conclusion ?? null),
|
|
1788
|
+
// workflow_run is GitHub Actions-only (Eve semantics).
|
|
1789
|
+
app: { slug: "github-actions", name: "GitHub Actions" },
|
|
1790
|
+
pullRequests,
|
|
1791
|
+
};
|
|
1792
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1793
|
+
deliveryId: args.deliveryId,
|
|
1794
|
+
eventName: "workflow_run",
|
|
1795
|
+
repository,
|
|
1796
|
+
sender,
|
|
1797
|
+
installationId,
|
|
1798
|
+
});
|
|
1799
|
+
const first = pullRequests[0];
|
|
1800
|
+
if (first === undefined) {
|
|
1801
|
+
return { ctx: null, unanchoredCtx, workflowRun };
|
|
1802
|
+
}
|
|
1803
|
+
return {
|
|
1804
|
+
ctx: {
|
|
1805
|
+
...unanchoredCtx,
|
|
1806
|
+
conversation: {
|
|
1807
|
+
kind: "pull_request",
|
|
1808
|
+
number: first.number,
|
|
1809
|
+
url: first.url ?? `${repository.url}/pull/${first.number}`,
|
|
1810
|
+
},
|
|
1811
|
+
},
|
|
1812
|
+
unanchoredCtx,
|
|
1813
|
+
workflowRun,
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
function parseStatusEvent(args) {
|
|
1817
|
+
const schema = z.object({
|
|
1818
|
+
state: z.string().min(1),
|
|
1819
|
+
sha: z.string().min(1),
|
|
1820
|
+
context: z.string().optional(),
|
|
1821
|
+
description: z.string().nullable().optional(),
|
|
1822
|
+
target_url: z.string().nullable().optional(),
|
|
1823
|
+
name: z.string().optional(),
|
|
1824
|
+
branches: z
|
|
1825
|
+
.array(z.object({
|
|
1826
|
+
name: z.string(),
|
|
1827
|
+
commit: z.object({ sha: z.string().optional() }).optional(),
|
|
1828
|
+
}))
|
|
1829
|
+
.optional(),
|
|
1830
|
+
commit: z
|
|
1831
|
+
.object({
|
|
1832
|
+
sha: z.string().optional(),
|
|
1833
|
+
html_url: z.string().optional(),
|
|
1834
|
+
})
|
|
1835
|
+
.optional(),
|
|
1836
|
+
repository: repositorySchema,
|
|
1837
|
+
sender: senderSchema,
|
|
1838
|
+
installation: installationSchema,
|
|
1839
|
+
pull_requests: z
|
|
1840
|
+
.array(z.object({
|
|
1841
|
+
number: z.number(),
|
|
1842
|
+
url: z.string().optional(),
|
|
1843
|
+
html_url: z.string().optional(),
|
|
1844
|
+
}))
|
|
1845
|
+
.optional(),
|
|
1846
|
+
});
|
|
1847
|
+
const parsed = schema.safeParse(args.payload);
|
|
1848
|
+
if (!parsed.success)
|
|
1849
|
+
return null;
|
|
1850
|
+
const payload = parsed.data;
|
|
1851
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1852
|
+
const sender = toUser(payload.sender);
|
|
1853
|
+
const installationId = payload.installation?.id;
|
|
1854
|
+
const pullRequests = toCiPullRequests(payload.pull_requests);
|
|
1855
|
+
const first = pullRequests[0];
|
|
1856
|
+
const status = {
|
|
1857
|
+
state: payload.state,
|
|
1858
|
+
context: payload.context ?? "",
|
|
1859
|
+
...(payload.description === undefined ? {} : { description: payload.description }),
|
|
1860
|
+
...(payload.target_url === undefined ? {} : { targetUrl: payload.target_url }),
|
|
1861
|
+
sha: payload.sha,
|
|
1862
|
+
...(payload.name === undefined ? {} : { name: payload.name }),
|
|
1863
|
+
branches: (payload.branches ?? []).map((branch) => ({
|
|
1864
|
+
name: branch.name,
|
|
1865
|
+
...(branch.commit === undefined ? {} : { commit: branch.commit }),
|
|
1866
|
+
})),
|
|
1867
|
+
...(payload.commit === undefined
|
|
1868
|
+
? {}
|
|
1869
|
+
: {
|
|
1870
|
+
commit: {
|
|
1871
|
+
...(payload.commit.sha === undefined ? {} : { sha: payload.commit.sha }),
|
|
1872
|
+
...(payload.commit.html_url === undefined ? {} : { htmlUrl: payload.commit.html_url }),
|
|
1873
|
+
},
|
|
1874
|
+
}),
|
|
1875
|
+
raw: args.payload,
|
|
1876
|
+
};
|
|
1877
|
+
const ctx = {
|
|
1878
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1879
|
+
eventName: "status",
|
|
1880
|
+
repository,
|
|
1881
|
+
conversation: {
|
|
1882
|
+
kind: "pull_request",
|
|
1883
|
+
number: first?.number ?? 0,
|
|
1884
|
+
url: first?.url ?? repository.url,
|
|
1885
|
+
},
|
|
1886
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
1887
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
1888
|
+
};
|
|
1889
|
+
return { ctx, status };
|
|
1890
|
+
}
|
|
1891
|
+
function parseGenericEvent(args) {
|
|
1892
|
+
const schema = z.object({
|
|
1893
|
+
action: z.string().optional(),
|
|
1894
|
+
repository: repositorySchema.optional(),
|
|
1895
|
+
sender: senderSchema,
|
|
1896
|
+
installation: installationSchema,
|
|
1897
|
+
issue: z
|
|
1898
|
+
.object({
|
|
1899
|
+
number: z.number().int().positive(),
|
|
1900
|
+
html_url: z.string().url().optional(),
|
|
1901
|
+
pull_request: z.unknown().optional(),
|
|
1902
|
+
})
|
|
1903
|
+
.optional(),
|
|
1904
|
+
pull_request: z
|
|
1905
|
+
.object({
|
|
1906
|
+
number: z.number().int().positive(),
|
|
1907
|
+
html_url: z.string().url().optional(),
|
|
1908
|
+
})
|
|
1909
|
+
.optional(),
|
|
1910
|
+
});
|
|
1911
|
+
const parsed = schema.safeParse(args.payload);
|
|
1912
|
+
if (!parsed.success) {
|
|
1913
|
+
return null;
|
|
1914
|
+
}
|
|
1915
|
+
const payload = parsed.data;
|
|
1916
|
+
if (payload.repository === undefined) {
|
|
1917
|
+
return null;
|
|
1918
|
+
}
|
|
1919
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1920
|
+
const sender = toUser(payload.sender);
|
|
1921
|
+
const installationId = payload.installation?.id;
|
|
1922
|
+
const kind = payload.issue?.pull_request !== undefined
|
|
1923
|
+
? "pull_request"
|
|
1924
|
+
: payload.issue !== undefined
|
|
1925
|
+
? "issue"
|
|
1926
|
+
: "pull_request";
|
|
1927
|
+
const number = payload.issue?.number ?? payload.pull_request?.number ?? 0;
|
|
1928
|
+
const url = payload.issue?.html_url ?? payload.pull_request?.html_url ?? repository.url;
|
|
1929
|
+
const event = {
|
|
1930
|
+
eventName: args.eventName,
|
|
1931
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1932
|
+
...(payload.action === undefined ? {} : { action: payload.action }),
|
|
1933
|
+
payload: args.payload,
|
|
1934
|
+
};
|
|
1935
|
+
const ctx = {
|
|
1936
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1937
|
+
eventName: args.eventName,
|
|
1938
|
+
repository,
|
|
1939
|
+
conversation: { kind, number, url },
|
|
1940
|
+
...(sender === undefined ? {} : { sender, senderLogin: sender.login }),
|
|
1941
|
+
...(installationId === undefined ? {} : { installationId }),
|
|
1942
|
+
};
|
|
1943
|
+
return { ctx, event };
|
|
1944
|
+
}
|
|
1945
|
+
function unanchoredEventContext(args) {
|
|
1946
|
+
return {
|
|
1947
|
+
...(args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId }),
|
|
1948
|
+
eventName: args.eventName,
|
|
1949
|
+
repository: args.repository,
|
|
1950
|
+
conversation: {
|
|
1951
|
+
kind: "pull_request",
|
|
1952
|
+
number: 0,
|
|
1953
|
+
url: args.repository.url,
|
|
1954
|
+
},
|
|
1955
|
+
...(args.sender === undefined ? {} : { sender: args.sender, senderLogin: args.sender.login }),
|
|
1956
|
+
...(args.installationId === undefined ? {} : { installationId: args.installationId }),
|
|
1957
|
+
};
|
|
1958
|
+
}
|
|
1959
|
+
function toRepositoryRef(repo) {
|
|
1960
|
+
const [ownerFromName, nameFromFull] = repo.full_name.split("/");
|
|
1961
|
+
return {
|
|
1962
|
+
fullName: repo.full_name,
|
|
1963
|
+
url: repo.html_url,
|
|
1964
|
+
owner: repo.owner?.login ?? ownerFromName ?? "",
|
|
1965
|
+
name: repo.name ?? nameFromFull ?? repo.full_name,
|
|
1966
|
+
...(repo.id === undefined ? {} : { id: repo.id }),
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
function toUser(raw) {
|
|
1970
|
+
if (raw?.login === undefined || raw.login === "")
|
|
1971
|
+
return undefined;
|
|
1972
|
+
return {
|
|
1973
|
+
login: raw.login,
|
|
1974
|
+
...(raw.id === undefined ? {} : { id: raw.id }),
|
|
1975
|
+
...(raw.type === undefined ? {} : { type: raw.type }),
|
|
1976
|
+
};
|
|
1977
|
+
}
|
|
1978
|
+
function toCiPullRequests(raw) {
|
|
1979
|
+
return (raw ?? []).map((pr) => ({
|
|
1980
|
+
number: pr.number,
|
|
1981
|
+
...(pr.html_url !== undefined
|
|
1982
|
+
? { url: pr.html_url }
|
|
1983
|
+
: pr.url !== undefined
|
|
1984
|
+
? { url: pr.url }
|
|
1985
|
+
: {}),
|
|
1986
|
+
}));
|
|
1987
|
+
}
|
|
1988
|
+
function toCiApp(raw) {
|
|
1989
|
+
return {
|
|
1990
|
+
...(raw?.slug === undefined ? {} : { slug: raw.slug }),
|
|
1991
|
+
...(raw?.name === undefined ? {} : { name: raw.name }),
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
function escapeRegExp(value) {
|
|
1995
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1996
|
+
}
|
|
1997
|
+
/**
|
|
1998
|
+
* Attach the GitHub API + thread handles to a parsed context, producing the
|
|
1999
|
+
* full {@link GitHubEventContext} handed to inbound hooks.
|
|
2000
|
+
*/
|
|
2001
|
+
function enrichEventContext(input) {
|
|
2002
|
+
const { github, thread } = buildGitHubBinding({
|
|
2003
|
+
config: input.bindingConfig,
|
|
2004
|
+
state: input.bindingState,
|
|
2005
|
+
});
|
|
2006
|
+
return {
|
|
2007
|
+
...input.ctx,
|
|
2008
|
+
payload: input.payload,
|
|
2009
|
+
...(input.installationId === undefined ? {} : { installationId: input.installationId }),
|
|
2010
|
+
github,
|
|
2011
|
+
thread,
|
|
2012
|
+
host: input.host,
|
|
2013
|
+
artifacts: input.artifacts,
|
|
2014
|
+
...(input.send === undefined ? {} : { send: input.send }),
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
/**
|
|
2018
|
+
* Enrich an unanchored CI context (`conversation.number === 0`). The binding
|
|
2019
|
+
* still resolves `github`, but `thread.post` throws until a PR is attached.
|
|
2020
|
+
*/
|
|
2021
|
+
function enrichCiContext(input) {
|
|
2022
|
+
const binding = githubBindingStateForEvent({
|
|
2023
|
+
kind: input.ctx.conversation.kind,
|
|
2024
|
+
owner: input.ctx.repository.owner,
|
|
2025
|
+
repo: input.ctx.repository.name,
|
|
2026
|
+
number: input.ctx.conversation.number,
|
|
2027
|
+
repositoryId: input.ctx.repository.id,
|
|
2028
|
+
repositoryUrl: input.ctx.repository.url,
|
|
2029
|
+
installationId: input.installationId,
|
|
2030
|
+
});
|
|
2031
|
+
return enrichEventContext({
|
|
2032
|
+
bindingConfig: input.bindingConfig,
|
|
2033
|
+
ctx: input.ctx,
|
|
2034
|
+
bindingState: binding,
|
|
2035
|
+
installationId: input.installationId,
|
|
2036
|
+
payload: input.payload,
|
|
2037
|
+
host: input.host,
|
|
2038
|
+
artifacts: input.artifacts,
|
|
2039
|
+
...(input.send === undefined ? {} : { send: input.send }),
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
/** Build the durable per-session channel state stored with the turn. */
|
|
2043
|
+
function sessionStateFromBinding(input) {
|
|
2044
|
+
return emptyGitHubChannelState({
|
|
2045
|
+
...input.binding,
|
|
2046
|
+
deliveryId: input.deliveryId ?? null,
|
|
2047
|
+
eventName: input.eventName,
|
|
2048
|
+
headSha: input.headSha ?? null,
|
|
2049
|
+
baseRef: input.baseRef ?? null,
|
|
2050
|
+
headRef: input.headRef ?? null,
|
|
2051
|
+
});
|
|
2052
|
+
}
|
|
2053
|
+
/** Read `installation.id` from a raw webhook payload when present. */
|
|
2054
|
+
function readInstallationId(payload) {
|
|
2055
|
+
if (typeof payload !== "object" || payload === null)
|
|
2056
|
+
return undefined;
|
|
2057
|
+
const installation = payload.installation;
|
|
2058
|
+
return typeof installation?.id === "number" ? installation.id : undefined;
|
|
2059
|
+
}
|
|
2060
|
+
/**
|
|
2061
|
+
* The omitted-`webhookSecret` fallback: a {@link SecretRef} naming
|
|
2062
|
+
* `GITHUB_WEBHOOK_SECRET`, present only while that env var is set at
|
|
2063
|
+
* channel construction. Named rather than read so the fallback keeps the
|
|
2064
|
+
* same route policy (and the same control-plane catch declaration) as an
|
|
2065
|
+
* authored `{ secretName: "GITHUB_WEBHOOK_SECRET" }`.
|
|
2066
|
+
*/
|
|
2067
|
+
function envWebhookSecret() {
|
|
2068
|
+
return envSecretRef(GITHUB_WEBHOOK_SECRET_ENV);
|
|
2069
|
+
}
|
|
2070
|
+
async function resolveCloudOptions(cloud, ctx, pullRequest) {
|
|
2071
|
+
if (cloud === undefined || cloud === false) {
|
|
2072
|
+
return undefined;
|
|
2073
|
+
}
|
|
2074
|
+
if (cloud === true) {
|
|
2075
|
+
return {
|
|
2076
|
+
repos: [
|
|
2077
|
+
{
|
|
2078
|
+
url: ctx.repository.url,
|
|
2079
|
+
prUrl: pullRequest.url,
|
|
2080
|
+
startingRef: pullRequest.headSha,
|
|
2081
|
+
},
|
|
2082
|
+
],
|
|
2083
|
+
};
|
|
2084
|
+
}
|
|
2085
|
+
if (typeof cloud === "function") {
|
|
2086
|
+
return await cloud(ctx, pullRequest);
|
|
2087
|
+
}
|
|
2088
|
+
return cloud;
|
|
2089
|
+
}
|