@cursor/bdk 0.2.1
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 +341 -0
- package/LICENSE.md +3 -0
- package/README.md +1190 -0
- package/dist/artifacts.d.ts +34 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +51 -0
- package/dist/bin/agent-sdk.js +2 -0
- package/dist/bin/agent-serve.d.ts +19 -0
- package/dist/bin/agent-serve.d.ts.map +1 -0
- package/dist/bin/agent-serve.js +1578 -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 +664 -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 +277 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts +33 -0
- package/dist/channels/bitbucket/bitbucket-channel.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-channel.js +120 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts +61 -0
- package/dist/channels/bitbucket/bitbucket-webhook.d.ts.map +1 -0
- package/dist/channels/bitbucket/bitbucket-webhook.js +384 -0
- package/dist/channels/bitbucket/checks.d.ts +67 -0
- package/dist/channels/bitbucket/checks.d.ts.map +1 -0
- package/dist/channels/bitbucket/checks.js +102 -0
- package/dist/channels/bitbucket/cursor-account.d.ts +37 -0
- package/dist/channels/bitbucket/cursor-account.d.ts.map +1 -0
- package/dist/channels/bitbucket/cursor-account.js +65 -0
- package/dist/channels/bitbucket/defaults.d.ts +26 -0
- package/dist/channels/bitbucket/defaults.d.ts.map +1 -0
- package/dist/channels/bitbucket/defaults.js +67 -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 +60 -0
- package/dist/channels/bitbucket/index.d.ts +34 -0
- package/dist/channels/bitbucket/index.d.ts.map +1 -0
- package/dist/channels/bitbucket/index.js +33 -0
- package/dist/channels/bitbucket/replay.d.ts +63 -0
- package/dist/channels/bitbucket/replay.d.ts.map +1 -0
- package/dist/channels/bitbucket/replay.js +302 -0
- package/dist/channels/bitbucket/state.d.ts +35 -0
- package/dist/channels/bitbucket/state.d.ts.map +1 -0
- package/dist/channels/bitbucket/state.js +21 -0
- package/dist/channels/bitbucket/types.d.ts +227 -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 +86 -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 +196 -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 +320 -0
- package/dist/channels/github/auth.d.ts +67 -0
- package/dist/channels/github/auth.d.ts.map +1 -0
- package/dist/channels/github/auth.js +233 -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 +114 -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 +98 -0
- package/dist/channels/github/cursor-account.d.ts +102 -0
- package/dist/channels/github/cursor-account.d.ts.map +1 -0
- package/dist/channels/github/cursor-account.js +194 -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 +157 -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 +267 -0
- package/dist/channels/github/github-channel.d.ts +146 -0
- package/dist/channels/github/github-channel.d.ts.map +1 -0
- package/dist/channels/github/github-channel.js +1804 -0
- package/dist/channels/github/index.d.ts +54 -0
- package/dist/channels/github/index.d.ts.map +1 -0
- package/dist/channels/github/index.js +53 -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 +236 -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 +278 -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 +53 -0
- package/dist/channels/github/types.d.ts +491 -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 +234 -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 +147 -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 +122 -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 +55 -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 +33 -0
- package/dist/channels/gitlab/gitlab-channel.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-channel.js +120 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts +45 -0
- package/dist/channels/gitlab/gitlab-webhook.d.ts.map +1 -0
- package/dist/channels/gitlab/gitlab-webhook.js +388 -0
- package/dist/channels/gitlab/index.d.ts +31 -0
- package/dist/channels/gitlab/index.d.ts.map +1 -0
- package/dist/channels/gitlab/index.js +30 -0
- package/dist/channels/gitlab/replay.d.ts +105 -0
- package/dist/channels/gitlab/replay.d.ts.map +1 -0
- package/dist/channels/gitlab/replay.js +199 -0
- package/dist/channels/gitlab/state.d.ts +33 -0
- package/dist/channels/gitlab/state.d.ts.map +1 -0
- package/dist/channels/gitlab/state.js +23 -0
- package/dist/channels/gitlab/types.d.ts +211 -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 +379 -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 +57 -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 +145 -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 +109 -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 +35 -0
- package/dist/channels/origin/index.d.ts.map +1 -0
- package/dist/channels/origin/index.js +34 -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 +634 -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 +231 -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 +58 -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 +23 -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/slack/agentic-delivery.d.ts +23 -0
- package/dist/channels/slack/agentic-delivery.d.ts.map +1 -0
- package/dist/channels/slack/agentic-delivery.js +566 -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 +102 -0
- package/dist/channels/slack/agentic-signals.d.ts +48 -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 +171 -0
- package/dist/channels/slack/api.d.ts.map +1 -0
- package/dist/channels/slack/api.js +613 -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 +67 -0
- package/dist/channels/slack/attachments.d.ts +82 -0
- package/dist/channels/slack/attachments.d.ts.map +1 -0
- package/dist/channels/slack/attachments.js +503 -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 +95 -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 +257 -0
- package/dist/channels/slack/channel-watch.d.ts +76 -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 +228 -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 +166 -0
- package/dist/channels/slack/constants.d.ts +25 -0
- package/dist/channels/slack/constants.d.ts.map +1 -0
- package/dist/channels/slack/constants.js +35 -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 +88 -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 +630 -0
- package/dist/channels/slack/dispatch.d.ts +141 -0
- package/dist/channels/slack/dispatch.d.ts.map +1 -0
- package/dist/channels/slack/dispatch.js +730 -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 +291 -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 +269 -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 +64 -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 +85 -0
- package/dist/channels/slack/inbound.d.ts +98 -0
- package/dist/channels/slack/inbound.d.ts.map +1 -0
- package/dist/channels/slack/inbound.js +314 -0
- package/dist/channels/slack/index.d.ts +53 -0
- package/dist/channels/slack/index.d.ts.map +1 -0
- package/dist/channels/slack/index.js +52 -0
- package/dist/channels/slack/init.d.ts +45 -0
- package/dist/channels/slack/init.d.ts.map +1 -0
- package/dist/channels/slack/init.js +126 -0
- package/dist/channels/slack/interactive.d.ts +65 -0
- package/dist/channels/slack/interactive.d.ts.map +1 -0
- package/dist/channels/slack/interactive.js +310 -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 +19 -0
- package/dist/channels/slack/live-delivery.d.ts +77 -0
- package/dist/channels/slack/live-delivery.d.ts.map +1 -0
- package/dist/channels/slack/live-delivery.js +399 -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 +159 -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 +213 -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 +315 -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 +91 -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 +266 -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 +122 -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 +103 -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 +140 -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 +47 -0
- package/dist/channels/slack/reply-options.d.ts.map +1 -0
- package/dist/channels/slack/reply-options.js +193 -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 +101 -0
- package/dist/channels/slack/slack-channel.d.ts +43 -0
- package/dist/channels/slack/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack/slack-channel.js +534 -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 +114 -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 +38 -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 +79 -0
- package/dist/channels/slack/thread-context.d.ts.map +1 -0
- package/dist/channels/slack/thread-context.js +396 -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 +224 -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 +172 -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 +23 -0
- package/dist/channels/slack/types.d.ts +751 -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 +135 -0
- package/dist/channels.d.ts +175 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +417 -0
- package/dist/connections.d.ts +131 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/connections.js +131 -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 +25 -0
- package/dist/docs/404.html +24 -0
- package/dist/docs/architecture.svg +59 -0
- package/dist/docs/assets/app.JVQvbRO-.js +309 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.js +9 -0
- package/dist/docs/assets/building-with-agents.md.-fcjCmJU.lean.js +1 -0
- package/dist/docs/assets/chunks/@localSearchIndexroot.Caw9W1pM.js +1 -0
- package/dist/docs/assets/chunks/VPLocalSearchBox.BkhY63uW.js +9 -0
- package/dist/docs/assets/chunks/arc.Cc1unYd3.js +1 -0
- package/dist/docs/assets/chunks/architectureDiagram-Q4EWVU46.CAY_TPVz.js +36 -0
- package/dist/docs/assets/chunks/baseUniq.my2VD3Xm.js +1 -0
- package/dist/docs/assets/chunks/blockDiagram-DXYQGD6D.CQXAOmqd.js +132 -0
- package/dist/docs/assets/chunks/c4Diagram-AHTNJAMY.D0AsQFSX.js +10 -0
- package/dist/docs/assets/chunks/channel.Sapo9HJZ.js +1 -0
- package/dist/docs/assets/chunks/chunk-4BX2VUAB.DZjhgNls.js +1 -0
- package/dist/docs/assets/chunks/chunk-4TB4RGXK.qdcp_qbo.js +206 -0
- package/dist/docs/assets/chunks/chunk-55IACEB6.BHXoZhJ-.js +1 -0
- package/dist/docs/assets/chunks/chunk-EDXVE4YY.Cds_Vwj3.js +1 -0
- package/dist/docs/assets/chunks/chunk-FMBD7UC4.CSl0HknT.js +15 -0
- package/dist/docs/assets/chunks/chunk-OYMX7WX6.DJMvAt5N.js +231 -0
- package/dist/docs/assets/chunks/chunk-QZHKN3VN.BYQzBK9D.js +1 -0
- package/dist/docs/assets/chunks/chunk-YZCP3GAM.BAvw7N4o.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-6PBFFD2Q.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/classDiagram-v2-HSJHXN6E.NPiy3Hz7.js +1 -0
- package/dist/docs/assets/chunks/clone.zl2qolPE.js +1 -0
- package/dist/docs/assets/chunks/cose-bilkent-S5V4N54A.Buf3seya.js +1 -0
- package/dist/docs/assets/chunks/cytoscape.esm.BQk4lpUV.js +331 -0
- package/dist/docs/assets/chunks/dagre-KV5264BT.DMGGa3uA.js +4 -0
- package/dist/docs/assets/chunks/defaultLocale.C4B-KCzX.js +1 -0
- package/dist/docs/assets/chunks/diagram-5BDNPKRD.DDjnwRmY.js +10 -0
- package/dist/docs/assets/chunks/diagram-G4DWMVQ6.RwyrIr8Q.js +24 -0
- package/dist/docs/assets/chunks/diagram-MMDJMWI5.DRvQV16Z.js +43 -0
- package/dist/docs/assets/chunks/diagram-TYMM5635.Dw8W9BTk.js +24 -0
- package/dist/docs/assets/chunks/erDiagram-SMLLAGMA.DQT1Hnwf.js +85 -0
- package/dist/docs/assets/chunks/flowDiagram-DWJPFMVM.6_Aky-ut.js +162 -0
- package/dist/docs/assets/chunks/framework.BNw1pucY.js +19 -0
- package/dist/docs/assets/chunks/ganttDiagram-T4ZO3ILL.DHIwqnqN.js +292 -0
- package/dist/docs/assets/chunks/gitGraphDiagram-UUTBAWPF.CGd_eJbn.js +106 -0
- package/dist/docs/assets/chunks/graph.ChMEylkh.js +1 -0
- package/dist/docs/assets/chunks/infoDiagram-42DDH7IO.Cd4gMyAz.js +2 -0
- package/dist/docs/assets/chunks/init.Gi6I4Gst.js +1 -0
- package/dist/docs/assets/chunks/ishikawaDiagram-UXIWVN3A.D1uw7MXq.js +70 -0
- package/dist/docs/assets/chunks/journeyDiagram-VCZTEJTY.AWLXtelc.js +139 -0
- package/dist/docs/assets/chunks/kanban-definition-6JOO6SKY.CagPhAn5.js +89 -0
- package/dist/docs/assets/chunks/katex.DkKDou_j.js +257 -0
- package/dist/docs/assets/chunks/layout.ClTBBkE_.js +1 -0
- package/dist/docs/assets/chunks/linear.SwS2rOLA.js +1 -0
- package/dist/docs/assets/chunks/min.By_x-Btb.js +1 -0
- package/dist/docs/assets/chunks/mindmap-definition-QFDTVHPH.By_RAMaP.js +96 -0
- package/dist/docs/assets/chunks/ordinal.DBvzRdQf.js +1 -0
- package/dist/docs/assets/chunks/pieDiagram-DEJITSTG.DfAl9sy4.js +30 -0
- package/dist/docs/assets/chunks/quadrantDiagram-34T5L4WZ.CNuqFRBj.js +7 -0
- package/dist/docs/assets/chunks/requirementDiagram-MS252O5E.DJ5CmTCl.js +84 -0
- package/dist/docs/assets/chunks/sankeyDiagram-XADWPNL6.D-T_AKJj.js +10 -0
- package/dist/docs/assets/chunks/sequenceDiagram-FGHM5R23.BRn9WcrR.js +157 -0
- package/dist/docs/assets/chunks/stateDiagram-FHFEXIEX.F12urmm7.js +1 -0
- package/dist/docs/assets/chunks/stateDiagram-v2-QKLJ7IA2._auCa3fR.js +1 -0
- package/dist/docs/assets/chunks/theme.zK3OJa_C.js +2 -0
- package/dist/docs/assets/chunks/timeline-definition-GMOUNBTQ.B7GiQBeC.js +120 -0
- package/dist/docs/assets/chunks/vennDiagram-DHZGUBPP.D0niwuY_.js +34 -0
- package/dist/docs/assets/chunks/virtual_mermaid-config.DDnGl6nM.js +1 -0
- package/dist/docs/assets/chunks/wardley-RL74JXVD.1zhHNRsx.js +162 -0
- package/dist/docs/assets/chunks/wardleyDiagram-NUSXRM2D.DKaqpT7K.js +20 -0
- package/dist/docs/assets/chunks/xychartDiagram-5P7HB3ND.e8BPicch.js +7 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.js +32 -0
- package/dist/docs/assets/deployment.md.nGo1yIsa.lean.js +1 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.js +72 -0
- package/dist/docs/assets/evals.md.CCAtNcuL.lean.js +1 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.js +41 -0
- package/dist/docs/assets/guides_agent-to-agent.md.CGkicXeB.lean.js +1 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.js +145 -0
- package/dist/docs/assets/guides_bitbucket.md.Cb3LPKt3.lean.js +1 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.js +10 -0
- package/dist/docs/assets/guides_cloud-agents.md.BuEkDCwo.lean.js +1 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.js +43 -0
- package/dist/docs/assets/guides_convert-automation.md.Ci-Y2iD5.lean.js +1 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.js +156 -0
- package/dist/docs/assets/guides_github.md.C2_DSWlE.lean.js +1 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.js +153 -0
- package/dist/docs/assets/guides_gitlab.md.BM27P43u.lean.js +1 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.js +16 -0
- package/dist/docs/assets/guides_grokbot-agents.md.yxVbSlKA.lean.js +1 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.js +50 -0
- package/dist/docs/assets/guides_hooks.md.BWoiNaMq.lean.js +1 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.js +22 -0
- package/dist/docs/assets/guides_improve.md.COtL-6ft.lean.js +1 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.js +151 -0
- package/dist/docs/assets/guides_jev.md.BNDm14Gy.lean.js +1 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.js +50 -0
- package/dist/docs/assets/guides_mcp-oauth.md.Cu6mhZ_3.lean.js +1 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.js +35 -0
- package/dist/docs/assets/guides_opentelemetry.md.DLlIB5rv.lean.js +1 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.js +70 -0
- package/dist/docs/assets/guides_slack.md.ZbHQETOT.lean.js +1 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.js +92 -0
- package/dist/docs/assets/guides_webhooks.md.D0furjw0.lean.js +1 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.js +7 -0
- package/dist/docs/assets/hillclimbing.md.Biy0m-Qb.lean.js +1 -0
- package/dist/docs/assets/index.md.CVc_oOA3.js +27 -0
- package/dist/docs/assets/index.md.CVc_oOA3.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.wG4shE1f.js +168 -0
- package/dist/docs/assets/quickstart.md.wG4shE1f.lean.js +1 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.js +32 -0
- package/dist/docs/assets/reference_agent-config.md.DzGI777n.lean.js +1 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.js +18 -0
- package/dist/docs/assets/reference_artifacts.md.IFFC5Zln.lean.js +1 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.js +23 -0
- package/dist/docs/assets/reference_channels.md.mbNtKCiR.lean.js +1 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.js +97 -0
- package/dist/docs/assets/reference_cli.md.BK2QUH67.lean.js +1 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.js +63 -0
- package/dist/docs/assets/reference_connections.md._XpKiOaF.lean.js +1 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.js +56 -0
- package/dist/docs/assets/reference_evals.md.DqNyHMA6.lean.js +1 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.js +58 -0
- package/dist/docs/assets/reference_extensions.md.CPPrkWlJ.lean.js +1 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.js +45 -0
- package/dist/docs/assets/reference_hooks.md.Dg3dEugd.lean.js +1 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.js +11 -0
- package/dist/docs/assets/reference_http-api.md.BZOvhCqY.lean.js +1 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.js +14 -0
- package/dist/docs/assets/reference_instructions.md.Bdwscs4G.lean.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.js +1 -0
- package/dist/docs/assets/reference_playground.md.BdQzRJc2.lean.js +1 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.js +25 -0
- package/dist/docs/assets/reference_project-layout.md.CpLQ9j4K.lean.js +1 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.js +9 -0
- package/dist/docs/assets/reference_prompt.md.BQZB4eaV.lean.js +1 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.js +47 -0
- package/dist/docs/assets/reference_schedules.md.BVU5EFbz.lean.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.js +1 -0
- package/dist/docs/assets/reference_sessions.md.BtpTjZmh.lean.js +1 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.js +15 -0
- package/dist/docs/assets/reference_skills.md.Cy00QMKS.lean.js +1 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.js +10 -0
- package/dist/docs/assets/reference_subagents.md.B8oyeXOI.lean.js +1 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.js +90 -0
- package/dist/docs/assets/reference_tools.md.hg2Wi5Bq.lean.js +1 -0
- package/dist/docs/assets/style.C130MVnH.css +1 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.js +14 -0
- package/dist/docs/assets/templates_agentic-owners.md.BykUiZ8j.lean.js +1 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.js +2 -0
- package/dist/docs/assets/templates_security-reviewer.md.DXMmKl_o.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.js +3 -0
- package/dist/docs/assets/templates_thermo-quality-review.md.Dg1p1MsG.lean.js +1 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.js +3 -0
- package/dist/docs/assets/templates_thermo-review.md.Dlylkowj.lean.js +1 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.js +9 -0
- package/dist/docs/assets/templates_triage.md.CvJyx81N.lean.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.js +1 -0
- package/dist/docs/assets/troubleshooting.md.BzZSu1Gz.lean.js +1 -0
- package/dist/docs/building-with-agents.html +68 -0
- package/dist/docs/building-with-agents.md +135 -0
- package/dist/docs/deployment.html +91 -0
- package/dist/docs/deployment.md +211 -0
- package/dist/docs/evals.html +131 -0
- package/dist/docs/evals.md +257 -0
- package/dist/docs/guides/agent-to-agent.html +100 -0
- package/dist/docs/guides/agent-to-agent.md +152 -0
- package/dist/docs/guides/bitbucket.html +204 -0
- package/dist/docs/guides/bitbucket.md +288 -0
- package/dist/docs/guides/cloud-agents.html +69 -0
- package/dist/docs/guides/cloud-agents.md +90 -0
- package/dist/docs/guides/convert-automation.html +102 -0
- package/dist/docs/guides/convert-automation.md +183 -0
- package/dist/docs/guides/github.html +215 -0
- package/dist/docs/guides/github.md +326 -0
- package/dist/docs/guides/gitlab.html +212 -0
- package/dist/docs/guides/gitlab.md +294 -0
- package/dist/docs/guides/grokbot-agents.html +75 -0
- package/dist/docs/guides/grokbot-agents.md +142 -0
- package/dist/docs/guides/hooks.html +109 -0
- package/dist/docs/guides/hooks.md +114 -0
- package/dist/docs/guides/improve.html +81 -0
- package/dist/docs/guides/improve.md +134 -0
- package/dist/docs/guides/jev.html +210 -0
- package/dist/docs/guides/jev.md +294 -0
- package/dist/docs/guides/mcp-oauth.html +109 -0
- package/dist/docs/guides/mcp-oauth.md +162 -0
- package/dist/docs/guides/opentelemetry.html +94 -0
- package/dist/docs/guides/opentelemetry.md +153 -0
- package/dist/docs/guides/slack.html +129 -0
- package/dist/docs/guides/slack.md +273 -0
- package/dist/docs/guides/webhooks.html +151 -0
- package/dist/docs/guides/webhooks.md +236 -0
- package/dist/docs/hashmap.json +1 -0
- package/dist/docs/hillclimbing.html +66 -0
- package/dist/docs/hillclimbing.md +137 -0
- package/dist/docs/index.html +86 -0
- package/dist/docs/index.md +114 -0
- package/dist/docs/llms-full.txt +8439 -0
- package/dist/docs/llms.txt +62 -0
- package/dist/docs/quickstart.html +227 -0
- package/dist/docs/quickstart.md +306 -0
- package/dist/docs/reference/agent-config.html +91 -0
- package/dist/docs/reference/agent-config.md +188 -0
- package/dist/docs/reference/artifacts.html +77 -0
- package/dist/docs/reference/artifacts.md +116 -0
- package/dist/docs/reference/channels.html +82 -0
- package/dist/docs/reference/channels.md +198 -0
- package/dist/docs/reference/cli.html +156 -0
- package/dist/docs/reference/cli.md +904 -0
- package/dist/docs/reference/connections.html +122 -0
- package/dist/docs/reference/connections.md +272 -0
- package/dist/docs/reference/evals.html +115 -0
- package/dist/docs/reference/evals.md +287 -0
- package/dist/docs/reference/extensions.html +117 -0
- package/dist/docs/reference/extensions.md +193 -0
- package/dist/docs/reference/hooks.html +104 -0
- package/dist/docs/reference/hooks.md +190 -0
- package/dist/docs/reference/http-api.html +70 -0
- package/dist/docs/reference/http-api.md +231 -0
- package/dist/docs/reference/instructions.html +73 -0
- package/dist/docs/reference/instructions.md +63 -0
- package/dist/docs/reference/playground.html +60 -0
- package/dist/docs/reference/playground.md +42 -0
- package/dist/docs/reference/project-layout.html +84 -0
- package/dist/docs/reference/project-layout.md +115 -0
- package/dist/docs/reference/prompt.html +68 -0
- package/dist/docs/reference/prompt.md +50 -0
- package/dist/docs/reference/schedules.html +106 -0
- package/dist/docs/reference/schedules.md +170 -0
- package/dist/docs/reference/sessions.html +60 -0
- package/dist/docs/reference/sessions.md +160 -0
- package/dist/docs/reference/skills.html +74 -0
- package/dist/docs/reference/skills.md +75 -0
- package/dist/docs/reference/subagents.html +69 -0
- package/dist/docs/reference/subagents.md +62 -0
- package/dist/docs/reference/tools.html +149 -0
- package/dist/docs/reference/tools.md +324 -0
- package/dist/docs/templates/agentic-owners.html +73 -0
- package/dist/docs/templates/agentic-owners.md +95 -0
- package/dist/docs/templates/security-reviewer.html +61 -0
- package/dist/docs/templates/security-reviewer.md +85 -0
- package/dist/docs/templates/thermo-quality-review.html +62 -0
- package/dist/docs/templates/thermo-quality-review.md +78 -0
- package/dist/docs/templates/thermo-review.html +62 -0
- package/dist/docs/templates/thermo-review.md +77 -0
- package/dist/docs/templates/triage.html +68 -0
- package/dist/docs/templates/triage.md +97 -0
- package/dist/docs/troubleshooting.html +60 -0
- package/dist/docs/troubleshooting.md +143 -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 +459 -0
- package/dist/evals/expect.d.ts +95 -0
- package/dist/evals/expect.d.ts.map +1 -0
- package/dist/evals/expect.js +187 -0
- package/dist/evals/judge.d.ts +133 -0
- package/dist/evals/judge.d.ts.map +1 -0
- package/dist/evals/judge.js +224 -0
- package/dist/evals/loaders.d.ts +51 -0
- package/dist/evals/loaders.d.ts.map +1 -0
- package/dist/evals/loaders.js +124 -0
- package/dist/evals/matchers.d.ts +95 -0
- package/dist/evals/matchers.d.ts.map +1 -0
- package/dist/evals/matchers.js +142 -0
- package/dist/evals/reporters.d.ts +70 -0
- package/dist/evals/reporters.d.ts.map +1 -0
- package/dist/evals/reporters.js +220 -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 +214 -0
- package/dist/evals.d.ts +446 -0
- package/dist/evals.d.ts.map +1 -0
- package/dist/evals.js +292 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts +57 -0
- package/dist/extensions/cursor-cloud-agents/extension.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/extension.js +66 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts +78 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/backend.js +280 -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 +81 -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/repos.d.ts +15 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/repos.js +53 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts +8 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/lib/transcript.js +15 -0
- package/dist/extensions/cursor-cloud-agents/skills/handoff.md +37 -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 +26 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/dump.js +54 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/get.js +25 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts +4 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.d.ts.map +1 -0
- package/dist/extensions/cursor-cloud-agents/tools/launch.js +59 -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 +36 -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 +35 -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 +43 -0
- package/dist/extensions/jev/extension.d.ts.map +1 -0
- package/dist/extensions/jev/extension.js +47 -0
- package/dist/extensions/jev/lib/evaluate.d.ts +101 -0
- package/dist/extensions/jev/lib/evaluate.d.ts.map +1 -0
- package/dist/extensions/jev/lib/evaluate.js +167 -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 +83 -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 +37 -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 +36 -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 +85 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +140 -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 +126 -0
- package/dist/files-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/files-backends/cursor-hosted.js +978 -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 +195 -0
- package/dist/files.d.ts +225 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +152 -0
- package/dist/filesystem.d.ts +484 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/filesystem.js +1698 -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 +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/internal/advertise-tools.d.ts +95 -0
- package/dist/internal/advertise-tools.d.ts.map +1 -0
- package/dist/internal/advertise-tools.js +265 -0
- package/dist/internal/approval-gate.d.ts +33 -0
- package/dist/internal/approval-gate.d.ts.map +1 -0
- package/dist/internal/approval-gate.js +80 -0
- package/dist/internal/artifacts-store.d.ts +125 -0
- package/dist/internal/artifacts-store.d.ts.map +1 -0
- package/dist/internal/artifacts-store.js +737 -0
- package/dist/internal/as-of.d.ts +37 -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 +42 -0
- package/dist/internal/authored-alias-hooks.d.ts.map +1 -0
- package/dist/internal/authored-alias-hooks.js +93 -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 +182 -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 +13 -0
- package/dist/internal/bounded.d.ts +7 -0
- package/dist/internal/bounded.d.ts.map +1 -0
- package/dist/internal/bounded.js +32 -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 +66 -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 +40 -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 +134 -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 +75 -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 +62 -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 +478 -0
- package/dist/internal/cli-ax.d.ts +233 -0
- package/dist/internal/cli-ax.d.ts.map +1 -0
- package/dist/internal/cli-ax.js +1864 -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 +360 -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 +281 -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 +226 -0
- package/dist/internal/cli-deploy.d.ts +164 -0
- package/dist/internal/cli-deploy.d.ts.map +1 -0
- package/dist/internal/cli-deploy.js +1930 -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 +173 -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 +639 -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 +379 -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 +604 -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 +49 -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 +318 -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 +684 -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 +77 -0
- package/dist/internal/cli-slack-manual.d.ts +42 -0
- package/dist/internal/cli-slack-manual.d.ts.map +1 -0
- package/dist/internal/cli-slack-manual.js +325 -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 +695 -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 +36 -0
- package/dist/internal/cloud-turn-cost.d.ts +42 -0
- package/dist/internal/cloud-turn-cost.d.ts.map +1 -0
- package/dist/internal/cloud-turn-cost.js +113 -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 +154 -0
- package/dist/internal/continuation-identity.d.ts +113 -0
- package/dist/internal/continuation-identity.d.ts.map +1 -0
- package/dist/internal/continuation-identity.js +749 -0
- package/dist/internal/conversation-mirror.d.ts +85 -0
- package/dist/internal/conversation-mirror.d.ts.map +1 -0
- package/dist/internal/conversation-mirror.js +342 -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 +998 -0
- package/dist/internal/convert-automation/slug.d.ts +9 -0
- package/dist/internal/convert-automation/slug.d.ts.map +1 -0
- package/dist/internal/convert-automation/slug.js +28 -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/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 +510 -0
- package/dist/internal/cursor/backend-client.d.ts +224 -0
- package/dist/internal/cursor/backend-client.d.ts.map +1 -0
- package/dist/internal/cursor/backend-client.js +720 -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 +195 -0
- package/dist/internal/cursor/credentials.d.ts.map +1 -0
- package/dist/internal/cursor/credentials.js +475 -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 +44 -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 +191 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts +41 -0
- package/dist/internal/cursor/hosted-bound-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-bound-secrets.js +54 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts +30 -0
- package/dist/internal/cursor/hosted-deployment-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-deployment-secrets.js +81 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts +63 -0
- package/dist/internal/cursor/hosted-store-secrets.d.ts.map +1 -0
- package/dist/internal/cursor/hosted-store-secrets.js +112 -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 +97 -0
- package/dist/internal/cursor/store-api-client.d.ts +82 -0
- package/dist/internal/cursor/store-api-client.d.ts.map +1 -0
- package/dist/internal/cursor/store-api-client.js +226 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts +66 -0
- package/dist/internal/cursor-account-mcp-auth.d.ts.map +1 -0
- package/dist/internal/cursor-account-mcp-auth.js +241 -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 +233 -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 +424 -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 +470 -0
- package/dist/internal/deferred-channel-session.d.ts +20 -0
- package/dist/internal/deferred-channel-session.d.ts.map +1 -0
- package/dist/internal/deferred-channel-session.js +62 -0
- package/dist/internal/deploy-client.d.ts +576 -0
- package/dist/internal/deploy-client.d.ts.map +1 -0
- package/dist/internal/deploy-client.js +987 -0
- package/dist/internal/deploy-manifest.d.ts +135 -0
- package/dist/internal/deploy-manifest.d.ts.map +1 -0
- package/dist/internal/deploy-manifest.js +231 -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 +136 -0
- package/dist/internal/describe-error.d.ts +4 -0
- package/dist/internal/describe-error.d.ts.map +1 -0
- package/dist/internal/describe-error.js +29 -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 +48 -0
- package/dist/internal/discovery/agent-config.d.ts.map +1 -0
- package/dist/internal/discovery/agent-config.js +224 -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 +326 -0
- package/dist/internal/discovery/channels.d.ts +10 -0
- package/dist/internal/discovery/channels.d.ts.map +1 -0
- package/dist/internal/discovery/channels.js +97 -0
- package/dist/internal/discovery/connections.d.ts +13 -0
- package/dist/internal/discovery/connections.d.ts.map +1 -0
- package/dist/internal/discovery/connections.js +429 -0
- package/dist/internal/discovery/context.d.ts +20 -0
- package/dist/internal/discovery/context.d.ts.map +1 -0
- package/dist/internal/discovery/context.js +30 -0
- package/dist/internal/discovery/cursor-plugin.d.ts +25 -0
- package/dist/internal/discovery/cursor-plugin.d.ts.map +1 -0
- package/dist/internal/discovery/cursor-plugin.js +549 -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 +173 -0
- package/dist/internal/discovery/extensions.d.ts +27 -0
- package/dist/internal/discovery/extensions.d.ts.map +1 -0
- package/dist/internal/discovery/extensions.js +352 -0
- package/dist/internal/discovery/fs.d.ts +15 -0
- package/dist/internal/discovery/fs.d.ts.map +1 -0
- package/dist/internal/discovery/fs.js +115 -0
- package/dist/internal/discovery/hooks.d.ts +7 -0
- package/dist/internal/discovery/hooks.d.ts.map +1 -0
- package/dist/internal/discovery/hooks.js +61 -0
- package/dist/internal/discovery/info.d.ts +6 -0
- package/dist/internal/discovery/info.d.ts.map +1 -0
- package/dist/internal/discovery/info.js +168 -0
- package/dist/internal/discovery/instructions.d.ts +7 -0
- package/dist/internal/discovery/instructions.d.ts.map +1 -0
- package/dist/internal/discovery/instructions.js +95 -0
- package/dist/internal/discovery/modules.d.ts +20 -0
- package/dist/internal/discovery/modules.d.ts.map +1 -0
- package/dist/internal/discovery/modules.js +104 -0
- package/dist/internal/discovery/names.d.ts +12 -0
- package/dist/internal/discovery/names.d.ts.map +1 -0
- package/dist/internal/discovery/names.js +37 -0
- package/dist/internal/discovery/project.d.ts +51 -0
- package/dist/internal/discovery/project.d.ts.map +1 -0
- package/dist/internal/discovery/project.js +290 -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 +65 -0
- package/dist/internal/discovery/runtime.d.ts +34 -0
- package/dist/internal/discovery/runtime.d.ts.map +1 -0
- package/dist/internal/discovery/runtime.js +97 -0
- package/dist/internal/discovery/schedules.d.ts +7 -0
- package/dist/internal/discovery/schedules.d.ts.map +1 -0
- package/dist/internal/discovery/schedules.js +118 -0
- package/dist/internal/discovery/seed-files.d.ts +7 -0
- package/dist/internal/discovery/seed-files.d.ts.map +1 -0
- package/dist/internal/discovery/seed-files.js +41 -0
- package/dist/internal/discovery/services.d.ts +26 -0
- package/dist/internal/discovery/services.d.ts.map +1 -0
- package/dist/internal/discovery/services.js +138 -0
- package/dist/internal/discovery/skills.d.ts +11 -0
- package/dist/internal/discovery/skills.d.ts.map +1 -0
- package/dist/internal/discovery/skills.js +156 -0
- package/dist/internal/discovery/subagent.d.ts +16 -0
- package/dist/internal/discovery/subagent.d.ts.map +1 -0
- package/dist/internal/discovery/subagent.js +129 -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 +155 -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 +41 -0
- package/dist/internal/docs-site.d.ts.map +1 -0
- package/dist/internal/docs-site.js +234 -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 +90 -0
- package/dist/internal/eval-judge-model.d.ts +59 -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 +468 -0
- package/dist/internal/eval-runner.d.ts +98 -0
- package/dist/internal/eval-runner.d.ts.map +1 -0
- package/dist/internal/eval-runner.js +615 -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 +303 -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 +347 -0
- package/dist/internal/event-mapper.d.ts +123 -0
- package/dist/internal/event-mapper.d.ts.map +1 -0
- package/dist/internal/event-mapper.js +370 -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 +28 -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 +77 -0
- package/dist/internal/filesystem/errors.d.ts +64 -0
- package/dist/internal/filesystem/errors.d.ts.map +1 -0
- package/dist/internal/filesystem/errors.js +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 +212 -0
- package/dist/internal/filesystem/merge.d.ts +34 -0
- package/dist/internal/filesystem/merge.d.ts.map +1 -0
- package/dist/internal/filesystem/merge.js +196 -0
- package/dist/internal/filesystem/nearest.d.ts +14 -0
- package/dist/internal/filesystem/nearest.d.ts.map +1 -0
- package/dist/internal/filesystem/nearest.js +101 -0
- package/dist/internal/filesystem/scratch.d.ts +59 -0
- package/dist/internal/filesystem/scratch.d.ts.map +1 -0
- package/dist/internal/filesystem/scratch.js +204 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts +29 -0
- package/dist/internal/filesystem/sdk-schemas.d.ts.map +1 -0
- package/dist/internal/filesystem/sdk-schemas.js +153 -0
- package/dist/internal/filesystem/tools.d.ts +42 -0
- package/dist/internal/filesystem/tools.d.ts.map +1 -0
- package/dist/internal/filesystem/tools.js +631 -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 +350 -0
- package/dist/internal/framework-file-storage.d.ts +75 -0
- package/dist/internal/framework-file-storage.d.ts.map +1 -0
- package/dist/internal/framework-file-storage.js +338 -0
- package/dist/internal/framework-storage-selection.d.ts +66 -0
- package/dist/internal/framework-storage-selection.d.ts.map +1 -0
- package/dist/internal/framework-storage-selection.js +123 -0
- package/dist/internal/frontmatter.d.ts +20 -0
- package/dist/internal/frontmatter.d.ts.map +1 -0
- package/dist/internal/frontmatter.js +87 -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 +120 -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 +326 -0
- package/dist/internal/handleAgentServeTrigger.d.ts +91 -0
- package/dist/internal/handleAgentServeTrigger.d.ts.map +1 -0
- package/dist/internal/handleAgentServeTrigger.js +199 -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 +274 -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 +77 -0
- package/dist/internal/host-otel.d.ts +25 -0
- package/dist/internal/host-otel.d.ts.map +1 -0
- package/dist/internal/host-otel.js +162 -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 +126 -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 +51 -0
- package/dist/internal/hosted-catch-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-catch-protocol.js +87 -0
- package/dist/internal/hosted-catch.d.ts +40 -0
- package/dist/internal/hosted-catch.d.ts.map +1 -0
- package/dist/internal/hosted-catch.js +146 -0
- package/dist/internal/hosted-delivery-protocol.d.ts +199 -0
- package/dist/internal/hosted-delivery-protocol.d.ts.map +1 -0
- package/dist/internal/hosted-delivery-protocol.js +516 -0
- package/dist/internal/hosted-delivery.d.ts +110 -0
- package/dist/internal/hosted-delivery.d.ts.map +1 -0
- package/dist/internal/hosted-delivery.js +768 -0
- package/dist/internal/hosted-execution-diag.d.ts +75 -0
- package/dist/internal/hosted-execution-diag.d.ts.map +1 -0
- package/dist/internal/hosted-execution-diag.js +220 -0
- package/dist/internal/hosted-execution-flush.d.ts +50 -0
- package/dist/internal/hosted-execution-flush.d.ts.map +1 -0
- package/dist/internal/hosted-execution-flush.js +71 -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 +218 -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 +53 -0
- package/dist/internal/hosting.d.ts.map +1 -0
- package/dist/internal/hosting.js +93 -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 +18 -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 +534 -0
- package/dist/internal/http-control-plane-session.d.ts +34 -0
- package/dist/internal/http-control-plane-session.d.ts.map +1 -0
- package/dist/internal/http-control-plane-session.js +93 -0
- package/dist/internal/ids.d.ts +19 -0
- package/dist/internal/ids.d.ts.map +1 -0
- package/dist/internal/ids.js +34 -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 +41 -0
- package/dist/internal/init-interview.d.ts +67 -0
- package/dist/internal/init-interview.d.ts.map +1 -0
- package/dist/internal/init-interview.js +295 -0
- package/dist/internal/init-project.d.ts +175 -0
- package/dist/internal/init-project.d.ts.map +1 -0
- package/dist/internal/init-project.js +531 -0
- package/dist/internal/init-scaffold.d.ts +9 -0
- package/dist/internal/init-scaffold.d.ts.map +1 -0
- package/dist/internal/init-scaffold.js +172 -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 +176 -0
- package/dist/internal/install-cursor-skills.d.ts +164 -0
- package/dist/internal/install-cursor-skills.d.ts.map +1 -0
- package/dist/internal/install-cursor-skills.js +498 -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 +76 -0
- package/dist/internal/legacy-command-guard.d.ts +22 -0
- package/dist/internal/legacy-command-guard.d.ts.map +1 -0
- package/dist/internal/legacy-command-guard.js +51 -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 +77 -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 +351 -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 +44 -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 +42 -0
- package/dist/internal/logs-client.d.ts +79 -0
- package/dist/internal/logs-client.d.ts.map +1 -0
- package/dist/internal/logs-client.js +350 -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 +48 -0
- package/dist/internal/mcp-endpoint.d.ts +72 -0
- package/dist/internal/mcp-endpoint.d.ts.map +1 -0
- package/dist/internal/mcp-endpoint.js +530 -0
- package/dist/internal/mcp-host.d.ts +84 -0
- package/dist/internal/mcp-host.d.ts.map +1 -0
- package/dist/internal/mcp-host.js +391 -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 +287 -0
- package/dist/internal/mcp-oauth-persist.d.ts +42 -0
- package/dist/internal/mcp-oauth-persist.d.ts.map +1 -0
- package/dist/internal/mcp-oauth-persist.js +90 -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 +450 -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 +34 -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 +43 -0
- package/dist/internal/otel/collector.d.ts.map +1 -0
- package/dist/internal/otel/collector.js +650 -0
- package/dist/internal/otel/config.d.ts +40 -0
- package/dist/internal/otel/config.d.ts.map +1 -0
- package/dist/internal/otel/config.js +231 -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 +95 -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 +55 -0
- package/dist/internal/otel/propagation.d.ts +6 -0
- package/dist/internal/otel/propagation.d.ts.map +1 -0
- package/dist/internal/otel/propagation.js +14 -0
- package/dist/internal/otel/runtime.d.ts +46 -0
- package/dist/internal/otel/runtime.d.ts.map +1 -0
- package/dist/internal/otel/runtime.js +333 -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 +99 -0
- package/dist/internal/peer-connections.d.ts +44 -0
- package/dist/internal/peer-connections.d.ts.map +1 -0
- package/dist/internal/peer-connections.js +67 -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 +70 -0
- package/dist/internal/platform-timers.d.ts +35 -0
- package/dist/internal/platform-timers.d.ts.map +1 -0
- package/dist/internal/platform-timers.js +277 -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 +231 -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 +229 -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 +474 -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 +244 -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 +89 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts +189 -0
- package/dist/internal/reminder-control-plane-protocol.d.ts.map +1 -0
- package/dist/internal/reminder-control-plane-protocol.js +246 -0
- package/dist/internal/reminder-runner.d.ts +208 -0
- package/dist/internal/reminder-runner.d.ts.map +1 -0
- package/dist/internal/reminder-runner.js +1231 -0
- package/dist/internal/reminder-schedule.d.ts +25 -0
- package/dist/internal/reminder-schedule.d.ts.map +1 -0
- package/dist/internal/reminder-schedule.js +82 -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 +126 -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 +76 -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 +84 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -0
- package/dist/internal/resolve-prod-target.js +259 -0
- package/dist/internal/resolved-connections.d.ts +62 -0
- package/dist/internal/resolved-connections.d.ts.map +1 -0
- package/dist/internal/resolved-connections.js +93 -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 +68 -0
- package/dist/internal/run-client.d.ts.map +1 -0
- package/dist/internal/run-client.js +239 -0
- package/dist/internal/runtime-dispatch-runner.d.ts +24 -0
- package/dist/internal/runtime-dispatch-runner.d.ts.map +1 -0
- package/dist/internal/runtime-dispatch-runner.js +54 -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 +31 -0
- package/dist/internal/schedule-runner.d.ts.map +1 -0
- package/dist/internal/schedule-runner.js +127 -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 +152 -0
- package/dist/internal/sdk-runner.d.ts +190 -0
- package/dist/internal/sdk-runner.d.ts.map +1 -0
- package/dist/internal/sdk-runner.js +714 -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 +85 -0
- package/dist/internal/server.d.ts +34 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +2464 -0
- package/dist/internal/session-cost.d.ts +50 -0
- package/dist/internal/session-cost.d.ts.map +1 -0
- package/dist/internal/session-cost.js +157 -0
- package/dist/internal/session-engine.d.ts +912 -0
- package/dist/internal/session-engine.d.ts.map +1 -0
- package/dist/internal/session-engine.js +4493 -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 +67 -0
- package/dist/internal/session-run-log.d.ts +122 -0
- package/dist/internal/session-run-log.d.ts.map +1 -0
- package/dist/internal/session-run-log.js +345 -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 +310 -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 +50 -0
- package/dist/internal/sessions-client.d.ts.map +1 -0
- package/dist/internal/sessions-client.js +207 -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 +41 -0
- package/dist/internal/skills-sync.d.ts +24 -0
- package/dist/internal/skills-sync.d.ts.map +1 -0
- package/dist/internal/skills-sync.js +56 -0
- package/dist/internal/slack-provision-client.d.ts +198 -0
- package/dist/internal/slack-provision-client.d.ts.map +1 -0
- package/dist/internal/slack-provision-client.js +346 -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/start-log-store.d.ts +60 -0
- package/dist/internal/start-log-store.d.ts.map +1 -0
- package/dist/internal/start-log-store.js +149 -0
- package/dist/internal/steering.d.ts +15 -0
- package/dist/internal/steering.d.ts.map +1 -0
- package/dist/internal/steering.js +18 -0
- package/dist/internal/storage-coordinator.d.ts +203 -0
- package/dist/internal/storage-coordinator.d.ts.map +1 -0
- package/dist/internal/storage-coordinator.js +705 -0
- package/dist/internal/storage-roles.d.ts +78 -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 +134 -0
- package/dist/internal/store-api-protocol.d.ts.map +1 -0
- package/dist/internal/store-api-protocol.js +124 -0
- package/dist/internal/store-mirror.d.ts +29 -0
- package/dist/internal/store-mirror.d.ts.map +1 -0
- package/dist/internal/store-mirror.js +70 -0
- package/dist/internal/stream-progress.d.ts +14 -0
- package/dist/internal/stream-progress.d.ts.map +1 -0
- package/dist/internal/stream-progress.js +229 -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 +94 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts +48 -0
- package/dist/internal/testing/factory-resource-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/factory-resource-fixtures.js +41 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts +33 -0
- package/dist/internal/testing/scm-continuation-fixtures.d.ts.map +1 -0
- package/dist/internal/testing/scm-continuation-fixtures.js +253 -0
- package/dist/internal/tool-catalog.d.ts +31 -0
- package/dist/internal/tool-catalog.d.ts.map +1 -0
- package/dist/internal/tool-catalog.js +70 -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 +45 -0
- package/dist/internal/trajectory.d.ts +69 -0
- package/dist/internal/trajectory.d.ts.map +1 -0
- package/dist/internal/trajectory.js +351 -0
- package/dist/internal/turn-cost.d.ts +41 -0
- package/dist/internal/turn-cost.d.ts.map +1 -0
- package/dist/internal/turn-cost.js +109 -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 +111 -0
- package/dist/internal/turn-lease-store.d.ts +44 -0
- package/dist/internal/turn-lease-store.d.ts.map +1 -0
- package/dist/internal/turn-lease-store.js +139 -0
- package/dist/internal/turn-outbox.d.ts +24 -0
- package/dist/internal/turn-outbox.d.ts.map +1 -0
- package/dist/internal/turn-outbox.js +80 -0
- package/dist/internal/update-check.d.ts +93 -0
- package/dist/internal/update-check.d.ts.map +1 -0
- package/dist/internal/update-check.js +427 -0
- package/dist/internal/v2-hosting.d.ts +31 -0
- package/dist/internal/v2-hosting.d.ts.map +1 -0
- package/dist/internal/v2-hosting.js +33 -0
- package/dist/internal/workspace-sync.d.ts +47 -0
- package/dist/internal/workspace-sync.d.ts.map +1 -0
- package/dist/internal/workspace-sync.js +104 -0
- package/dist/internal/workspace.d.ts +151 -0
- package/dist/internal/workspace.d.ts.map +1 -0
- package/dist/internal/workspace.js +455 -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 +104 -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 +138 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +401 -0
- package/dist/otel-public.d.ts +7 -0
- package/dist/otel-public.d.ts.map +1 -0
- package/dist/otel-public.js +5 -0
- package/dist/otel.d.ts +131 -0
- package/dist/otel.d.ts.map +1 -0
- package/dist/otel.js +186 -0
- package/dist/playground/assets/cursor-icons-16-4RnoYH3n.woff2 +0 -0
- package/dist/playground/assets/index-BMV_IcEE.css +1 -0
- package/dist/playground/assets/index-FFdUqTt_.js +71 -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 +70 -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 +82 -0
- package/dist/storage-backends/cursor-hosted-v2.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted-v2.js +171 -0
- package/dist/storage-backends/cursor-hosted.d.ts +107 -0
- package/dist/storage-backends/cursor-hosted.d.ts.map +1 -0
- package/dist/storage-backends/cursor-hosted.js +278 -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 +254 -0
- package/dist/storage-protocol.d.ts +142 -0
- package/dist/storage-protocol.d.ts.map +1 -0
- package/dist/storage-protocol.js +201 -0
- package/dist/storage.d.ts +254 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +154 -0
- package/dist/tools.d.ts +132 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +77 -0
- package/dist/types.d.ts +3375 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +189 -0
- package/docs/README.md +119 -0
- package/docs/building-with-agents.md +140 -0
- package/docs/deployment.md +216 -0
- package/docs/evals.md +262 -0
- package/docs/guides/agent-to-agent.md +157 -0
- package/docs/guides/bitbucket.md +293 -0
- package/docs/guides/cloud-agents.md +95 -0
- package/docs/guides/convert-automation.md +188 -0
- package/docs/guides/github.md +331 -0
- package/docs/guides/gitlab.md +299 -0
- package/docs/guides/grokbot-agents.md +147 -0
- package/docs/guides/hooks.md +119 -0
- package/docs/guides/improve.md +139 -0
- package/docs/guides/jev.md +299 -0
- package/docs/guides/mcp-oauth.md +167 -0
- package/docs/guides/opentelemetry.md +158 -0
- package/docs/guides/slack.md +278 -0
- package/docs/guides/webhooks.md +241 -0
- package/docs/hillclimbing.md +142 -0
- package/docs/quickstart.md +311 -0
- package/docs/reference/agent-config.md +193 -0
- package/docs/reference/artifacts.md +121 -0
- package/docs/reference/channels.md +203 -0
- package/docs/reference/cli.md +909 -0
- package/docs/reference/connections.md +277 -0
- package/docs/reference/evals.md +292 -0
- package/docs/reference/extensions.md +198 -0
- package/docs/reference/hooks.md +195 -0
- package/docs/reference/http-api.md +236 -0
- package/docs/reference/instructions.md +68 -0
- package/docs/reference/playground.md +47 -0
- package/docs/reference/project-layout.md +120 -0
- package/docs/reference/prompt.md +55 -0
- package/docs/reference/schedules.md +175 -0
- package/docs/reference/sessions.md +165 -0
- package/docs/reference/skills.md +80 -0
- package/docs/reference/subagents.md +67 -0
- package/docs/reference/tools.md +329 -0
- package/docs/templates/agentic-owners.md +100 -0
- package/docs/templates/security-reviewer.md +90 -0
- package/docs/templates/thermo-quality-review.md +83 -0
- package/docs/templates/thermo-review.md +82 -0
- package/docs/templates/triage.md +102 -0
- package/docs/troubleshooting.md +148 -0
- package/package.json +384 -0
- package/scripts/install-cursor-skills.mjs +29 -0
- package/skills/create-agent/SKILL.md +170 -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 +125 -0
- package/skills/github/SKILL.md +110 -0
- package/skills/hillclimb/SKILL.md +63 -0
- package/skills/mcp-auth/SKILL.md +84 -0
- package/skills/otel/SKILL.md +50 -0
- package/skills/setup-slack/SKILL.md +149 -0
- package/src/artifacts.ts +65 -0
- package/src/bin/agent-serve.ts +1833 -0
- package/src/channels/bitbucket/api.ts +891 -0
- package/src/channels/bitbucket/binding.ts +417 -0
- package/src/channels/bitbucket/bitbucket-channel.ts +162 -0
- package/src/channels/bitbucket/bitbucket-webhook.ts +519 -0
- package/src/channels/bitbucket/checks.ts +146 -0
- package/src/channels/bitbucket/cursor-account.ts +106 -0
- package/src/channels/bitbucket/defaults.ts +100 -0
- package/src/channels/bitbucket/events.ts +74 -0
- package/src/channels/bitbucket/index.ts +51 -0
- package/src/channels/bitbucket/replay.ts +421 -0
- package/src/channels/bitbucket/state.ts +59 -0
- package/src/channels/bitbucket/types.ts +261 -0
- package/src/channels/change-monitors/change-monitors-channel.ts +63 -0
- package/src/channels/change-monitors/index.ts +8 -0
- package/src/channels/change-monitors/types.ts +42 -0
- package/src/channels/checks.ts +185 -0
- package/src/channels/deployments/deployments-channel.ts +224 -0
- package/src/channels/deployments/index.ts +25 -0
- package/src/channels/deployments/types.ts +92 -0
- package/src/channels/github/api.ts +526 -0
- package/src/channels/github/auth.ts +254 -0
- package/src/channels/github/binding.ts +233 -0
- package/src/channels/github/checks.ts +145 -0
- package/src/channels/github/cursor-account.ts +303 -0
- package/src/channels/github/defaults.ts +168 -0
- package/src/channels/github/events.ts +67 -0
- package/src/channels/github/forward.ts +359 -0
- package/src/channels/github/github-channel.ts +2334 -0
- package/src/channels/github/index.ts +54 -0
- package/src/channels/github/progress.ts +365 -0
- package/src/channels/github/replay.ts +372 -0
- package/src/channels/github/state.ts +124 -0
- package/src/channels/github/types.ts +590 -0
- package/src/channels/gitlab/api.ts +329 -0
- package/src/channels/gitlab/binding.ts +231 -0
- package/src/channels/gitlab/checks.ts +228 -0
- package/src/channels/gitlab/cursor-account.ts +105 -0
- package/src/channels/gitlab/defaults.ts +80 -0
- package/src/channels/gitlab/events.ts +37 -0
- package/src/channels/gitlab/gitlab-channel.ts +160 -0
- package/src/channels/gitlab/gitlab-webhook.ts +509 -0
- package/src/channels/gitlab/index.ts +44 -0
- package/src/channels/gitlab/replay.ts +328 -0
- package/src/channels/gitlab/state.ts +55 -0
- package/src/channels/gitlab/types.ts +247 -0
- package/src/channels/issues/index.ts +9 -0
- package/src/channels/issues/issues-channel.ts +45 -0
- package/src/channels/issues/types.ts +38 -0
- package/src/channels/origin/api.ts +507 -0
- package/src/channels/origin/binding.ts +114 -0
- package/src/channels/origin/checks.ts +250 -0
- package/src/channels/origin/cursor-account.ts +58 -0
- package/src/channels/origin/defaults.ts +140 -0
- package/src/channels/origin/events.ts +35 -0
- package/src/channels/origin/index.ts +35 -0
- package/src/channels/origin/origin-channel.ts +815 -0
- package/src/channels/origin/origin-webhook.ts +296 -0
- package/src/channels/origin/reactions.ts +72 -0
- package/src/channels/origin/state.ts +54 -0
- package/src/channels/origin/types.ts +295 -0
- package/src/channels/slack/agentic-delivery.ts +634 -0
- package/src/channels/slack/agentic-posted.ts +135 -0
- package/src/channels/slack/agentic-signals.ts +231 -0
- package/src/channels/slack/api.ts +761 -0
- package/src/channels/slack/approvals.ts +279 -0
- package/src/channels/slack/assistant.ts +76 -0
- package/src/channels/slack/attachments.ts +596 -0
- package/src/channels/slack/auth.ts +127 -0
- package/src/channels/slack/blocks.ts +131 -0
- package/src/channels/slack/bot-mentions.ts +318 -0
- package/src/channels/slack/channel-watch.ts +314 -0
- package/src/channels/slack/cli-project.ts +249 -0
- package/src/channels/slack/code-fences.ts +171 -0
- package/src/channels/slack/constants.ts +38 -0
- package/src/channels/slack/credentials.ts +88 -0
- package/src/channels/slack/defaults.ts +714 -0
- package/src/channels/slack/dispatch.ts +1060 -0
- package/src/channels/slack/doctor.ts +338 -0
- package/src/channels/slack/eval-directive.ts +306 -0
- package/src/channels/slack/event-id-dedupe.ts +30 -0
- package/src/channels/slack/external-policy.ts +75 -0
- package/src/channels/slack/footer.ts +106 -0
- package/src/channels/slack/inbound.ts +416 -0
- package/src/channels/slack/index.ts +53 -0
- package/src/channels/slack/init.ts +169 -0
- package/src/channels/slack/interactive.ts +406 -0
- package/src/channels/slack/links.ts +23 -0
- package/src/channels/slack/live-delivery.ts +489 -0
- package/src/channels/slack/log.ts +70 -0
- package/src/channels/slack/manifest.ts +239 -0
- package/src/channels/slack/message-body.ts +82 -0
- package/src/channels/slack/nudge-carrier.ts +224 -0
- package/src/channels/slack/nudge-store.ts +334 -0
- package/src/channels/slack/paint-start.ts +93 -0
- package/src/channels/slack/placeholder.ts +358 -0
- package/src/channels/slack/pr-ref.ts +74 -0
- package/src/channels/slack/progress-delivery.ts +138 -0
- package/src/channels/slack/reasoning-card.ts +125 -0
- package/src/channels/slack/reasoning-chip.ts +41 -0
- package/src/channels/slack/recording-sink.ts +167 -0
- package/src/channels/slack/redact.ts +6 -0
- package/src/channels/slack/reply-options.ts +279 -0
- package/src/channels/slack/setup.ts +125 -0
- package/src/channels/slack/slack-channel.ts +744 -0
- package/src/channels/slack/socket-mode.ts +140 -0
- package/src/channels/slack/stop.ts +25 -0
- package/src/channels/slack/stream.ts +66 -0
- package/src/channels/slack/thread-context.ts +485 -0
- package/src/channels/slack/tool-approval-events.ts +233 -0
- package/src/channels/slack/tool-cards.ts +198 -0
- package/src/channels/slack/tool-chip.ts +34 -0
- package/src/channels/slack/types.ts +782 -0
- package/src/channels/slack/upload.ts +137 -0
- package/src/channels.ts +543 -0
- package/src/connections.ts +153 -0
- package/src/dashboard-session-url.ts +30 -0
- package/src/evals/assertions.ts +688 -0
- package/src/evals/expect.ts +250 -0
- package/src/evals/judge.ts +329 -0
- package/src/evals/loaders.ts +111 -0
- package/src/evals/matchers.ts +223 -0
- package/src/evals/reporters.ts +257 -0
- package/src/evals/results.ts +130 -0
- package/src/evals/run-facts.ts +306 -0
- package/src/evals.ts +709 -0
- package/src/extensions/cursor-cloud-agents/extension.ts +114 -0
- package/src/extensions/cursor-cloud-agents/lib/backend.ts +386 -0
- package/src/extensions/cursor-cloud-agents/lib/fleet.ts +98 -0
- package/src/extensions/cursor-cloud-agents/lib/inputs.ts +5 -0
- package/src/extensions/cursor-cloud-agents/lib/repos.ts +68 -0
- package/src/extensions/cursor-cloud-agents/lib/transcript.ts +19 -0
- package/src/extensions/cursor-cloud-agents/skills/handoff.md +37 -0
- package/src/extensions/cursor-cloud-agents/tools/cancel.ts +19 -0
- package/src/extensions/cursor-cloud-agents/tools/dump.ts +47 -0
- package/src/extensions/cursor-cloud-agents/tools/get.ts +18 -0
- package/src/extensions/cursor-cloud-agents/tools/launch.ts +60 -0
- package/src/extensions/cursor-cloud-agents/tools/list.ts +31 -0
- package/src/extensions/cursor-cloud-agents/tools/reply.ts +34 -0
- package/src/extensions/improve/extension.ts +69 -0
- package/src/extensions/improve/skills/yourself.ts +50 -0
- package/src/extensions/jev/extension.ts +95 -0
- package/src/extensions/jev/lib/evaluate.ts +266 -0
- package/src/extensions/jev/skills/gated-write.md +25 -0
- package/src/extensions/jev/skills/questions.md +33 -0
- package/src/extensions/jev/tools/evaluate.ts +82 -0
- package/src/extensions/slack-communication/evals/harness.ts +705 -0
- package/src/extensions/slack-communication/evals/slack-communication.eval.ts +830 -0
- package/src/extensions/slack-communication/evals/slack-placeholder.eval.ts +172 -0
- package/src/extensions/slack-communication/extension.ts +44 -0
- package/src/extensions/slack-communication/skills/slack-voice.ts +56 -0
- package/src/extensions/slack-communication/tools/delete-message.ts +33 -0
- package/src/extensions/slack-communication/tools/edit-message.ts +42 -0
- package/src/extensions/slack-communication/tools/post-card.ts +28 -0
- package/src/extensions/slack-communication/tools/post-file.ts +82 -0
- package/src/extensions/slack-communication/tools/post-update.ts +40 -0
- package/src/extensions/slack-communication/tools/react.ts +30 -0
- package/src/extensions/slack-communication/tools/set-status.ts +21 -0
- package/src/extensions.ts +179 -0
- package/src/files-backends/agent-store-presigned-url.ts +11 -0
- package/src/files-backends/cursor-hosted.ts +1212 -0
- package/src/files-backends/local-fs.ts +163 -0
- package/src/files.ts +293 -0
- package/src/filesystem.ts +2005 -0
- package/src/hooks.ts +30 -0
- package/src/index.ts +259 -0
- package/src/internal/advertise-tools.ts +370 -0
- package/src/internal/approval-gate.ts +103 -0
- package/src/internal/artifacts-store.ts +825 -0
- package/src/internal/as-of.ts +257 -0
- package/src/internal/auth.ts +46 -0
- package/src/internal/authored-alias-hooks.ts +138 -0
- package/src/internal/authored-loaders.ts +188 -0
- package/src/internal/bounded-int.ts +24 -0
- package/src/internal/bounded.ts +25 -0
- package/src/internal/brand.ts +28 -0
- package/src/internal/browser-origin-guard.ts +67 -0
- package/src/internal/builtin-tools/artifacts.ts +62 -0
- package/src/internal/builtin-tools/index.ts +53 -0
- package/src/internal/builtin-tools/reminders.ts +145 -0
- package/src/internal/channel-dispatch.ts +129 -0
- package/src/internal/channel-route-dispatch.ts +58 -0
- package/src/internal/channel-state.ts +83 -0
- package/src/internal/chat-client.ts +594 -0
- package/src/internal/cli-ax.ts +2273 -0
- package/src/internal/cli-bitbucket.ts +438 -0
- package/src/internal/cli-convert-automation.ts +335 -0
- package/src/internal/cli-cursor.ts +282 -0
- package/src/internal/cli-deploy.ts +2486 -0
- package/src/internal/cli-docs.ts +192 -0
- package/src/internal/cli-github.ts +806 -0
- package/src/internal/cli-gitlab.ts +452 -0
- package/src/internal/cli-images.ts +672 -0
- package/src/internal/cli-manifest.ts +56 -0
- package/src/internal/cli-mcp-oauth.ts +395 -0
- package/src/internal/cli-mcp.ts +808 -0
- package/src/internal/cli-skills.ts +99 -0
- package/src/internal/cli-slack-manual.ts +418 -0
- package/src/internal/cli-slack.ts +874 -0
- package/src/internal/cloud-merge.ts +51 -0
- package/src/internal/cloud-turn-cost.ts +159 -0
- package/src/internal/continuation-channel.ts +233 -0
- package/src/internal/continuation-identity.ts +935 -0
- package/src/internal/conversation-mirror.ts +423 -0
- package/src/internal/convert-automation/convert-workflow.ts +1377 -0
- package/src/internal/convert-automation/slug.ts +29 -0
- package/src/internal/convert-automation/types.ts +212 -0
- package/src/internal/cron.ts +76 -0
- package/src/internal/cursor/account-mcp.ts +692 -0
- package/src/internal/cursor/backend-client.ts +978 -0
- package/src/internal/cursor/bound-secret-file.ts +101 -0
- package/src/internal/cursor/credentials.ts +560 -0
- package/src/internal/cursor/cursor-api-transport.ts +65 -0
- package/src/internal/cursor/github-credentials.ts +228 -0
- package/src/internal/cursor/hosted-bound-secrets.ts +71 -0
- package/src/internal/cursor/hosted-deployment-secrets.ts +100 -0
- package/src/internal/cursor/hosted-store-secrets.ts +152 -0
- package/src/internal/cursor/session-token.ts +111 -0
- package/src/internal/cursor/store-api-client.ts +323 -0
- package/src/internal/cursor-account-mcp-auth.ts +303 -0
- package/src/internal/cursor-agent-template.ts +50 -0
- package/src/internal/cursor-deployment-relay.ts +315 -0
- package/src/internal/cursor-event-relay.ts +675 -0
- package/src/internal/cursor-relay-core.ts +563 -0
- package/src/internal/deferred-channel-session.ts +61 -0
- package/src/internal/deploy-client.ts +1504 -0
- package/src/internal/deploy-manifest.ts +361 -0
- package/src/internal/deploy-source.ts +144 -0
- package/src/internal/describe-error.ts +32 -0
- package/src/internal/dev-mode.ts +20 -0
- package/src/internal/discovery/agent-config.ts +288 -0
- package/src/internal/discovery/agent.ts +381 -0
- package/src/internal/discovery/channels.ts +100 -0
- package/src/internal/discovery/connections.ts +505 -0
- package/src/internal/discovery/context.ts +38 -0
- package/src/internal/discovery/cursor-plugin.ts +628 -0
- package/src/internal/discovery/extension-overlay.ts +247 -0
- package/src/internal/discovery/extensions.ts +490 -0
- package/src/internal/discovery/fs.ts +103 -0
- package/src/internal/discovery/hooks.ts +63 -0
- package/src/internal/discovery/info.ts +174 -0
- package/src/internal/discovery/instructions.ts +98 -0
- package/src/internal/discovery/modules.ts +107 -0
- package/src/internal/discovery/names.ts +45 -0
- package/src/internal/discovery/project.ts +319 -0
- package/src/internal/discovery/reminders.ts +65 -0
- package/src/internal/discovery/runtime.ts +158 -0
- package/src/internal/discovery/schedules.ts +120 -0
- package/src/internal/discovery/seed-files.ts +34 -0
- package/src/internal/discovery/services.ts +151 -0
- package/src/internal/discovery/skills.ts +174 -0
- package/src/internal/discovery/subagent.ts +138 -0
- package/src/internal/discovery/tools.ts +170 -0
- package/src/internal/discovery.ts +27 -0
- package/src/internal/distribution.ts +126 -0
- package/src/internal/docs-site.ts +248 -0
- package/src/internal/duration.ts +37 -0
- package/src/internal/env-file.ts +83 -0
- package/src/internal/eval-judge-model.ts +142 -0
- package/src/internal/eval-run-store.ts +585 -0
- package/src/internal/eval-runner.ts +823 -0
- package/src/internal/evals-client.ts +475 -0
- package/src/internal/event-log.ts +342 -0
- package/src/internal/event-mapper.ts +480 -0
- package/src/internal/expected-delivery-failure.ts +34 -0
- package/src/internal/factory-resource-channel.ts +103 -0
- package/src/internal/filesystem/errors.ts +207 -0
- package/src/internal/filesystem/format.ts +253 -0
- package/src/internal/filesystem/merge.ts +192 -0
- package/src/internal/filesystem/nearest.ts +112 -0
- package/src/internal/filesystem/scratch.ts +239 -0
- package/src/internal/filesystem/sdk-schemas.ts +204 -0
- package/src/internal/filesystem/tools.ts +804 -0
- package/src/internal/filesystem/walk.ts +366 -0
- package/src/internal/fixtures/units-server.ts +52 -0
- package/src/internal/framework-file-storage.ts +357 -0
- package/src/internal/framework-storage-selection.ts +156 -0
- package/src/internal/frontmatter.ts +108 -0
- package/src/internal/github-fanout.ts +144 -0
- package/src/internal/guest-network.ts +391 -0
- package/src/internal/handleAgentServeTrigger.ts +286 -0
- package/src/internal/host-files.ts +341 -0
- package/src/internal/host-kv.ts +81 -0
- package/src/internal/host-otel.ts +231 -0
- package/src/internal/host-platforms.ts +170 -0
- package/src/internal/hosted-admission-adapter.ts +47 -0
- package/src/internal/hosted-admission-context.ts +37 -0
- package/src/internal/hosted-catch-protocol.ts +112 -0
- package/src/internal/hosted-catch.ts +179 -0
- package/src/internal/hosted-delivery-protocol.ts +787 -0
- package/src/internal/hosted-delivery.ts +1152 -0
- package/src/internal/hosted-execution-diag.ts +291 -0
- package/src/internal/hosted-execution-flush.ts +136 -0
- package/src/internal/hosted-execution-latency.ts +301 -0
- package/src/internal/hosted-managed-automation.ts +116 -0
- package/src/internal/hosting.ts +107 -0
- package/src/internal/http-channel-define.ts +25 -0
- package/src/internal/http-channel.ts +669 -0
- package/src/internal/http-control-plane-session.ts +110 -0
- package/src/internal/ids.ts +39 -0
- package/src/internal/incoming-headers-to-fetch.ts +45 -0
- package/src/internal/init-interview.ts +360 -0
- package/src/internal/init-project.ts +711 -0
- package/src/internal/init-scaffold.ts +182 -0
- package/src/internal/inline-stdio-define-stub.ts +4 -0
- package/src/internal/inline-stdio-mcp.ts +230 -0
- package/src/internal/install-cursor-skills.ts +601 -0
- package/src/internal/is-record.ts +3 -0
- package/src/internal/json-schema.ts +95 -0
- package/src/internal/legacy-command-guard.ts +54 -0
- package/src/internal/listen-port.ts +85 -0
- package/src/internal/local-control-plane.ts +442 -0
- package/src/internal/local-env.ts +59 -0
- package/src/internal/local-ingress.ts +90 -0
- package/src/internal/log-ring.ts +59 -0
- package/src/internal/logs-client.ts +477 -0
- package/src/internal/map-pool.ts +39 -0
- package/src/internal/mcp-endpoint.ts +747 -0
- package/src/internal/mcp-host.ts +481 -0
- package/src/internal/mcp-oauth-on-demand.ts +337 -0
- package/src/internal/mcp-oauth-persist.ts +118 -0
- package/src/internal/mcp-oauth.ts +549 -0
- package/src/internal/net.ts +29 -0
- package/src/internal/open-browser.ts +41 -0
- package/src/internal/otel/attrs.ts +16 -0
- package/src/internal/otel/collector.ts +937 -0
- package/src/internal/otel/config.ts +287 -0
- package/src/internal/otel/http.ts +122 -0
- package/src/internal/otel/mcp.ts +56 -0
- package/src/internal/otel/propagation.ts +17 -0
- package/src/internal/otel/runtime.ts +441 -0
- package/src/internal/package-inline-stdio.ts +114 -0
- package/src/internal/peer-connections.ts +96 -0
- package/src/internal/platform-schedule-sync.ts +75 -0
- package/src/internal/platform-timers.ts +365 -0
- package/src/internal/playground/static.ts +278 -0
- package/src/internal/playground/toolchain.ts +270 -0
- package/src/internal/playground-proxy.ts +564 -0
- package/src/internal/process-memory-telemetry.ts +334 -0
- package/src/internal/project-layout.ts +31 -0
- package/src/internal/prompt-context.ts +116 -0
- package/src/internal/reminder-control-plane-protocol.ts +482 -0
- package/src/internal/reminder-runner.ts +1559 -0
- package/src/internal/reminder-schedule.ts +104 -0
- package/src/internal/reminder-store.ts +176 -0
- package/src/internal/request-error-status.ts +95 -0
- package/src/internal/request-headers.ts +21 -0
- package/src/internal/resolve-prod-target.ts +334 -0
- package/src/internal/resolved-connections.ts +190 -0
- package/src/internal/router.ts +143 -0
- package/src/internal/run-client.ts +354 -0
- package/src/internal/runtime-dispatch-runner.ts +50 -0
- package/src/internal/sanitize-mcp-tool-name.ts +31 -0
- package/src/internal/schedule-runner.ts +154 -0
- package/src/internal/scm/pr-url.ts +245 -0
- package/src/internal/sdk-runner.ts +948 -0
- package/src/internal/serve-restart.ts +113 -0
- package/src/internal/server.ts +3135 -0
- package/src/internal/session-cost.ts +208 -0
- package/src/internal/session-engine.ts +5602 -0
- package/src/internal/session-links.ts +84 -0
- package/src/internal/session-run-log.ts +535 -0
- package/src/internal/session-store.ts +307 -0
- package/src/internal/session-urls.ts +32 -0
- package/src/internal/sessions-client.ts +239 -0
- package/src/internal/skill-catalog.ts +66 -0
- package/src/internal/skills-sync.ts +55 -0
- package/src/internal/slack-provision-client.ts +544 -0
- package/src/internal/slack-thread-key.ts +11 -0
- package/src/internal/sleep.ts +3 -0
- package/src/internal/start-log-store.ts +164 -0
- package/src/internal/steering.ts +17 -0
- package/src/internal/storage-coordinator.ts +800 -0
- package/src/internal/storage-roles.ts +86 -0
- package/src/internal/storage.ts +1 -0
- package/src/internal/store-api-protocol.ts +205 -0
- package/src/internal/store-mirror.ts +73 -0
- package/src/internal/stream-progress.ts +294 -0
- package/src/internal/terminal-style.ts +133 -0
- package/src/internal/testing/factory-resource-fixtures.ts +84 -0
- package/src/internal/testing/scm-continuation-fixtures.ts +285 -0
- package/src/internal/tool-catalog.ts +104 -0
- package/src/internal/tool-policy.ts +222 -0
- package/src/internal/tool-result.ts +50 -0
- package/src/internal/trajectory.ts +418 -0
- package/src/internal/turn-cost.ts +136 -0
- package/src/internal/turn-governor.ts +145 -0
- package/src/internal/turn-lease-store.ts +144 -0
- package/src/internal/turn-outbox.ts +77 -0
- package/src/internal/update-check.ts +517 -0
- package/src/internal/v2-hosting.ts +52 -0
- package/src/internal/workspace-sync.ts +114 -0
- package/src/internal/workspace.ts +505 -0
- package/src/kv/memory-kv.ts +94 -0
- package/src/kv.ts +18 -0
- package/src/memory.ts +487 -0
- package/src/otel-public.ts +24 -0
- package/src/otel.ts +320 -0
- package/src/prompt.ts +80 -0
- package/src/reminders.ts +65 -0
- package/src/schedules.ts +31 -0
- package/src/skills.ts +27 -0
- package/src/storage-backends/cursor-hosted-v2.ts +204 -0
- package/src/storage-backends/cursor-hosted.ts +388 -0
- package/src/storage-backends/file-kv.ts +276 -0
- package/src/storage-protocol.ts +261 -0
- package/src/storage.ts +408 -0
- package/src/tools.ts +166 -0
- package/src/types.ts +3725 -0
- package/templates/agentic-owners/README.md +76 -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 +217 -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 +454 -0
- package/templates/agentic-owners/bot/lib/owners/handles.ts +54 -0
- package/templates/agentic-owners/bot/lib/owners/match.ts +219 -0
- package/templates/agentic-owners/bot/lib/owners/matching.ts +78 -0
- package/templates/agentic-owners/bot/lib/owners/parse.ts +565 -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 +50 -0
- package/templates/agentic-owners/bot/lib/review.ts +722 -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 +42 -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 +28 -0
- package/templates/agents-md/bot/channels/slack.ts +9 -0
- package/templates/agents-md/bot/instructions.md +39 -0
- package/templates/agents-md/bot/lib/collect.ts +415 -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 +218 -0
- package/templates/agents-md/evals/agents.eval.ts +135 -0
- package/templates/agents-md/evals/evals.config.ts +5 -0
- package/templates/agents-md/init.json +38 -0
- package/templates/agents-md/package.json +18 -0
- package/templates/agents-md/tsconfig.json +12 -0
- package/templates/code-wiki/README.md +37 -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 +40 -0
- package/templates/demo/bot/agent.ts +8 -0
- package/templates/demo/bot/channels/github.ts +48 -0
- package/templates/demo/bot/channels/queue.ts +34 -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 +29 -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 +37 -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 +22 -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 +40 -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 +34 -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 +38 -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 +38 -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 +50 -0
- package/templates/triage/bot/agent.ts +8 -0
- package/templates/triage/bot/channels/queue.ts +40 -0
- package/templates/triage/bot/channels/webhook.ts +44 -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 +166 -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 +24 -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 +24 -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,1804 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { allowAll, defineChannel, localDevStrict, loopbackGitHubDev, POST, } from "../../channels.js";
|
|
13
|
+
import { acknowledgeTask, acknowledgeTurn, isTaskDispatch, scheduleAfterAck, skipped, turnStarted, withPropagatingBackgroundErrors, } from "../../internal/channel-dispatch.js";
|
|
14
|
+
import { continuationSource, normalizeIdentity } from "../../internal/continuation-identity.js";
|
|
15
|
+
import { isDevMode } from "../../internal/dev-mode.js";
|
|
16
|
+
import { attachHostedAdmissionAdapter } from "../../internal/hosted-admission-adapter.js";
|
|
17
|
+
import { bindLocalIngressSend } from "../../internal/local-ingress.js";
|
|
18
|
+
import { resolveCredentialValue } from "./auth.js";
|
|
19
|
+
import { buildGitHubBinding, } from "./binding.js";
|
|
20
|
+
import { createCursorAccountGithubTokenResolver, createPendingCursorGithubCredentials, cursorGithubPermissionsForChannel, parseCursorGithubRepoScope, registerGithubCursorAccountRuntime, } from "./cursor-account.js";
|
|
21
|
+
import { buildDefaultGitHubEvents } from "./defaults.js";
|
|
22
|
+
import { deriveGitHubWebhookEvents, GITHUB_CHANNEL_KIND } from "./events.js";
|
|
23
|
+
import { emptyGitHubChannelState, githubBindingStateForEvent, } from "./state.js";
|
|
24
|
+
const DEFAULT_PULL_REQUEST_ACTIONS = new Set([
|
|
25
|
+
"opened",
|
|
26
|
+
"reopened",
|
|
27
|
+
"synchronize",
|
|
28
|
+
"ready_for_review",
|
|
29
|
+
]);
|
|
30
|
+
const repositorySchema = z.object({
|
|
31
|
+
id: z.number().optional(),
|
|
32
|
+
full_name: z.string().min(1),
|
|
33
|
+
html_url: z.string().url(),
|
|
34
|
+
name: z.string().optional(),
|
|
35
|
+
owner: z
|
|
36
|
+
.object({
|
|
37
|
+
login: z.string().optional(),
|
|
38
|
+
})
|
|
39
|
+
.optional(),
|
|
40
|
+
});
|
|
41
|
+
const senderSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
login: z.string().min(1).optional(),
|
|
44
|
+
id: z.number().optional(),
|
|
45
|
+
type: z.string().optional(),
|
|
46
|
+
})
|
|
47
|
+
.nullable()
|
|
48
|
+
.optional();
|
|
49
|
+
const installationSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
id: z.number().optional(),
|
|
52
|
+
})
|
|
53
|
+
.nullable()
|
|
54
|
+
.optional();
|
|
55
|
+
const githubPullRequestPayloadSchema = z.object({
|
|
56
|
+
action: z.string().min(1),
|
|
57
|
+
repository: repositorySchema,
|
|
58
|
+
pull_request: z.object({
|
|
59
|
+
number: z.number().int().positive(),
|
|
60
|
+
html_url: z.string().url(),
|
|
61
|
+
title: z.string(),
|
|
62
|
+
body: z.string().nullable().optional(),
|
|
63
|
+
draft: z.boolean().optional(),
|
|
64
|
+
merged: z.boolean().optional(),
|
|
65
|
+
user: z
|
|
66
|
+
.object({
|
|
67
|
+
login: z.string().min(1).optional(),
|
|
68
|
+
id: z.number().optional(),
|
|
69
|
+
type: z.string().optional(),
|
|
70
|
+
})
|
|
71
|
+
.nullable()
|
|
72
|
+
.optional(),
|
|
73
|
+
head: z.object({
|
|
74
|
+
ref: z.string().min(1),
|
|
75
|
+
sha: z.string().min(1),
|
|
76
|
+
}),
|
|
77
|
+
base: z.object({
|
|
78
|
+
ref: z.string().min(1),
|
|
79
|
+
sha: z.string().optional(),
|
|
80
|
+
}),
|
|
81
|
+
}),
|
|
82
|
+
changes: z
|
|
83
|
+
.object({
|
|
84
|
+
base: z
|
|
85
|
+
.object({
|
|
86
|
+
ref: z.object({ from: z.string().min(1).optional() }).optional(),
|
|
87
|
+
})
|
|
88
|
+
.optional(),
|
|
89
|
+
})
|
|
90
|
+
.nullable()
|
|
91
|
+
.optional(),
|
|
92
|
+
sender: senderSchema,
|
|
93
|
+
installation: installationSchema,
|
|
94
|
+
label: z
|
|
95
|
+
.object({
|
|
96
|
+
name: z.string().min(1),
|
|
97
|
+
})
|
|
98
|
+
.nullable()
|
|
99
|
+
.optional(),
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* Derive the turn's auth from the actor that triggered the delivery — the
|
|
103
|
+
* standard `{ auth: defaultGitHubAuth(ctx) }` dispatch from an inbound hook.
|
|
104
|
+
*/
|
|
105
|
+
export function defaultGitHubAuth(ctx) {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
var _d;
|
|
108
|
+
const senderId = (_a = ctx.sender) === null || _a === void 0 ? void 0 : _a.id;
|
|
109
|
+
return {
|
|
110
|
+
authenticator: "github-webhook",
|
|
111
|
+
principalId: senderId !== undefined ? `github:${senderId}` : ((_d = ctx.senderLogin) !== null && _d !== void 0 ? _d : "github"),
|
|
112
|
+
principalType: ((_b = ctx.sender) === null || _b === void 0 ? void 0 : _b.type) === "Bot" ? "service" : "user",
|
|
113
|
+
attributes: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ conversation_kind: ctx.conversation.kind }, (ctx.deliveryId === undefined ? {} : { delivery_id: ctx.deliveryId })), (ctx.installationId === undefined ? {} : { installation_id: String(ctx.installationId) })), { repository: ctx.repository.fullName }), (ctx.repository.id === undefined ? {} : { repository_id: String(ctx.repository.id) })), (ctx.senderLogin === undefined ? {} : { user_login: ctx.senderLogin })), (((_c = ctx.sender) === null || _c === void 0 ? void 0 : _c.type) === undefined ? {} : { user_type: ctx.sender.type })), (ctx.repository.owner === "" ? {} : { issuer: `github:${ctx.repository.owner}` })), (ctx.senderLogin === undefined ? {} : { subject: ctx.senderLogin })),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export function githubContinuationKey(ctx) {
|
|
117
|
+
const kind = ctx.conversation.kind === "issue" ? "github-issue" : "github-pr";
|
|
118
|
+
return `${kind}:${ctx.repository.fullName}#${ctx.conversation.number}`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Parse a pull-request continuation key minted by
|
|
122
|
+
* {@link githubContinuationKey} back into its repo + number. Undefined for
|
|
123
|
+
* issue keys and non-GitHub sessions — lets a server tool recover which PR
|
|
124
|
+
* its session is pinned to without trusting model-provided identifiers.
|
|
125
|
+
*/
|
|
126
|
+
export function parseGitHubPrContinuationKey(key) {
|
|
127
|
+
const match = /^github-pr:([^/#\s]+)\/([^#\s]+)#(\d+)$/.exec(key);
|
|
128
|
+
if (match === null) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
owner: match[1],
|
|
133
|
+
repo: match[2],
|
|
134
|
+
number: Number(match[3]),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export function defaultGitHubTitle(ctx) {
|
|
138
|
+
return `GitHub ${ctx.repository.fullName}#${ctx.conversation.number}`;
|
|
139
|
+
}
|
|
140
|
+
export function defaultGitHubPullRequestMessage(ctx, pullRequest) {
|
|
141
|
+
return [
|
|
142
|
+
`GitHub pull request trigger: ${ctx.repository.fullName}#${pullRequest.number}`,
|
|
143
|
+
`Action: ${pullRequest.action}`,
|
|
144
|
+
`PR: ${pullRequest.url}`,
|
|
145
|
+
`Title: ${pullRequest.title}`,
|
|
146
|
+
`Head: ${pullRequest.headRef} (${pullRequest.headSha})`,
|
|
147
|
+
`Base: ${pullRequest.baseRef}`,
|
|
148
|
+
...(pullRequest.authorLogin === undefined ? [] : [`Author: ${pullRequest.authorLogin}`]),
|
|
149
|
+
...(ctx.senderLogin === undefined ? [] : [`Sender: ${ctx.senderLogin}`]),
|
|
150
|
+
"",
|
|
151
|
+
"Handle this pull request event.",
|
|
152
|
+
].join("\n");
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Default dispatch gate when no `onPullRequest` hook is declared: the common
|
|
156
|
+
* review triggers start a turn as the delivery's actor.
|
|
157
|
+
*
|
|
158
|
+
* Eve has no default for `onPullRequest` (opt-in only). Agent-serve keeps this
|
|
159
|
+
* gate for backward compatibility with existing demos.
|
|
160
|
+
*/
|
|
161
|
+
export function defaultGitHubPullRequestDispatch(ctx, pullRequest) {
|
|
162
|
+
if (!DEFAULT_PULL_REQUEST_ACTIONS.has(pullRequest.action)) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return { auth: defaultGitHubAuth(ctx) };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Default comment hook (Eve-compatible): dispatch only when the comment
|
|
169
|
+
* `@mention`s {@link botName}.
|
|
170
|
+
*/
|
|
171
|
+
export function defaultOnComment(ctx, comment, options) {
|
|
172
|
+
if (!shouldDispatchGitHubComment({
|
|
173
|
+
body: comment.body,
|
|
174
|
+
author: comment.author,
|
|
175
|
+
botName: options.botName,
|
|
176
|
+
})) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
return { auth: defaultGitHubAuth(ctx) };
|
|
180
|
+
}
|
|
181
|
+
export function shouldDispatchGitHubComment(args) {
|
|
182
|
+
var _a;
|
|
183
|
+
const botName = (_a = args.botName) === null || _a === void 0 ? void 0 : _a.trim();
|
|
184
|
+
if (botName === undefined || botName === "") {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
if (isGitHubAppBotAuthor(args.author, botName)) {
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
const mention = new RegExp(`(^|\\W)@${escapeRegExp(botName)}\\b`, "i");
|
|
191
|
+
return mention.test(args.body);
|
|
192
|
+
}
|
|
193
|
+
export function extractGitHubCommentTrigger(args) {
|
|
194
|
+
var _a;
|
|
195
|
+
const botName = (_a = args.botName) === null || _a === void 0 ? void 0 : _a.trim();
|
|
196
|
+
if (botName === undefined || botName === "") {
|
|
197
|
+
const trimmed = args.body.trim();
|
|
198
|
+
return trimmed === "" ? undefined : { message: trimmed };
|
|
199
|
+
}
|
|
200
|
+
const mention = new RegExp(`@${escapeRegExp(botName)}\\b[,:]?\\s*`, "i");
|
|
201
|
+
const stripped = args.body.replace(mention, "").trim();
|
|
202
|
+
if (stripped === "") {
|
|
203
|
+
return { message: args.body.trim() };
|
|
204
|
+
}
|
|
205
|
+
return { message: stripped };
|
|
206
|
+
}
|
|
207
|
+
export function parseGitHubPullRequestEvent(args) {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f;
|
|
209
|
+
var _g;
|
|
210
|
+
const parsed = githubPullRequestPayloadSchema.safeParse(args.payload);
|
|
211
|
+
if (!parsed.success) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
const payload = parsed.data;
|
|
215
|
+
const repository = toRepositoryRef(payload.repository);
|
|
216
|
+
const sender = toUser(payload.sender);
|
|
217
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
218
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: "pull_request", repository, conversation: {
|
|
219
|
+
kind: "pull_request",
|
|
220
|
+
number: payload.pull_request.number,
|
|
221
|
+
url: payload.pull_request.html_url,
|
|
222
|
+
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
223
|
+
const pullRequest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ action: payload.action, number: payload.pull_request.number, url: payload.pull_request.html_url, title: payload.pull_request.title }, (payload.pull_request.body === undefined || payload.pull_request.body === null
|
|
224
|
+
? {}
|
|
225
|
+
: { body: payload.pull_request.body })), { headRef: payload.pull_request.head.ref, headSha: payload.pull_request.head.sha, baseRef: payload.pull_request.base.ref }), (payload.pull_request.base.sha === undefined
|
|
226
|
+
? {}
|
|
227
|
+
: { baseSha: payload.pull_request.base.sha })), (((_d = (_c = (_b = payload.changes) === null || _b === void 0 ? void 0 : _b.base) === null || _c === void 0 ? void 0 : _c.ref) === null || _d === void 0 ? void 0 : _d.from) === undefined
|
|
228
|
+
? {}
|
|
229
|
+
: { baseRefChangedFrom: payload.changes.base.ref.from })), { draft: (_g = payload.pull_request.draft) !== null && _g !== void 0 ? _g : false, merged: payload.pull_request.merged === true }), (((_e = payload.pull_request.user) === null || _e === void 0 ? void 0 : _e.login) === undefined
|
|
230
|
+
? {}
|
|
231
|
+
: { authorLogin: payload.pull_request.user.login })), (((_f = payload.label) === null || _f === void 0 ? void 0 : _f.name) === undefined ? {} : { label: { name: payload.label.name } }));
|
|
232
|
+
return { ctx, pullRequest };
|
|
233
|
+
}
|
|
234
|
+
export function verifyGitHubWebhookSignature(args) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
const secret = yield resolveCredentialValue(args.secret);
|
|
237
|
+
if (secret === undefined || secret === "") {
|
|
238
|
+
return "missing_secret";
|
|
239
|
+
}
|
|
240
|
+
if (args.signatureHeader === null) {
|
|
241
|
+
return "missing_signature";
|
|
242
|
+
}
|
|
243
|
+
const isVerified = verifyWebhookSha256Signature({
|
|
244
|
+
secret,
|
|
245
|
+
body: args.body,
|
|
246
|
+
signatureHeader: args.signatureHeader,
|
|
247
|
+
});
|
|
248
|
+
return isVerified ? "verified" : "mismatch";
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
function verifyWebhookSha256Signature(args) {
|
|
252
|
+
const prefix = "sha256=";
|
|
253
|
+
if (!args.signatureHeader.startsWith(prefix)) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
const receivedHex = args.signatureHeader.slice(prefix.length);
|
|
257
|
+
if (!/^[0-9a-f]+$/i.test(receivedHex) || receivedHex.length % 2 !== 0) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
const expected = createHmac("sha256", args.secret).update(args.body).digest();
|
|
261
|
+
const received = Buffer.from(receivedHex, "hex");
|
|
262
|
+
return received.length === expected.length && timingSafeEqual(received, expected);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Run the authored hooks for one GitHub delivery and `send()` the turn.
|
|
266
|
+
* Callers own delivery auth: the HTTP route verifies the HMAC; trigger
|
|
267
|
+
* fan-out and hosted admission arrive verified. The v2 mailbox is stamped
|
|
268
|
+
* upstream (local CP or hosted ingress), never here.
|
|
269
|
+
*/
|
|
270
|
+
export function dispatchGitHubWebhook(input) {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
var _a;
|
|
273
|
+
const { options, eventName, payload, deliveryId, args } = input;
|
|
274
|
+
const botName = (_a = options.botName) !== null && _a !== void 0 ? _a : process.env.GITHUB_APP_SLUG;
|
|
275
|
+
const bindingConfig = {
|
|
276
|
+
api: options.api,
|
|
277
|
+
credentials: options.credentials,
|
|
278
|
+
};
|
|
279
|
+
if (eventName === "ping") {
|
|
280
|
+
return Response.json({ ok: true, event: "ping" });
|
|
281
|
+
}
|
|
282
|
+
switch (eventName) {
|
|
283
|
+
case "pull_request":
|
|
284
|
+
return handlePullRequest({
|
|
285
|
+
options,
|
|
286
|
+
bindingConfig,
|
|
287
|
+
payload,
|
|
288
|
+
deliveryId,
|
|
289
|
+
args,
|
|
290
|
+
});
|
|
291
|
+
case "issue_comment":
|
|
292
|
+
return handleIssueComment({
|
|
293
|
+
options,
|
|
294
|
+
bindingConfig,
|
|
295
|
+
botName,
|
|
296
|
+
payload,
|
|
297
|
+
deliveryId,
|
|
298
|
+
args,
|
|
299
|
+
});
|
|
300
|
+
case "pull_request_review_comment":
|
|
301
|
+
return handleReviewComment({
|
|
302
|
+
options,
|
|
303
|
+
bindingConfig,
|
|
304
|
+
botName,
|
|
305
|
+
payload,
|
|
306
|
+
deliveryId,
|
|
307
|
+
args,
|
|
308
|
+
});
|
|
309
|
+
case "issues":
|
|
310
|
+
return handleIssue({
|
|
311
|
+
options,
|
|
312
|
+
bindingConfig,
|
|
313
|
+
payload,
|
|
314
|
+
deliveryId,
|
|
315
|
+
args,
|
|
316
|
+
});
|
|
317
|
+
case "check_suite":
|
|
318
|
+
return handleCheckSuite({
|
|
319
|
+
options,
|
|
320
|
+
bindingConfig,
|
|
321
|
+
payload,
|
|
322
|
+
deliveryId,
|
|
323
|
+
args,
|
|
324
|
+
});
|
|
325
|
+
case "check_run":
|
|
326
|
+
return handleCheckRun({
|
|
327
|
+
options,
|
|
328
|
+
bindingConfig,
|
|
329
|
+
payload,
|
|
330
|
+
deliveryId,
|
|
331
|
+
args,
|
|
332
|
+
});
|
|
333
|
+
case "workflow_run":
|
|
334
|
+
return handleWorkflowRun({
|
|
335
|
+
options,
|
|
336
|
+
bindingConfig,
|
|
337
|
+
payload,
|
|
338
|
+
deliveryId,
|
|
339
|
+
args,
|
|
340
|
+
});
|
|
341
|
+
case "status":
|
|
342
|
+
return handleStatus({
|
|
343
|
+
options,
|
|
344
|
+
bindingConfig,
|
|
345
|
+
payload,
|
|
346
|
+
deliveryId,
|
|
347
|
+
args,
|
|
348
|
+
});
|
|
349
|
+
default:
|
|
350
|
+
if (options.onEvent !== undefined && eventName !== null) {
|
|
351
|
+
return handleGenericEvent({
|
|
352
|
+
options,
|
|
353
|
+
bindingConfig,
|
|
354
|
+
eventName,
|
|
355
|
+
payload,
|
|
356
|
+
deliveryId,
|
|
357
|
+
args,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
return skipped("unsupported_event", { event: eventName });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* HTTP entry for a single agent's GitHub channel: optional HMAC verify, then
|
|
366
|
+
* {@link dispatchGitHubWebhook}.
|
|
367
|
+
*/
|
|
368
|
+
export function handleGitHubWebhookRequest(input) {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
+
var _a;
|
|
371
|
+
var _b, _c;
|
|
372
|
+
const bodyText = yield input.request.text();
|
|
373
|
+
const webhookSecret = (_b = (_a = input.options.credentials) === null || _a === void 0 ? void 0 : _a.webhookSecret) !== null && _b !== void 0 ? _b : envWebhookSecret();
|
|
374
|
+
if (webhookSecret !== undefined && input.skipSignatureVerification !== true) {
|
|
375
|
+
const signatureResult = yield verifyGitHubWebhookSignature({
|
|
376
|
+
body: bodyText,
|
|
377
|
+
signatureHeader: input.request.headers.get("x-hub-signature-256"),
|
|
378
|
+
secret: webhookSecret,
|
|
379
|
+
});
|
|
380
|
+
if (signatureResult !== "verified") {
|
|
381
|
+
return Response.json({ ok: false, error: signatureResult }, { status: 401 });
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
let payload;
|
|
385
|
+
try {
|
|
386
|
+
payload = JSON.parse(bodyText);
|
|
387
|
+
}
|
|
388
|
+
catch (_d) {
|
|
389
|
+
return Response.json({ ok: false, error: "invalid_json" }, { status: 400 });
|
|
390
|
+
}
|
|
391
|
+
const eventName = input.request.headers.get("x-github-event");
|
|
392
|
+
const args = eventName === null
|
|
393
|
+
? input.args
|
|
394
|
+
: bindLocalIngressSend(input.args, {
|
|
395
|
+
identity: input.options.continuation,
|
|
396
|
+
kind: "github",
|
|
397
|
+
eventType: eventName,
|
|
398
|
+
payload,
|
|
399
|
+
});
|
|
400
|
+
return dispatchGitHubWebhook({
|
|
401
|
+
options: input.options,
|
|
402
|
+
eventName,
|
|
403
|
+
payload,
|
|
404
|
+
deliveryId: (_c = input.request.headers.get("x-github-delivery")) !== null && _c !== void 0 ? _c : undefined,
|
|
405
|
+
args,
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
/** Options used to construct a github channel — for host-level fan-out. */
|
|
410
|
+
const githubChannelOptionsByDefinition = new WeakMap();
|
|
411
|
+
/**
|
|
412
|
+
* Recover the {@link GitHubChannelOptions} used to build a channel definition,
|
|
413
|
+
* if it was created via {@link githubChannel}.
|
|
414
|
+
*/
|
|
415
|
+
export function getGitHubChannelOptions(definition) {
|
|
416
|
+
return githubChannelOptionsByDefinition.get(definition);
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* GitHub webhook channel (Eve-compatible dispatch surface). Point a GitHub App
|
|
420
|
+
* or repository webhook at `/<agent>/v1/channels/github` and declare inbound
|
|
421
|
+
* hooks:
|
|
422
|
+
*
|
|
423
|
+
* ```ts
|
|
424
|
+
* import { defaultGitHubAuth, githubChannel } from "@cursor/bdk/channels/github";
|
|
425
|
+
*
|
|
426
|
+
* export default githubChannel({
|
|
427
|
+
* botName: "my-agent",
|
|
428
|
+
* credentials: { webhookSecret: () => process.env.GITHUB_WEBHOOK_SECRET },
|
|
429
|
+
* // Replaces the @mention gate. Prefer typed Octokit via getOctokit().
|
|
430
|
+
* onComment: (ctx, comment) => ({ auth: defaultGitHubAuth(ctx) }),
|
|
431
|
+
* onPullRequest: (ctx, pr) => {
|
|
432
|
+
* if (pr.action !== "opened") {
|
|
433
|
+
* return null;
|
|
434
|
+
* }
|
|
435
|
+
* return { auth: defaultGitHubAuth(ctx) };
|
|
436
|
+
* },
|
|
437
|
+
* onStatus: (ctx, status) => {
|
|
438
|
+
* if (status.state !== "failure") {
|
|
439
|
+
* return null;
|
|
440
|
+
* }
|
|
441
|
+
* return {
|
|
442
|
+
* task: async () => {
|
|
443
|
+
* const octokit = await ctx.github.getOctokit();
|
|
444
|
+
* await octokit.rest.repos.createCommitStatus({
|
|
445
|
+
* owner: ctx.repository.owner,
|
|
446
|
+
* repo: ctx.repository.name,
|
|
447
|
+
* sha: status.sha,
|
|
448
|
+
* state: "pending",
|
|
449
|
+
* context: "agent/triage",
|
|
450
|
+
* });
|
|
451
|
+
* },
|
|
452
|
+
* };
|
|
453
|
+
* },
|
|
454
|
+
* onEvent: (ctx, event) => {
|
|
455
|
+
* if (event.eventName !== "label") {
|
|
456
|
+
* return null;
|
|
457
|
+
* }
|
|
458
|
+
* return { auth: defaultGitHubAuth(ctx) };
|
|
459
|
+
* },
|
|
460
|
+
* });
|
|
461
|
+
* ```
|
|
462
|
+
*/
|
|
463
|
+
export function githubChannel(options = {}) {
|
|
464
|
+
var _a, _b, _c;
|
|
465
|
+
const usesCursorAccount = options.cursorAccount === true || typeof options.cursorAccount === "object";
|
|
466
|
+
// Normalized scope lives on the private runtime — never rewrite authored
|
|
467
|
+
// `cursorAccount` on the options object the author passed in.
|
|
468
|
+
const cursorScope = typeof options.cursorAccount === "object"
|
|
469
|
+
? parseCursorGithubRepoScope(options.cursorAccount.repos, cursorGithubPermissionsForChannel(options, options.cursorAccount.permissions))
|
|
470
|
+
: undefined;
|
|
471
|
+
let cursorCredentials;
|
|
472
|
+
let credentials = options.credentials;
|
|
473
|
+
if (usesCursorAccount) {
|
|
474
|
+
if (hasDedicatedGitHubApiCredentials(options)) {
|
|
475
|
+
throw new Error("githubChannel({ cursorAccount: true }) cannot be combined with token or GitHub App credentials.");
|
|
476
|
+
}
|
|
477
|
+
const pending = createPendingCursorGithubCredentials();
|
|
478
|
+
cursorCredentials = pending;
|
|
479
|
+
credentials = Object.assign(Object.assign({}, options.credentials), { token: createCursorAccountGithubTokenResolver(() => pending.getToken(), pending) });
|
|
480
|
+
}
|
|
481
|
+
const routePath = (_a = options.path) !== null && _a !== void 0 ? _a : "/";
|
|
482
|
+
const webhookSecret = (_b = credentials === null || credentials === void 0 ? void 0 : credentials.webhookSecret) !== null && _b !== void 0 ? _b : envWebhookSecret();
|
|
483
|
+
// With a secret the HMAC is the request auth (allowAll). Without one, prod
|
|
484
|
+
// stays loopback-strict; dev admits unsigned deliveries from a loopback peer
|
|
485
|
+
// only (loopbackGitHubDev) — not the LAN. Admits `gh webhook forward`
|
|
486
|
+
// deliveries (loopback peer + GitHub forwarding/delivery headers) while
|
|
487
|
+
// rejecting loopback tunnels that relay unsigned traffic without
|
|
488
|
+
// `X-GitHub-Event`.
|
|
489
|
+
//
|
|
490
|
+
// Evaluate `isDevMode()` per request (not at channel construction): channel
|
|
491
|
+
// modules call `githubChannel()` at import, and discovery may cache the
|
|
492
|
+
// definition across serve() calls. `serve()` sets the flag before discovery,
|
|
493
|
+
// but request-time lookup stays correct if that ordering ever drifts.
|
|
494
|
+
const auth = (_c = options.auth) !== null && _c !== void 0 ? _c : (webhookSecret !== undefined
|
|
495
|
+
? [allowAll()]
|
|
496
|
+
: [(request, info) => (isDevMode() ? loopbackGitHubDev() : localDevStrict())(request, info)]);
|
|
497
|
+
const channelOptions = Object.assign(Object.assign({}, options), { credentials });
|
|
498
|
+
if (channelOptions.continuation !== undefined) {
|
|
499
|
+
channelOptions.continuation = normalizeIdentity(channelOptions.continuation, "github");
|
|
500
|
+
}
|
|
501
|
+
const events = Object.assign(Object.assign({}, buildDefaultGitHubEvents(Object.assign({}, channelOptions))), options.events);
|
|
502
|
+
const definition = defineChannel({
|
|
503
|
+
auth,
|
|
504
|
+
state: emptyGitHubChannelState(),
|
|
505
|
+
events,
|
|
506
|
+
meta: {
|
|
507
|
+
kind: GITHUB_CHANNEL_KIND,
|
|
508
|
+
githubWebhookEvents: deriveGitHubWebhookEvents(channelOptions),
|
|
509
|
+
},
|
|
510
|
+
onStart: options.onStart,
|
|
511
|
+
onStop: options.onStop,
|
|
512
|
+
routes: [
|
|
513
|
+
POST(routePath, {
|
|
514
|
+
// Webhook payloads vary by `X-GitHub-Event`; event-specific Zod
|
|
515
|
+
// parsing happens inside the dispatcher. Require a schema at the
|
|
516
|
+
// route boundary so /v1/info + Try always have something to show.
|
|
517
|
+
bodySchema: z.unknown(),
|
|
518
|
+
description: "GitHub webhook ingress",
|
|
519
|
+
handler: (request, args) => __awaiter(this, void 0, void 0, function* () {
|
|
520
|
+
return handleGitHubWebhookRequest({
|
|
521
|
+
options: channelOptions,
|
|
522
|
+
request,
|
|
523
|
+
args,
|
|
524
|
+
});
|
|
525
|
+
}),
|
|
526
|
+
}),
|
|
527
|
+
],
|
|
528
|
+
});
|
|
529
|
+
githubChannelOptionsByDefinition.set(definition, channelOptions);
|
|
530
|
+
attachHostedAdmissionAdapter(definition, {
|
|
531
|
+
kind: GITHUB_CHANNEL_KIND,
|
|
532
|
+
prepareArgs: withPropagatingBackgroundErrors,
|
|
533
|
+
dispatch: ({ eventType, payload, deliveryId, args }) => dispatchGitHubWebhook({
|
|
534
|
+
options: channelOptions,
|
|
535
|
+
eventName: eventType,
|
|
536
|
+
payload,
|
|
537
|
+
deliveryId,
|
|
538
|
+
args,
|
|
539
|
+
}),
|
|
540
|
+
});
|
|
541
|
+
if (cursorCredentials !== undefined) {
|
|
542
|
+
registerGithubCursorAccountRuntime(definition, {
|
|
543
|
+
options,
|
|
544
|
+
credentials: cursorCredentials,
|
|
545
|
+
scope: cursorScope,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
return definition;
|
|
549
|
+
}
|
|
550
|
+
function hasDedicatedGitHubApiCredentials(options) {
|
|
551
|
+
var _a, _b, _c, _d;
|
|
552
|
+
return (((_a = options.credentials) === null || _a === void 0 ? void 0 : _a.token) !== undefined ||
|
|
553
|
+
((_b = options.credentials) === null || _b === void 0 ? void 0 : _b.installationToken) !== undefined ||
|
|
554
|
+
((_c = options.credentials) === null || _c === void 0 ? void 0 : _c.appId) !== undefined ||
|
|
555
|
+
((_d = options.credentials) === null || _d === void 0 ? void 0 : _d.privateKey) !== undefined);
|
|
556
|
+
}
|
|
557
|
+
function handlePullRequest(input) {
|
|
558
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
559
|
+
var _a, _b, _c, _d;
|
|
560
|
+
const parsed = parseGitHubPullRequestEvent({
|
|
561
|
+
payload: input.payload,
|
|
562
|
+
deliveryId: input.deliveryId,
|
|
563
|
+
});
|
|
564
|
+
if (parsed === null) {
|
|
565
|
+
return Response.json({ ok: false, error: "invalid_pull_request_payload" }, { status: 400 });
|
|
566
|
+
}
|
|
567
|
+
const { pullRequest } = parsed;
|
|
568
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
569
|
+
const binding = githubBindingStateForEvent({
|
|
570
|
+
kind: parsed.ctx.conversation.kind,
|
|
571
|
+
owner: parsed.ctx.repository.owner,
|
|
572
|
+
repo: parsed.ctx.repository.name,
|
|
573
|
+
number: parsed.ctx.conversation.number,
|
|
574
|
+
repositoryId: parsed.ctx.repository.id,
|
|
575
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
576
|
+
installationId,
|
|
577
|
+
});
|
|
578
|
+
const ctx = enrichEventContext({
|
|
579
|
+
bindingConfig: input.bindingConfig,
|
|
580
|
+
ctx: parsed.ctx,
|
|
581
|
+
payload: input.payload,
|
|
582
|
+
bindingState: binding,
|
|
583
|
+
installationId,
|
|
584
|
+
host: input.args.host,
|
|
585
|
+
artifacts: input.args.artifacts,
|
|
586
|
+
send: input.args.send,
|
|
587
|
+
});
|
|
588
|
+
const dispatch = input.options.onPullRequest === undefined
|
|
589
|
+
? defaultGitHubPullRequestDispatch(ctx, pullRequest)
|
|
590
|
+
: yield input.options.onPullRequest(ctx, pullRequest);
|
|
591
|
+
if (dispatch === null) {
|
|
592
|
+
return skipped("not_dispatched", { action: pullRequest.action });
|
|
593
|
+
}
|
|
594
|
+
if (isTaskDispatch(dispatch)) {
|
|
595
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
596
|
+
action: pullRequest.action,
|
|
597
|
+
prUrl: pullRequest.url,
|
|
598
|
+
headSha: pullRequest.headSha,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
const message = [
|
|
602
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : defaultGitHubPullRequestMessage(ctx, pullRequest),
|
|
603
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
604
|
+
].join("\n");
|
|
605
|
+
const cloud = (_d = dispatch.cloud) !== null && _d !== void 0 ? _d : (yield resolveCloudOptions(input.options.cloud, ctx, pullRequest));
|
|
606
|
+
return startTurn({
|
|
607
|
+
options: input.options,
|
|
608
|
+
args: input.args,
|
|
609
|
+
ctx,
|
|
610
|
+
message,
|
|
611
|
+
dispatch,
|
|
612
|
+
cloud,
|
|
613
|
+
state: sessionStateFromBinding({
|
|
614
|
+
binding,
|
|
615
|
+
deliveryId: ctx.deliveryId,
|
|
616
|
+
eventName: ctx.eventName,
|
|
617
|
+
headSha: pullRequest.headSha,
|
|
618
|
+
baseRef: pullRequest.baseRef,
|
|
619
|
+
headRef: pullRequest.headRef,
|
|
620
|
+
}),
|
|
621
|
+
});
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
function handleIssueComment(input) {
|
|
625
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
626
|
+
var _a, _b, _c, _d;
|
|
627
|
+
const parsed = parseIssueCommentEvent({
|
|
628
|
+
payload: input.payload,
|
|
629
|
+
deliveryId: input.deliveryId,
|
|
630
|
+
});
|
|
631
|
+
if (parsed === null) {
|
|
632
|
+
return Response.json({ ok: false, error: "invalid_issue_comment_payload" }, { status: 400 });
|
|
633
|
+
}
|
|
634
|
+
if (parsed.action !== "created") {
|
|
635
|
+
return skipped("not_dispatched", { action: parsed.action });
|
|
636
|
+
}
|
|
637
|
+
if (isIgnoredInboundComment(parsed.comment.body, parsed.comment.author, input.botName)) {
|
|
638
|
+
return skipped("ignored_comment");
|
|
639
|
+
}
|
|
640
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
641
|
+
const binding = githubBindingStateForEvent({
|
|
642
|
+
kind: parsed.ctx.conversation.kind,
|
|
643
|
+
owner: parsed.ctx.repository.owner,
|
|
644
|
+
repo: parsed.ctx.repository.name,
|
|
645
|
+
number: parsed.ctx.conversation.number,
|
|
646
|
+
repositoryId: parsed.ctx.repository.id,
|
|
647
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
648
|
+
installationId,
|
|
649
|
+
triggeringCommentId: parsed.comment.id,
|
|
650
|
+
});
|
|
651
|
+
const ctx = enrichEventContext({
|
|
652
|
+
bindingConfig: input.bindingConfig,
|
|
653
|
+
ctx: parsed.ctx,
|
|
654
|
+
payload: input.payload,
|
|
655
|
+
bindingState: binding,
|
|
656
|
+
installationId,
|
|
657
|
+
host: input.args.host,
|
|
658
|
+
artifacts: input.args.artifacts,
|
|
659
|
+
send: input.args.send,
|
|
660
|
+
});
|
|
661
|
+
const dispatch = input.options.onComment === undefined
|
|
662
|
+
? defaultOnComment(ctx, parsed.comment, {
|
|
663
|
+
botName: input.botName,
|
|
664
|
+
})
|
|
665
|
+
: yield input.options.onComment(ctx, parsed.comment);
|
|
666
|
+
if (dispatch === null) {
|
|
667
|
+
return skipped("not_dispatched");
|
|
668
|
+
}
|
|
669
|
+
if (isTaskDispatch(dispatch)) {
|
|
670
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
671
|
+
event: "issue_comment",
|
|
672
|
+
action: parsed.action,
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
const trigger = extractGitHubCommentTrigger({
|
|
676
|
+
body: parsed.comment.body,
|
|
677
|
+
botName: input.botName,
|
|
678
|
+
});
|
|
679
|
+
const message = [
|
|
680
|
+
(_c = (_b = dispatch.message) !== null && _b !== void 0 ? _b : trigger === null || trigger === void 0 ? void 0 : trigger.message) !== null && _c !== void 0 ? _c : parsed.comment.body.trim(),
|
|
681
|
+
...((_d = dispatch.context) !== null && _d !== void 0 ? _d : []),
|
|
682
|
+
].join("\n");
|
|
683
|
+
return startTurn({
|
|
684
|
+
options: input.options,
|
|
685
|
+
args: input.args,
|
|
686
|
+
ctx,
|
|
687
|
+
message,
|
|
688
|
+
dispatch,
|
|
689
|
+
state: sessionStateFromBinding({
|
|
690
|
+
binding,
|
|
691
|
+
deliveryId: ctx.deliveryId,
|
|
692
|
+
eventName: ctx.eventName,
|
|
693
|
+
}),
|
|
694
|
+
});
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
function handleReviewComment(input) {
|
|
698
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
699
|
+
var _a, _b, _c, _d, _e;
|
|
700
|
+
const parsed = parseReviewCommentEvent({
|
|
701
|
+
payload: input.payload,
|
|
702
|
+
deliveryId: input.deliveryId,
|
|
703
|
+
});
|
|
704
|
+
if (parsed === null) {
|
|
705
|
+
return Response.json({ ok: false, error: "invalid_review_comment_payload" }, { status: 400 });
|
|
706
|
+
}
|
|
707
|
+
if (parsed.action !== "created") {
|
|
708
|
+
return skipped("not_dispatched", { action: parsed.action });
|
|
709
|
+
}
|
|
710
|
+
if (isIgnoredInboundComment(parsed.comment.body, parsed.comment.author, input.botName)) {
|
|
711
|
+
return skipped("ignored_comment");
|
|
712
|
+
}
|
|
713
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
714
|
+
const binding = githubBindingStateForEvent({
|
|
715
|
+
kind: parsed.ctx.conversation.kind,
|
|
716
|
+
owner: parsed.ctx.repository.owner,
|
|
717
|
+
repo: parsed.ctx.repository.name,
|
|
718
|
+
number: parsed.ctx.conversation.number,
|
|
719
|
+
repositoryId: parsed.ctx.repository.id,
|
|
720
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
721
|
+
installationId,
|
|
722
|
+
triggeringCommentId: parsed.comment.id,
|
|
723
|
+
reviewCommentId: parsed.comment.id,
|
|
724
|
+
reviewThreadRootCommentId: (_b = parsed.comment.inReplyToId) !== null && _b !== void 0 ? _b : parsed.comment.id,
|
|
725
|
+
});
|
|
726
|
+
const ctx = enrichEventContext({
|
|
727
|
+
bindingConfig: input.bindingConfig,
|
|
728
|
+
ctx: parsed.ctx,
|
|
729
|
+
payload: input.payload,
|
|
730
|
+
bindingState: binding,
|
|
731
|
+
installationId,
|
|
732
|
+
host: input.args.host,
|
|
733
|
+
artifacts: input.args.artifacts,
|
|
734
|
+
send: input.args.send,
|
|
735
|
+
});
|
|
736
|
+
const dispatch = input.options.onComment === undefined
|
|
737
|
+
? defaultOnComment(ctx, parsed.comment, {
|
|
738
|
+
botName: input.botName,
|
|
739
|
+
})
|
|
740
|
+
: yield input.options.onComment(ctx, parsed.comment);
|
|
741
|
+
if (dispatch === null) {
|
|
742
|
+
return skipped("not_dispatched");
|
|
743
|
+
}
|
|
744
|
+
if (isTaskDispatch(dispatch)) {
|
|
745
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
746
|
+
event: "pull_request_review_comment",
|
|
747
|
+
action: parsed.action,
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
const trigger = extractGitHubCommentTrigger({
|
|
751
|
+
body: parsed.comment.body,
|
|
752
|
+
botName: input.botName,
|
|
753
|
+
});
|
|
754
|
+
const message = [
|
|
755
|
+
(_d = (_c = dispatch.message) !== null && _c !== void 0 ? _c : trigger === null || trigger === void 0 ? void 0 : trigger.message) !== null && _d !== void 0 ? _d : parsed.comment.body.trim(),
|
|
756
|
+
...((_e = dispatch.context) !== null && _e !== void 0 ? _e : []),
|
|
757
|
+
].join("\n");
|
|
758
|
+
return startTurn({
|
|
759
|
+
options: input.options,
|
|
760
|
+
args: input.args,
|
|
761
|
+
ctx,
|
|
762
|
+
message,
|
|
763
|
+
dispatch,
|
|
764
|
+
state: sessionStateFromBinding({
|
|
765
|
+
binding,
|
|
766
|
+
deliveryId: ctx.deliveryId,
|
|
767
|
+
eventName: ctx.eventName,
|
|
768
|
+
headSha: parsed.headSha,
|
|
769
|
+
headRef: parsed.headRef,
|
|
770
|
+
baseRef: parsed.baseRef,
|
|
771
|
+
}),
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
function handleIssue(input) {
|
|
776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
777
|
+
var _a, _b, _c;
|
|
778
|
+
if (input.options.onIssue === undefined) {
|
|
779
|
+
return skipped("no_handler", { event: "issues" });
|
|
780
|
+
}
|
|
781
|
+
const parsed = parseIssueEvent({
|
|
782
|
+
payload: input.payload,
|
|
783
|
+
deliveryId: input.deliveryId,
|
|
784
|
+
});
|
|
785
|
+
if (parsed === null) {
|
|
786
|
+
return Response.json({ ok: false, error: "invalid_issues_payload" }, { status: 400 });
|
|
787
|
+
}
|
|
788
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
789
|
+
const binding = githubBindingStateForEvent({
|
|
790
|
+
kind: parsed.ctx.conversation.kind,
|
|
791
|
+
owner: parsed.ctx.repository.owner,
|
|
792
|
+
repo: parsed.ctx.repository.name,
|
|
793
|
+
number: parsed.ctx.conversation.number,
|
|
794
|
+
repositoryId: parsed.ctx.repository.id,
|
|
795
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
796
|
+
installationId,
|
|
797
|
+
});
|
|
798
|
+
const ctx = enrichEventContext({
|
|
799
|
+
bindingConfig: input.bindingConfig,
|
|
800
|
+
ctx: parsed.ctx,
|
|
801
|
+
payload: input.payload,
|
|
802
|
+
bindingState: binding,
|
|
803
|
+
installationId,
|
|
804
|
+
host: input.args.host,
|
|
805
|
+
artifacts: input.args.artifacts,
|
|
806
|
+
send: input.args.send,
|
|
807
|
+
});
|
|
808
|
+
const dispatch = yield input.options.onIssue(ctx, parsed.issue);
|
|
809
|
+
if (dispatch === null) {
|
|
810
|
+
return skipped("not_dispatched", { action: parsed.issue.action });
|
|
811
|
+
}
|
|
812
|
+
if (isTaskDispatch(dispatch)) {
|
|
813
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
814
|
+
event: "issues",
|
|
815
|
+
action: parsed.issue.action,
|
|
816
|
+
issueNumber: parsed.issue.number,
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
const message = [
|
|
820
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : `Issue ${parsed.issue.action}: #${parsed.issue.number} ${parsed.issue.title}`,
|
|
821
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
822
|
+
].join("\n");
|
|
823
|
+
return startTurn({
|
|
824
|
+
options: input.options,
|
|
825
|
+
args: input.args,
|
|
826
|
+
ctx,
|
|
827
|
+
message,
|
|
828
|
+
dispatch,
|
|
829
|
+
state: sessionStateFromBinding({
|
|
830
|
+
binding,
|
|
831
|
+
deliveryId: ctx.deliveryId,
|
|
832
|
+
eventName: ctx.eventName,
|
|
833
|
+
}),
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
function handleCheckSuite(input) {
|
|
838
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
839
|
+
var _a, _b, _c;
|
|
840
|
+
if (input.options.onCheckSuite === undefined) {
|
|
841
|
+
return skipped("no_handler", { event: "check_suite" });
|
|
842
|
+
}
|
|
843
|
+
const parsed = parseCheckSuiteEvent({
|
|
844
|
+
payload: input.payload,
|
|
845
|
+
deliveryId: input.deliveryId,
|
|
846
|
+
});
|
|
847
|
+
if (parsed === null) {
|
|
848
|
+
return Response.json({ ok: false, error: "invalid_check_suite_payload" }, { status: 400 });
|
|
849
|
+
}
|
|
850
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.unanchoredCtx.installationId;
|
|
851
|
+
if (parsed.ctx === null) {
|
|
852
|
+
const dispatch = yield input.options.onCheckSuite(enrichCiContext({
|
|
853
|
+
bindingConfig: input.bindingConfig,
|
|
854
|
+
ctx: parsed.unanchoredCtx,
|
|
855
|
+
payload: input.payload,
|
|
856
|
+
installationId,
|
|
857
|
+
host: input.args.host,
|
|
858
|
+
artifacts: input.args.artifacts,
|
|
859
|
+
send: input.args.send,
|
|
860
|
+
}), parsed.checkSuite);
|
|
861
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
862
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
863
|
+
event: "check_suite",
|
|
864
|
+
action: parsed.checkSuite.action,
|
|
865
|
+
checkSuiteId: parsed.checkSuite.checkSuiteId,
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
return skipped("no_pull_request", { event: "check_suite" });
|
|
869
|
+
}
|
|
870
|
+
const binding = githubBindingStateForEvent({
|
|
871
|
+
kind: parsed.ctx.conversation.kind,
|
|
872
|
+
owner: parsed.ctx.repository.owner,
|
|
873
|
+
repo: parsed.ctx.repository.name,
|
|
874
|
+
number: parsed.ctx.conversation.number,
|
|
875
|
+
repositoryId: parsed.ctx.repository.id,
|
|
876
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
877
|
+
installationId,
|
|
878
|
+
});
|
|
879
|
+
const ctx = enrichEventContext({
|
|
880
|
+
bindingConfig: input.bindingConfig,
|
|
881
|
+
ctx: parsed.ctx,
|
|
882
|
+
payload: input.payload,
|
|
883
|
+
bindingState: binding,
|
|
884
|
+
installationId,
|
|
885
|
+
host: input.args.host,
|
|
886
|
+
artifacts: input.args.artifacts,
|
|
887
|
+
send: input.args.send,
|
|
888
|
+
});
|
|
889
|
+
const dispatch = yield input.options.onCheckSuite(ctx, parsed.checkSuite);
|
|
890
|
+
if (dispatch === null) {
|
|
891
|
+
return skipped("not_dispatched", { action: parsed.checkSuite.action });
|
|
892
|
+
}
|
|
893
|
+
if (isTaskDispatch(dispatch)) {
|
|
894
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
895
|
+
event: "check_suite",
|
|
896
|
+
action: parsed.checkSuite.action,
|
|
897
|
+
checkSuiteId: parsed.checkSuite.checkSuiteId,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
const message = [
|
|
901
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : formatCiMessage("Check suite", parsed.checkSuite.checkSuiteId, parsed.checkSuite),
|
|
902
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
903
|
+
].join("\n");
|
|
904
|
+
return startTurn({
|
|
905
|
+
options: input.options,
|
|
906
|
+
args: input.args,
|
|
907
|
+
ctx,
|
|
908
|
+
message,
|
|
909
|
+
dispatch,
|
|
910
|
+
state: sessionStateFromBinding({
|
|
911
|
+
binding,
|
|
912
|
+
deliveryId: ctx.deliveryId,
|
|
913
|
+
eventName: ctx.eventName,
|
|
914
|
+
headSha: parsed.checkSuite.headSha,
|
|
915
|
+
}),
|
|
916
|
+
});
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
function handleCheckRun(input) {
|
|
920
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
921
|
+
var _a, _b, _c;
|
|
922
|
+
if (input.options.onCheckRun === undefined) {
|
|
923
|
+
return skipped("no_handler", { event: "check_run" });
|
|
924
|
+
}
|
|
925
|
+
const parsed = parseCheckRunEvent({
|
|
926
|
+
payload: input.payload,
|
|
927
|
+
deliveryId: input.deliveryId,
|
|
928
|
+
});
|
|
929
|
+
if (parsed === null) {
|
|
930
|
+
return Response.json({ ok: false, error: "invalid_check_run_payload" }, { status: 400 });
|
|
931
|
+
}
|
|
932
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.unanchoredCtx.installationId;
|
|
933
|
+
if (parsed.ctx === null) {
|
|
934
|
+
const dispatch = yield input.options.onCheckRun(enrichCiContext({
|
|
935
|
+
bindingConfig: input.bindingConfig,
|
|
936
|
+
ctx: parsed.unanchoredCtx,
|
|
937
|
+
payload: input.payload,
|
|
938
|
+
installationId,
|
|
939
|
+
host: input.args.host,
|
|
940
|
+
artifacts: input.args.artifacts,
|
|
941
|
+
send: input.args.send,
|
|
942
|
+
}), parsed.checkRun);
|
|
943
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
944
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
945
|
+
event: "check_run",
|
|
946
|
+
action: parsed.checkRun.action,
|
|
947
|
+
checkRunId: parsed.checkRun.checkRunId,
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
return skipped("no_pull_request", { event: "check_run" });
|
|
951
|
+
}
|
|
952
|
+
const binding = githubBindingStateForEvent({
|
|
953
|
+
kind: parsed.ctx.conversation.kind,
|
|
954
|
+
owner: parsed.ctx.repository.owner,
|
|
955
|
+
repo: parsed.ctx.repository.name,
|
|
956
|
+
number: parsed.ctx.conversation.number,
|
|
957
|
+
repositoryId: parsed.ctx.repository.id,
|
|
958
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
959
|
+
installationId,
|
|
960
|
+
});
|
|
961
|
+
const ctx = enrichEventContext({
|
|
962
|
+
bindingConfig: input.bindingConfig,
|
|
963
|
+
ctx: parsed.ctx,
|
|
964
|
+
payload: input.payload,
|
|
965
|
+
bindingState: binding,
|
|
966
|
+
installationId,
|
|
967
|
+
host: input.args.host,
|
|
968
|
+
artifacts: input.args.artifacts,
|
|
969
|
+
send: input.args.send,
|
|
970
|
+
});
|
|
971
|
+
const dispatch = yield input.options.onCheckRun(ctx, parsed.checkRun);
|
|
972
|
+
if (dispatch === null) {
|
|
973
|
+
return skipped("not_dispatched", { action: parsed.checkRun.action });
|
|
974
|
+
}
|
|
975
|
+
if (isTaskDispatch(dispatch)) {
|
|
976
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
977
|
+
event: "check_run",
|
|
978
|
+
action: parsed.checkRun.action,
|
|
979
|
+
checkRunId: parsed.checkRun.checkRunId,
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
const message = [
|
|
983
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : formatCiMessage("Check run", parsed.checkRun.checkRunId, parsed.checkRun),
|
|
984
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
985
|
+
].join("\n");
|
|
986
|
+
return startTurn({
|
|
987
|
+
options: input.options,
|
|
988
|
+
args: input.args,
|
|
989
|
+
ctx,
|
|
990
|
+
message,
|
|
991
|
+
dispatch,
|
|
992
|
+
state: sessionStateFromBinding({
|
|
993
|
+
binding,
|
|
994
|
+
deliveryId: ctx.deliveryId,
|
|
995
|
+
eventName: ctx.eventName,
|
|
996
|
+
headSha: parsed.checkRun.headSha,
|
|
997
|
+
}),
|
|
998
|
+
});
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
function handleWorkflowRun(input) {
|
|
1002
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1003
|
+
var _a, _b, _c;
|
|
1004
|
+
if (input.options.onWorkflowRun === undefined) {
|
|
1005
|
+
return skipped("no_handler", { event: "workflow_run" });
|
|
1006
|
+
}
|
|
1007
|
+
const parsed = parseWorkflowRunEvent({
|
|
1008
|
+
payload: input.payload,
|
|
1009
|
+
deliveryId: input.deliveryId,
|
|
1010
|
+
});
|
|
1011
|
+
if (parsed === null) {
|
|
1012
|
+
return Response.json({ ok: false, error: "invalid_workflow_run_payload" }, { status: 400 });
|
|
1013
|
+
}
|
|
1014
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.unanchoredCtx.installationId;
|
|
1015
|
+
if (parsed.ctx === null) {
|
|
1016
|
+
const dispatch = yield input.options.onWorkflowRun(enrichCiContext({
|
|
1017
|
+
bindingConfig: input.bindingConfig,
|
|
1018
|
+
ctx: parsed.unanchoredCtx,
|
|
1019
|
+
payload: input.payload,
|
|
1020
|
+
installationId,
|
|
1021
|
+
host: input.args.host,
|
|
1022
|
+
artifacts: input.args.artifacts,
|
|
1023
|
+
send: input.args.send,
|
|
1024
|
+
}), parsed.workflowRun);
|
|
1025
|
+
if (dispatch !== null && isTaskDispatch(dispatch)) {
|
|
1026
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1027
|
+
event: "workflow_run",
|
|
1028
|
+
action: parsed.workflowRun.action,
|
|
1029
|
+
workflowRunId: parsed.workflowRun.workflowRunId,
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
return skipped("no_pull_request", { event: "workflow_run" });
|
|
1033
|
+
}
|
|
1034
|
+
const binding = githubBindingStateForEvent({
|
|
1035
|
+
kind: parsed.ctx.conversation.kind,
|
|
1036
|
+
owner: parsed.ctx.repository.owner,
|
|
1037
|
+
repo: parsed.ctx.repository.name,
|
|
1038
|
+
number: parsed.ctx.conversation.number,
|
|
1039
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1040
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1041
|
+
installationId,
|
|
1042
|
+
});
|
|
1043
|
+
const ctx = enrichEventContext({
|
|
1044
|
+
bindingConfig: input.bindingConfig,
|
|
1045
|
+
ctx: parsed.ctx,
|
|
1046
|
+
payload: input.payload,
|
|
1047
|
+
bindingState: binding,
|
|
1048
|
+
installationId,
|
|
1049
|
+
host: input.args.host,
|
|
1050
|
+
artifacts: input.args.artifacts,
|
|
1051
|
+
send: input.args.send,
|
|
1052
|
+
});
|
|
1053
|
+
const dispatch = yield input.options.onWorkflowRun(ctx, parsed.workflowRun);
|
|
1054
|
+
if (dispatch === null) {
|
|
1055
|
+
return skipped("not_dispatched", { action: parsed.workflowRun.action });
|
|
1056
|
+
}
|
|
1057
|
+
if (isTaskDispatch(dispatch)) {
|
|
1058
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1059
|
+
event: "workflow_run",
|
|
1060
|
+
action: parsed.workflowRun.action,
|
|
1061
|
+
workflowRunId: parsed.workflowRun.workflowRunId,
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
const message = [
|
|
1065
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : formatCiMessage("Workflow run", parsed.workflowRun.workflowRunId, parsed.workflowRun),
|
|
1066
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
1067
|
+
].join("\n");
|
|
1068
|
+
return startTurn({
|
|
1069
|
+
options: input.options,
|
|
1070
|
+
args: input.args,
|
|
1071
|
+
ctx,
|
|
1072
|
+
message,
|
|
1073
|
+
dispatch,
|
|
1074
|
+
state: sessionStateFromBinding({
|
|
1075
|
+
binding,
|
|
1076
|
+
deliveryId: ctx.deliveryId,
|
|
1077
|
+
eventName: ctx.eventName,
|
|
1078
|
+
headSha: parsed.workflowRun.headSha,
|
|
1079
|
+
}),
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
function handleStatus(input) {
|
|
1084
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1085
|
+
var _a, _b, _c;
|
|
1086
|
+
if (input.options.onStatus === undefined) {
|
|
1087
|
+
return skipped("no_handler", { event: "status" });
|
|
1088
|
+
}
|
|
1089
|
+
const parsed = parseStatusEvent({
|
|
1090
|
+
payload: input.payload,
|
|
1091
|
+
deliveryId: input.deliveryId,
|
|
1092
|
+
});
|
|
1093
|
+
if (parsed === null) {
|
|
1094
|
+
return Response.json({ ok: false, error: "invalid_status_payload" }, { status: 400 });
|
|
1095
|
+
}
|
|
1096
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
1097
|
+
const binding = githubBindingStateForEvent({
|
|
1098
|
+
kind: parsed.ctx.conversation.kind,
|
|
1099
|
+
owner: parsed.ctx.repository.owner,
|
|
1100
|
+
repo: parsed.ctx.repository.name,
|
|
1101
|
+
number: parsed.ctx.conversation.number,
|
|
1102
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1103
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1104
|
+
installationId,
|
|
1105
|
+
});
|
|
1106
|
+
const ctx = enrichEventContext({
|
|
1107
|
+
bindingConfig: input.bindingConfig,
|
|
1108
|
+
ctx: parsed.ctx,
|
|
1109
|
+
payload: input.payload,
|
|
1110
|
+
bindingState: binding,
|
|
1111
|
+
installationId,
|
|
1112
|
+
host: input.args.host,
|
|
1113
|
+
artifacts: input.args.artifacts,
|
|
1114
|
+
send: input.args.send,
|
|
1115
|
+
});
|
|
1116
|
+
const dispatch = yield input.options.onStatus(ctx, parsed.status);
|
|
1117
|
+
if (dispatch === null) {
|
|
1118
|
+
return skipped("not_dispatched", {
|
|
1119
|
+
event: "status",
|
|
1120
|
+
state: parsed.status.state,
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
if (isTaskDispatch(dispatch)) {
|
|
1124
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, {
|
|
1125
|
+
event: "status",
|
|
1126
|
+
state: parsed.status.state,
|
|
1127
|
+
sha: parsed.status.sha,
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
// A turn needs a thread to anchor to; commit statuses often have no PR.
|
|
1131
|
+
if (ctx.conversation.number === 0) {
|
|
1132
|
+
return skipped("no_pull_request", { event: "status" });
|
|
1133
|
+
}
|
|
1134
|
+
const message = [
|
|
1135
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : `Commit status ${parsed.status.state} for ${parsed.status.context} at ${parsed.status.sha}`,
|
|
1136
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
1137
|
+
].join("\n");
|
|
1138
|
+
return startTurn({
|
|
1139
|
+
options: input.options,
|
|
1140
|
+
args: input.args,
|
|
1141
|
+
ctx,
|
|
1142
|
+
message,
|
|
1143
|
+
dispatch,
|
|
1144
|
+
state: sessionStateFromBinding({
|
|
1145
|
+
binding,
|
|
1146
|
+
deliveryId: ctx.deliveryId,
|
|
1147
|
+
eventName: ctx.eventName,
|
|
1148
|
+
headSha: parsed.status.sha,
|
|
1149
|
+
}),
|
|
1150
|
+
});
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
function handleGenericEvent(input) {
|
|
1154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1155
|
+
var _a, _b, _c;
|
|
1156
|
+
if (input.options.onEvent === undefined) {
|
|
1157
|
+
return skipped("no_handler", { event: input.eventName });
|
|
1158
|
+
}
|
|
1159
|
+
const parsed = parseGenericEvent({
|
|
1160
|
+
eventName: input.eventName,
|
|
1161
|
+
payload: input.payload,
|
|
1162
|
+
deliveryId: input.deliveryId,
|
|
1163
|
+
});
|
|
1164
|
+
if (parsed === null) {
|
|
1165
|
+
return skipped("unsupported_event", { event: input.eventName });
|
|
1166
|
+
}
|
|
1167
|
+
const installationId = (_a = readInstallationId(input.payload)) !== null && _a !== void 0 ? _a : parsed.ctx.installationId;
|
|
1168
|
+
const binding = githubBindingStateForEvent({
|
|
1169
|
+
kind: parsed.ctx.conversation.kind,
|
|
1170
|
+
owner: parsed.ctx.repository.owner,
|
|
1171
|
+
repo: parsed.ctx.repository.name,
|
|
1172
|
+
number: parsed.ctx.conversation.number,
|
|
1173
|
+
repositoryId: parsed.ctx.repository.id,
|
|
1174
|
+
repositoryUrl: parsed.ctx.repository.url,
|
|
1175
|
+
installationId,
|
|
1176
|
+
});
|
|
1177
|
+
const ctx = enrichEventContext({
|
|
1178
|
+
bindingConfig: input.bindingConfig,
|
|
1179
|
+
ctx: parsed.ctx,
|
|
1180
|
+
payload: input.payload,
|
|
1181
|
+
bindingState: binding,
|
|
1182
|
+
installationId,
|
|
1183
|
+
host: input.args.host,
|
|
1184
|
+
artifacts: input.args.artifacts,
|
|
1185
|
+
send: input.args.send,
|
|
1186
|
+
});
|
|
1187
|
+
const dispatch = yield input.options.onEvent(ctx, parsed.event);
|
|
1188
|
+
if (dispatch === null) {
|
|
1189
|
+
return skipped("not_dispatched", { event: input.eventName });
|
|
1190
|
+
}
|
|
1191
|
+
if (isTaskDispatch(dispatch)) {
|
|
1192
|
+
return acknowledgeTask(input.args, GITHUB_CHANNEL_KIND, dispatch, Object.assign({ event: input.eventName }, (parsed.event.action === undefined ? {} : { action: parsed.event.action })));
|
|
1193
|
+
}
|
|
1194
|
+
if (ctx.conversation.number === 0) {
|
|
1195
|
+
return skipped("no_conversation", { event: input.eventName });
|
|
1196
|
+
}
|
|
1197
|
+
const message = [
|
|
1198
|
+
(_b = dispatch.message) !== null && _b !== void 0 ? _b : `GitHub ${input.eventName} event`,
|
|
1199
|
+
...((_c = dispatch.context) !== null && _c !== void 0 ? _c : []),
|
|
1200
|
+
].join("\n");
|
|
1201
|
+
return startTurn({
|
|
1202
|
+
options: input.options,
|
|
1203
|
+
args: input.args,
|
|
1204
|
+
ctx,
|
|
1205
|
+
message,
|
|
1206
|
+
dispatch,
|
|
1207
|
+
state: sessionStateFromBinding({
|
|
1208
|
+
binding,
|
|
1209
|
+
deliveryId: ctx.deliveryId,
|
|
1210
|
+
eventName: ctx.eventName,
|
|
1211
|
+
}),
|
|
1212
|
+
});
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
function startTurn(input) {
|
|
1216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1217
|
+
var _a;
|
|
1218
|
+
const files = input.dispatch.workspaceFiles;
|
|
1219
|
+
const lazy = typeof files === "function";
|
|
1220
|
+
const cloud = (_a = input.dispatch.cloud) !== null && _a !== void 0 ? _a : input.cloud;
|
|
1221
|
+
const state = Object.assign(Object.assign({}, input.dispatch.state), input.state);
|
|
1222
|
+
const sendTurn = () => __awaiter(this, void 0, void 0, function* () {
|
|
1223
|
+
var _a;
|
|
1224
|
+
const workspaceFiles = lazy ? yield files() : files;
|
|
1225
|
+
const source = continuationSource(input.options.continuation, "github");
|
|
1226
|
+
return input.args.send(input.message, Object.assign(Object.assign(Object.assign(Object.assign({ auth: input.dispatch.auth }, (source === "engine" ? { continuationToken: githubContinuationKey(input.ctx) } : {})), { title: (_a = input.dispatch.title) !== null && _a !== void 0 ? _a : defaultGitHubTitle(input.ctx), cloud }), (workspaceFiles === undefined ? {} : { workspaceFiles })), { state: state,
|
|
1227
|
+
// Resume must refresh headSha / refs without wiping sticky banner id.
|
|
1228
|
+
refreshState: state }));
|
|
1229
|
+
});
|
|
1230
|
+
if (lazy) {
|
|
1231
|
+
scheduleAfterAck(input.args, GITHUB_CHANNEL_KIND, () => __awaiter(this, void 0, void 0, function* () {
|
|
1232
|
+
yield sendTurn();
|
|
1233
|
+
}));
|
|
1234
|
+
return acknowledgeTurn();
|
|
1235
|
+
}
|
|
1236
|
+
return turnStarted(yield sendTurn());
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
function formatCiMessage(label, id, event) {
|
|
1240
|
+
var _a;
|
|
1241
|
+
const outcome = (_a = event.conclusion) !== null && _a !== void 0 ? _a : event.status;
|
|
1242
|
+
return `${label} ${event.action}: ${id}${outcome ? ` (${outcome})` : ""}`;
|
|
1243
|
+
}
|
|
1244
|
+
function isIgnoredInboundComment(body, author, botName) {
|
|
1245
|
+
if (body.includes("<!-- agent-serve-github -->")) {
|
|
1246
|
+
return true;
|
|
1247
|
+
}
|
|
1248
|
+
if (isGitHubAppBotAuthor(author, botName)) {
|
|
1249
|
+
return true;
|
|
1250
|
+
}
|
|
1251
|
+
return false;
|
|
1252
|
+
}
|
|
1253
|
+
/** Match GitHub App bot actors (`slug` config vs `slug[bot]` login). */
|
|
1254
|
+
export function isGitHubAppBotAuthor(author, botName) {
|
|
1255
|
+
const normalizedBot = botName === null || botName === void 0 ? void 0 : botName.trim();
|
|
1256
|
+
if (normalizedBot === undefined || normalizedBot === "") {
|
|
1257
|
+
return false;
|
|
1258
|
+
}
|
|
1259
|
+
if ((author === null || author === void 0 ? void 0 : author.type) !== "Bot") {
|
|
1260
|
+
return false;
|
|
1261
|
+
}
|
|
1262
|
+
const login = author.login;
|
|
1263
|
+
const stripBotSuffix = (value) => value.replace(/\[bot\]$/i, "").toLowerCase();
|
|
1264
|
+
return (login.toLowerCase() === normalizedBot.toLowerCase() ||
|
|
1265
|
+
stripBotSuffix(login) === stripBotSuffix(normalizedBot));
|
|
1266
|
+
}
|
|
1267
|
+
function parseIssueCommentEvent(args) {
|
|
1268
|
+
var _a;
|
|
1269
|
+
var _b;
|
|
1270
|
+
const schema = z.object({
|
|
1271
|
+
action: z.string().min(1),
|
|
1272
|
+
repository: repositorySchema,
|
|
1273
|
+
issue: z.object({
|
|
1274
|
+
number: z.number().int().positive(),
|
|
1275
|
+
html_url: z.string().url(),
|
|
1276
|
+
pull_request: z.unknown().optional(),
|
|
1277
|
+
}),
|
|
1278
|
+
comment: z.object({
|
|
1279
|
+
id: z.number(),
|
|
1280
|
+
body: z.string(),
|
|
1281
|
+
html_url: z.string().url(),
|
|
1282
|
+
url: z.string().url().optional(),
|
|
1283
|
+
user: z
|
|
1284
|
+
.object({
|
|
1285
|
+
login: z.string().optional(),
|
|
1286
|
+
id: z.number().optional(),
|
|
1287
|
+
type: z.string().optional(),
|
|
1288
|
+
})
|
|
1289
|
+
.nullable()
|
|
1290
|
+
.optional(),
|
|
1291
|
+
}),
|
|
1292
|
+
sender: senderSchema,
|
|
1293
|
+
installation: installationSchema,
|
|
1294
|
+
});
|
|
1295
|
+
const parsed = schema.safeParse(args.payload);
|
|
1296
|
+
if (!parsed.success)
|
|
1297
|
+
return null;
|
|
1298
|
+
const payload = parsed.data;
|
|
1299
|
+
const kind = payload.issue.pull_request === undefined ? "issue" : "pull_request";
|
|
1300
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1301
|
+
const sender = toUser(payload.sender);
|
|
1302
|
+
const author = toUser(payload.comment.user);
|
|
1303
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1304
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: "issue_comment", repository, conversation: {
|
|
1305
|
+
kind,
|
|
1306
|
+
number: payload.issue.number,
|
|
1307
|
+
url: payload.issue.html_url,
|
|
1308
|
+
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
1309
|
+
const comment = Object.assign({ id: payload.comment.id, body: payload.comment.body, htmlUrl: payload.comment.html_url, url: (_b = payload.comment.url) !== null && _b !== void 0 ? _b : payload.comment.html_url }, (author === undefined ? {} : { author }));
|
|
1310
|
+
return { action: payload.action, ctx, comment };
|
|
1311
|
+
}
|
|
1312
|
+
function parseReviewCommentEvent(args) {
|
|
1313
|
+
var _a, _b, _c, _d;
|
|
1314
|
+
var _e;
|
|
1315
|
+
const schema = z.object({
|
|
1316
|
+
action: z.string().min(1),
|
|
1317
|
+
repository: repositorySchema,
|
|
1318
|
+
pull_request: z.object({
|
|
1319
|
+
number: z.number().int().positive(),
|
|
1320
|
+
html_url: z.string().url(),
|
|
1321
|
+
head: z
|
|
1322
|
+
.object({
|
|
1323
|
+
sha: z.string().min(1).optional(),
|
|
1324
|
+
ref: z.string().min(1).optional(),
|
|
1325
|
+
})
|
|
1326
|
+
.optional(),
|
|
1327
|
+
base: z
|
|
1328
|
+
.object({
|
|
1329
|
+
ref: z.string().min(1).optional(),
|
|
1330
|
+
})
|
|
1331
|
+
.optional(),
|
|
1332
|
+
}),
|
|
1333
|
+
comment: z.object({
|
|
1334
|
+
id: z.number(),
|
|
1335
|
+
body: z.string(),
|
|
1336
|
+
html_url: z.string().url(),
|
|
1337
|
+
url: z.string().url().optional(),
|
|
1338
|
+
path: z.string().optional(),
|
|
1339
|
+
line: z.number().nullable().optional(),
|
|
1340
|
+
pull_request_review_id: z.number().nullable().optional(),
|
|
1341
|
+
in_reply_to_id: z.number().optional(),
|
|
1342
|
+
user: z
|
|
1343
|
+
.object({
|
|
1344
|
+
login: z.string().optional(),
|
|
1345
|
+
id: z.number().optional(),
|
|
1346
|
+
type: z.string().optional(),
|
|
1347
|
+
})
|
|
1348
|
+
.nullable()
|
|
1349
|
+
.optional(),
|
|
1350
|
+
}),
|
|
1351
|
+
sender: senderSchema,
|
|
1352
|
+
installation: installationSchema,
|
|
1353
|
+
});
|
|
1354
|
+
const parsed = schema.safeParse(args.payload);
|
|
1355
|
+
if (!parsed.success)
|
|
1356
|
+
return null;
|
|
1357
|
+
const payload = parsed.data;
|
|
1358
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1359
|
+
const sender = toUser(payload.sender);
|
|
1360
|
+
const author = toUser(payload.comment.user);
|
|
1361
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1362
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: "pull_request_review_comment", repository, conversation: {
|
|
1363
|
+
kind: "review_thread",
|
|
1364
|
+
number: payload.pull_request.number,
|
|
1365
|
+
url: payload.pull_request.html_url,
|
|
1366
|
+
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
1367
|
+
const comment = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ id: payload.comment.id, body: payload.comment.body, htmlUrl: payload.comment.html_url, url: (_e = payload.comment.url) !== null && _e !== void 0 ? _e : payload.comment.html_url }, (author === undefined ? {} : { author })), (payload.comment.path === undefined ? {} : { path: payload.comment.path })), (payload.comment.line === undefined ? {} : { line: payload.comment.line })), (payload.comment.pull_request_review_id === undefined
|
|
1368
|
+
? {}
|
|
1369
|
+
: { pullRequestReviewId: payload.comment.pull_request_review_id })), (payload.comment.in_reply_to_id === undefined
|
|
1370
|
+
? {}
|
|
1371
|
+
: { inReplyToId: payload.comment.in_reply_to_id }));
|
|
1372
|
+
return {
|
|
1373
|
+
action: payload.action,
|
|
1374
|
+
ctx,
|
|
1375
|
+
comment,
|
|
1376
|
+
headSha: (_b = payload.pull_request.head) === null || _b === void 0 ? void 0 : _b.sha,
|
|
1377
|
+
headRef: (_c = payload.pull_request.head) === null || _c === void 0 ? void 0 : _c.ref,
|
|
1378
|
+
baseRef: (_d = payload.pull_request.base) === null || _d === void 0 ? void 0 : _d.ref,
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
function parseIssueEvent(args) {
|
|
1382
|
+
var _a, _b;
|
|
1383
|
+
const schema = z.object({
|
|
1384
|
+
action: z.string().min(1),
|
|
1385
|
+
repository: repositorySchema,
|
|
1386
|
+
issue: z.object({
|
|
1387
|
+
number: z.number().int().positive(),
|
|
1388
|
+
html_url: z.string().url(),
|
|
1389
|
+
title: z.string(),
|
|
1390
|
+
body: z.string().nullable().optional(),
|
|
1391
|
+
user: z
|
|
1392
|
+
.object({
|
|
1393
|
+
login: z.string().optional(),
|
|
1394
|
+
})
|
|
1395
|
+
.nullable()
|
|
1396
|
+
.optional(),
|
|
1397
|
+
}),
|
|
1398
|
+
sender: senderSchema,
|
|
1399
|
+
installation: installationSchema,
|
|
1400
|
+
});
|
|
1401
|
+
const parsed = schema.safeParse(args.payload);
|
|
1402
|
+
if (!parsed.success)
|
|
1403
|
+
return null;
|
|
1404
|
+
const payload = parsed.data;
|
|
1405
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1406
|
+
const sender = toUser(payload.sender);
|
|
1407
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1408
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: "issues", repository, conversation: {
|
|
1409
|
+
kind: "issue",
|
|
1410
|
+
number: payload.issue.number,
|
|
1411
|
+
url: payload.issue.html_url,
|
|
1412
|
+
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
1413
|
+
const issue = Object.assign(Object.assign({ action: payload.action, number: payload.issue.number, url: payload.issue.html_url, title: payload.issue.title }, (payload.issue.body === undefined || payload.issue.body === null
|
|
1414
|
+
? {}
|
|
1415
|
+
: { body: payload.issue.body })), (((_b = payload.issue.user) === null || _b === void 0 ? void 0 : _b.login) === undefined ? {} : { authorLogin: payload.issue.user.login }));
|
|
1416
|
+
return { ctx, issue };
|
|
1417
|
+
}
|
|
1418
|
+
function parseCheckSuiteEvent(args) {
|
|
1419
|
+
var _a;
|
|
1420
|
+
var _b, _c;
|
|
1421
|
+
const schema = z.object({
|
|
1422
|
+
action: z.string().min(1),
|
|
1423
|
+
repository: repositorySchema,
|
|
1424
|
+
check_suite: z.object({
|
|
1425
|
+
id: z.number(),
|
|
1426
|
+
head_sha: z.string().min(1),
|
|
1427
|
+
status: z.string().optional(),
|
|
1428
|
+
conclusion: z.string().nullable().optional(),
|
|
1429
|
+
app: z
|
|
1430
|
+
.object({
|
|
1431
|
+
slug: z.string().optional(),
|
|
1432
|
+
name: z.string().optional(),
|
|
1433
|
+
})
|
|
1434
|
+
.nullable()
|
|
1435
|
+
.optional(),
|
|
1436
|
+
pull_requests: z
|
|
1437
|
+
.array(z.object({
|
|
1438
|
+
number: z.number(),
|
|
1439
|
+
url: z.string().optional(),
|
|
1440
|
+
html_url: z.string().optional(),
|
|
1441
|
+
}))
|
|
1442
|
+
.optional(),
|
|
1443
|
+
}),
|
|
1444
|
+
sender: senderSchema,
|
|
1445
|
+
installation: installationSchema,
|
|
1446
|
+
});
|
|
1447
|
+
const parsed = schema.safeParse(args.payload);
|
|
1448
|
+
if (!parsed.success)
|
|
1449
|
+
return null;
|
|
1450
|
+
const payload = parsed.data;
|
|
1451
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1452
|
+
const sender = toUser(payload.sender);
|
|
1453
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1454
|
+
const pullRequests = toCiPullRequests(payload.check_suite.pull_requests);
|
|
1455
|
+
const checkSuite = Object.assign(Object.assign({ action: payload.action, checkSuiteId: payload.check_suite.id, headSha: payload.check_suite.head_sha }, (payload.check_suite.status === undefined ? {} : { status: payload.check_suite.status })), { conclusion: ((_b = payload.check_suite.conclusion) !== null && _b !== void 0 ? _b : null), app: toCiApp(payload.check_suite.app), pullRequests });
|
|
1456
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1457
|
+
deliveryId: args.deliveryId,
|
|
1458
|
+
eventName: "check_suite",
|
|
1459
|
+
repository,
|
|
1460
|
+
sender,
|
|
1461
|
+
installationId,
|
|
1462
|
+
});
|
|
1463
|
+
const first = pullRequests[0];
|
|
1464
|
+
if (first === undefined) {
|
|
1465
|
+
return { ctx: null, unanchoredCtx, checkSuite };
|
|
1466
|
+
}
|
|
1467
|
+
return {
|
|
1468
|
+
ctx: Object.assign(Object.assign({}, unanchoredCtx), { conversation: {
|
|
1469
|
+
kind: "pull_request",
|
|
1470
|
+
number: first.number,
|
|
1471
|
+
url: (_c = first.url) !== null && _c !== void 0 ? _c : `${repository.url}/pull/${first.number}`,
|
|
1472
|
+
} }),
|
|
1473
|
+
unanchoredCtx,
|
|
1474
|
+
checkSuite,
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
function parseCheckRunEvent(args) {
|
|
1478
|
+
var _a, _b;
|
|
1479
|
+
var _c, _d;
|
|
1480
|
+
const schema = z.object({
|
|
1481
|
+
action: z.string().min(1),
|
|
1482
|
+
repository: repositorySchema,
|
|
1483
|
+
check_run: z.object({
|
|
1484
|
+
id: z.number(),
|
|
1485
|
+
name: z.string().optional(),
|
|
1486
|
+
head_sha: z.string().min(1),
|
|
1487
|
+
status: z.string().optional(),
|
|
1488
|
+
conclusion: z.string().nullable().optional(),
|
|
1489
|
+
html_url: z.string().optional(),
|
|
1490
|
+
check_suite: z
|
|
1491
|
+
.object({
|
|
1492
|
+
id: z.number().optional(),
|
|
1493
|
+
})
|
|
1494
|
+
.optional(),
|
|
1495
|
+
app: z
|
|
1496
|
+
.object({
|
|
1497
|
+
slug: z.string().optional(),
|
|
1498
|
+
name: z.string().optional(),
|
|
1499
|
+
})
|
|
1500
|
+
.nullable()
|
|
1501
|
+
.optional(),
|
|
1502
|
+
pull_requests: z
|
|
1503
|
+
.array(z.object({
|
|
1504
|
+
number: z.number(),
|
|
1505
|
+
url: z.string().optional(),
|
|
1506
|
+
html_url: z.string().optional(),
|
|
1507
|
+
}))
|
|
1508
|
+
.optional(),
|
|
1509
|
+
}),
|
|
1510
|
+
sender: senderSchema,
|
|
1511
|
+
installation: installationSchema,
|
|
1512
|
+
});
|
|
1513
|
+
const parsed = schema.safeParse(args.payload);
|
|
1514
|
+
if (!parsed.success)
|
|
1515
|
+
return null;
|
|
1516
|
+
const payload = parsed.data;
|
|
1517
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1518
|
+
const sender = toUser(payload.sender);
|
|
1519
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1520
|
+
const pullRequests = toCiPullRequests(payload.check_run.pull_requests);
|
|
1521
|
+
const checkRun = Object.assign(Object.assign(Object.assign(Object.assign({ action: payload.action, checkRunId: payload.check_run.id, headSha: payload.check_run.head_sha }, (payload.check_run.name === undefined ? {} : { name: payload.check_run.name })), (((_b = payload.check_run.check_suite) === null || _b === void 0 ? void 0 : _b.id) === undefined
|
|
1522
|
+
? {}
|
|
1523
|
+
: { checkSuiteId: payload.check_run.check_suite.id })), (payload.check_run.status === undefined ? {} : { status: payload.check_run.status })), { conclusion: ((_c = payload.check_run.conclusion) !== null && _c !== void 0 ? _c : null), app: toCiApp(payload.check_run.app), pullRequests });
|
|
1524
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1525
|
+
deliveryId: args.deliveryId,
|
|
1526
|
+
eventName: "check_run",
|
|
1527
|
+
repository,
|
|
1528
|
+
sender,
|
|
1529
|
+
installationId,
|
|
1530
|
+
});
|
|
1531
|
+
const first = pullRequests[0];
|
|
1532
|
+
if (first === undefined) {
|
|
1533
|
+
return { ctx: null, unanchoredCtx, checkRun };
|
|
1534
|
+
}
|
|
1535
|
+
return {
|
|
1536
|
+
ctx: Object.assign(Object.assign({}, unanchoredCtx), { conversation: {
|
|
1537
|
+
kind: "pull_request",
|
|
1538
|
+
number: first.number,
|
|
1539
|
+
url: (_d = first.url) !== null && _d !== void 0 ? _d : `${repository.url}/pull/${first.number}`,
|
|
1540
|
+
} }),
|
|
1541
|
+
unanchoredCtx,
|
|
1542
|
+
checkRun,
|
|
1543
|
+
};
|
|
1544
|
+
}
|
|
1545
|
+
function parseWorkflowRunEvent(args) {
|
|
1546
|
+
var _a;
|
|
1547
|
+
var _b, _c;
|
|
1548
|
+
const schema = z.object({
|
|
1549
|
+
action: z.string().min(1),
|
|
1550
|
+
repository: repositorySchema,
|
|
1551
|
+
workflow_run: z.object({
|
|
1552
|
+
id: z.number(),
|
|
1553
|
+
name: z.string().nullable().optional(),
|
|
1554
|
+
workflow_id: z.number().optional(),
|
|
1555
|
+
head_sha: z.string().min(1),
|
|
1556
|
+
status: z.string().optional(),
|
|
1557
|
+
conclusion: z.string().nullable().optional(),
|
|
1558
|
+
html_url: z.string().optional(),
|
|
1559
|
+
pull_requests: z
|
|
1560
|
+
.array(z.object({
|
|
1561
|
+
number: z.number(),
|
|
1562
|
+
url: z.string().optional(),
|
|
1563
|
+
html_url: z.string().optional(),
|
|
1564
|
+
}))
|
|
1565
|
+
.optional(),
|
|
1566
|
+
}),
|
|
1567
|
+
sender: senderSchema,
|
|
1568
|
+
installation: installationSchema,
|
|
1569
|
+
});
|
|
1570
|
+
const parsed = schema.safeParse(args.payload);
|
|
1571
|
+
if (!parsed.success)
|
|
1572
|
+
return null;
|
|
1573
|
+
const payload = parsed.data;
|
|
1574
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1575
|
+
const sender = toUser(payload.sender);
|
|
1576
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1577
|
+
const pullRequests = toCiPullRequests(payload.workflow_run.pull_requests);
|
|
1578
|
+
const workflowRun = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ action: payload.action, workflowRunId: payload.workflow_run.id, headSha: payload.workflow_run.head_sha }, (payload.workflow_run.name === undefined || payload.workflow_run.name === null
|
|
1579
|
+
? {}
|
|
1580
|
+
: { name: payload.workflow_run.name })), (payload.workflow_run.workflow_id === undefined
|
|
1581
|
+
? {}
|
|
1582
|
+
: { workflowId: payload.workflow_run.workflow_id })), (payload.workflow_run.html_url === undefined
|
|
1583
|
+
? {}
|
|
1584
|
+
: { htmlUrl: payload.workflow_run.html_url })), (payload.workflow_run.status === undefined ? {} : { status: payload.workflow_run.status })), { conclusion: ((_b = payload.workflow_run.conclusion) !== null && _b !== void 0 ? _b : null),
|
|
1585
|
+
// workflow_run is GitHub Actions-only (Eve semantics).
|
|
1586
|
+
app: { slug: "github-actions", name: "GitHub Actions" }, pullRequests });
|
|
1587
|
+
const unanchoredCtx = unanchoredEventContext({
|
|
1588
|
+
deliveryId: args.deliveryId,
|
|
1589
|
+
eventName: "workflow_run",
|
|
1590
|
+
repository,
|
|
1591
|
+
sender,
|
|
1592
|
+
installationId,
|
|
1593
|
+
});
|
|
1594
|
+
const first = pullRequests[0];
|
|
1595
|
+
if (first === undefined) {
|
|
1596
|
+
return { ctx: null, unanchoredCtx, workflowRun };
|
|
1597
|
+
}
|
|
1598
|
+
return {
|
|
1599
|
+
ctx: Object.assign(Object.assign({}, unanchoredCtx), { conversation: {
|
|
1600
|
+
kind: "pull_request",
|
|
1601
|
+
number: first.number,
|
|
1602
|
+
url: (_c = first.url) !== null && _c !== void 0 ? _c : `${repository.url}/pull/${first.number}`,
|
|
1603
|
+
} }),
|
|
1604
|
+
unanchoredCtx,
|
|
1605
|
+
workflowRun,
|
|
1606
|
+
};
|
|
1607
|
+
}
|
|
1608
|
+
function parseStatusEvent(args) {
|
|
1609
|
+
var _a;
|
|
1610
|
+
var _b, _c, _d, _e;
|
|
1611
|
+
const schema = z.object({
|
|
1612
|
+
state: z.string().min(1),
|
|
1613
|
+
sha: z.string().min(1),
|
|
1614
|
+
context: z.string().optional(),
|
|
1615
|
+
description: z.string().nullable().optional(),
|
|
1616
|
+
target_url: z.string().nullable().optional(),
|
|
1617
|
+
name: z.string().optional(),
|
|
1618
|
+
branches: z
|
|
1619
|
+
.array(z.object({
|
|
1620
|
+
name: z.string(),
|
|
1621
|
+
commit: z.object({ sha: z.string().optional() }).optional(),
|
|
1622
|
+
}))
|
|
1623
|
+
.optional(),
|
|
1624
|
+
commit: z
|
|
1625
|
+
.object({
|
|
1626
|
+
sha: z.string().optional(),
|
|
1627
|
+
html_url: z.string().optional(),
|
|
1628
|
+
})
|
|
1629
|
+
.optional(),
|
|
1630
|
+
repository: repositorySchema,
|
|
1631
|
+
sender: senderSchema,
|
|
1632
|
+
installation: installationSchema,
|
|
1633
|
+
pull_requests: z
|
|
1634
|
+
.array(z.object({
|
|
1635
|
+
number: z.number(),
|
|
1636
|
+
url: z.string().optional(),
|
|
1637
|
+
html_url: z.string().optional(),
|
|
1638
|
+
}))
|
|
1639
|
+
.optional(),
|
|
1640
|
+
});
|
|
1641
|
+
const parsed = schema.safeParse(args.payload);
|
|
1642
|
+
if (!parsed.success)
|
|
1643
|
+
return null;
|
|
1644
|
+
const payload = parsed.data;
|
|
1645
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1646
|
+
const sender = toUser(payload.sender);
|
|
1647
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1648
|
+
const pullRequests = toCiPullRequests(payload.pull_requests);
|
|
1649
|
+
const first = pullRequests[0];
|
|
1650
|
+
const status = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ state: payload.state, context: (_b = payload.context) !== null && _b !== void 0 ? _b : "" }, (payload.description === undefined ? {} : { description: payload.description })), (payload.target_url === undefined ? {} : { targetUrl: payload.target_url })), { sha: payload.sha }), (payload.name === undefined ? {} : { name: payload.name })), { branches: ((_c = payload.branches) !== null && _c !== void 0 ? _c : []).map(branch => (Object.assign({ name: branch.name }, (branch.commit === undefined ? {} : { commit: branch.commit })))) }), (payload.commit === undefined
|
|
1651
|
+
? {}
|
|
1652
|
+
: {
|
|
1653
|
+
commit: Object.assign(Object.assign({}, (payload.commit.sha === undefined ? {} : { sha: payload.commit.sha })), (payload.commit.html_url === undefined ? {} : { htmlUrl: payload.commit.html_url })),
|
|
1654
|
+
})), { raw: args.payload });
|
|
1655
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: "status", repository, conversation: {
|
|
1656
|
+
kind: "pull_request",
|
|
1657
|
+
number: (_d = first === null || first === void 0 ? void 0 : first.number) !== null && _d !== void 0 ? _d : 0,
|
|
1658
|
+
url: (_e = first === null || first === void 0 ? void 0 : first.url) !== null && _e !== void 0 ? _e : repository.url,
|
|
1659
|
+
} }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
1660
|
+
return { ctx, status };
|
|
1661
|
+
}
|
|
1662
|
+
function parseGenericEvent(args) {
|
|
1663
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1664
|
+
var _g, _h, _j, _k;
|
|
1665
|
+
const schema = z.object({
|
|
1666
|
+
action: z.string().optional(),
|
|
1667
|
+
repository: repositorySchema.optional(),
|
|
1668
|
+
sender: senderSchema,
|
|
1669
|
+
installation: installationSchema,
|
|
1670
|
+
issue: z
|
|
1671
|
+
.object({
|
|
1672
|
+
number: z.number().int().positive(),
|
|
1673
|
+
html_url: z.string().url().optional(),
|
|
1674
|
+
pull_request: z.unknown().optional(),
|
|
1675
|
+
})
|
|
1676
|
+
.optional(),
|
|
1677
|
+
pull_request: z
|
|
1678
|
+
.object({
|
|
1679
|
+
number: z.number().int().positive(),
|
|
1680
|
+
html_url: z.string().url().optional(),
|
|
1681
|
+
})
|
|
1682
|
+
.optional(),
|
|
1683
|
+
});
|
|
1684
|
+
const parsed = schema.safeParse(args.payload);
|
|
1685
|
+
if (!parsed.success) {
|
|
1686
|
+
return null;
|
|
1687
|
+
}
|
|
1688
|
+
const payload = parsed.data;
|
|
1689
|
+
if (payload.repository === undefined) {
|
|
1690
|
+
return null;
|
|
1691
|
+
}
|
|
1692
|
+
const repository = toRepositoryRef(payload.repository);
|
|
1693
|
+
const sender = toUser(payload.sender);
|
|
1694
|
+
const installationId = (_a = payload.installation) === null || _a === void 0 ? void 0 : _a.id;
|
|
1695
|
+
const kind = ((_b = payload.issue) === null || _b === void 0 ? void 0 : _b.pull_request) !== undefined
|
|
1696
|
+
? "pull_request"
|
|
1697
|
+
: payload.issue !== undefined
|
|
1698
|
+
? "issue"
|
|
1699
|
+
: "pull_request";
|
|
1700
|
+
const number = (_h = (_g = (_c = payload.issue) === null || _c === void 0 ? void 0 : _c.number) !== null && _g !== void 0 ? _g : (_d = payload.pull_request) === null || _d === void 0 ? void 0 : _d.number) !== null && _h !== void 0 ? _h : 0;
|
|
1701
|
+
const url = (_k = (_j = (_e = payload.issue) === null || _e === void 0 ? void 0 : _e.html_url) !== null && _j !== void 0 ? _j : (_f = payload.pull_request) === null || _f === void 0 ? void 0 : _f.html_url) !== null && _k !== void 0 ? _k : repository.url;
|
|
1702
|
+
const event = Object.assign(Object.assign(Object.assign({ eventName: args.eventName }, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), (payload.action === undefined ? {} : { action: payload.action })), { payload: args.payload });
|
|
1703
|
+
const ctx = Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: args.eventName, repository, conversation: { kind, number, url } }), (sender === undefined ? {} : { sender, senderLogin: sender.login })), (installationId === undefined ? {} : { installationId }));
|
|
1704
|
+
return { ctx, event };
|
|
1705
|
+
}
|
|
1706
|
+
function unanchoredEventContext(args) {
|
|
1707
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (args.deliveryId === undefined ? {} : { deliveryId: args.deliveryId })), { eventName: args.eventName, repository: args.repository, conversation: {
|
|
1708
|
+
kind: "pull_request",
|
|
1709
|
+
number: 0,
|
|
1710
|
+
url: args.repository.url,
|
|
1711
|
+
} }), (args.sender === undefined ? {} : { sender: args.sender, senderLogin: args.sender.login })), (args.installationId === undefined ? {} : { installationId: args.installationId }));
|
|
1712
|
+
}
|
|
1713
|
+
function toRepositoryRef(repo) {
|
|
1714
|
+
var _a;
|
|
1715
|
+
var _b, _c, _d, _e;
|
|
1716
|
+
const [ownerFromName, nameFromFull] = repo.full_name.split("/");
|
|
1717
|
+
return Object.assign({ fullName: repo.full_name, url: repo.html_url, owner: (_c = (_b = (_a = repo.owner) === null || _a === void 0 ? void 0 : _a.login) !== null && _b !== void 0 ? _b : ownerFromName) !== null && _c !== void 0 ? _c : "", name: (_e = (_d = repo.name) !== null && _d !== void 0 ? _d : nameFromFull) !== null && _e !== void 0 ? _e : repo.full_name }, (repo.id === undefined ? {} : { id: repo.id }));
|
|
1718
|
+
}
|
|
1719
|
+
function toUser(raw) {
|
|
1720
|
+
if ((raw === null || raw === void 0 ? void 0 : raw.login) === undefined || raw.login === "")
|
|
1721
|
+
return undefined;
|
|
1722
|
+
return Object.assign(Object.assign({ login: raw.login }, (raw.id === undefined ? {} : { id: raw.id })), (raw.type === undefined ? {} : { type: raw.type }));
|
|
1723
|
+
}
|
|
1724
|
+
function toCiPullRequests(raw) {
|
|
1725
|
+
return (raw !== null && raw !== void 0 ? raw : []).map(pr => (Object.assign({ number: pr.number }, (pr.html_url !== undefined
|
|
1726
|
+
? { url: pr.html_url }
|
|
1727
|
+
: pr.url !== undefined
|
|
1728
|
+
? { url: pr.url }
|
|
1729
|
+
: {}))));
|
|
1730
|
+
}
|
|
1731
|
+
function toCiApp(raw) {
|
|
1732
|
+
return Object.assign(Object.assign({}, ((raw === null || raw === void 0 ? void 0 : raw.slug) === undefined ? {} : { slug: raw.slug })), ((raw === null || raw === void 0 ? void 0 : raw.name) === undefined ? {} : { name: raw.name }));
|
|
1733
|
+
}
|
|
1734
|
+
function escapeRegExp(value) {
|
|
1735
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* Attach the GitHub API + thread handles to a parsed context, producing the
|
|
1739
|
+
* full {@link GitHubEventContext} handed to inbound hooks.
|
|
1740
|
+
*/
|
|
1741
|
+
function enrichEventContext(input) {
|
|
1742
|
+
const { github, thread } = buildGitHubBinding({
|
|
1743
|
+
config: input.bindingConfig,
|
|
1744
|
+
state: input.bindingState,
|
|
1745
|
+
});
|
|
1746
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, input.ctx), { payload: input.payload }), (input.installationId === undefined ? {} : { installationId: input.installationId })), { github,
|
|
1747
|
+
thread, host: input.host, artifacts: input.artifacts }), (input.send === undefined ? {} : { send: input.send }));
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Enrich an unanchored CI context (`conversation.number === 0`). The binding
|
|
1751
|
+
* still resolves `github`, but `thread.post` throws until a PR is attached.
|
|
1752
|
+
*/
|
|
1753
|
+
function enrichCiContext(input) {
|
|
1754
|
+
const binding = githubBindingStateForEvent({
|
|
1755
|
+
kind: input.ctx.conversation.kind,
|
|
1756
|
+
owner: input.ctx.repository.owner,
|
|
1757
|
+
repo: input.ctx.repository.name,
|
|
1758
|
+
number: input.ctx.conversation.number,
|
|
1759
|
+
repositoryId: input.ctx.repository.id,
|
|
1760
|
+
repositoryUrl: input.ctx.repository.url,
|
|
1761
|
+
installationId: input.installationId,
|
|
1762
|
+
});
|
|
1763
|
+
return enrichEventContext(Object.assign({ bindingConfig: input.bindingConfig, ctx: input.ctx, bindingState: binding, installationId: input.installationId, payload: input.payload, host: input.host, artifacts: input.artifacts }, (input.send === undefined ? {} : { send: input.send })));
|
|
1764
|
+
}
|
|
1765
|
+
/** Build the durable per-session channel state stored with the turn. */
|
|
1766
|
+
function sessionStateFromBinding(input) {
|
|
1767
|
+
var _a, _b, _c, _d;
|
|
1768
|
+
return emptyGitHubChannelState(Object.assign(Object.assign({}, input.binding), { deliveryId: (_a = input.deliveryId) !== null && _a !== void 0 ? _a : null, eventName: input.eventName, headSha: (_b = input.headSha) !== null && _b !== void 0 ? _b : null, baseRef: (_c = input.baseRef) !== null && _c !== void 0 ? _c : null, headRef: (_d = input.headRef) !== null && _d !== void 0 ? _d : null }));
|
|
1769
|
+
}
|
|
1770
|
+
/** Read `installation.id` from a raw webhook payload when present. */
|
|
1771
|
+
function readInstallationId(payload) {
|
|
1772
|
+
if (typeof payload !== "object" || payload === null)
|
|
1773
|
+
return undefined;
|
|
1774
|
+
const installation = payload.installation;
|
|
1775
|
+
return typeof (installation === null || installation === void 0 ? void 0 : installation.id) === "number" ? installation.id : undefined;
|
|
1776
|
+
}
|
|
1777
|
+
function envWebhookSecret() {
|
|
1778
|
+
if (process.env.GITHUB_WEBHOOK_SECRET === undefined || process.env.GITHUB_WEBHOOK_SECRET === "") {
|
|
1779
|
+
return undefined;
|
|
1780
|
+
}
|
|
1781
|
+
return () => process.env.GITHUB_WEBHOOK_SECRET;
|
|
1782
|
+
}
|
|
1783
|
+
function resolveCloudOptions(cloud, ctx, pullRequest) {
|
|
1784
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1785
|
+
if (cloud === undefined || cloud === false) {
|
|
1786
|
+
return undefined;
|
|
1787
|
+
}
|
|
1788
|
+
if (cloud === true) {
|
|
1789
|
+
return {
|
|
1790
|
+
repos: [
|
|
1791
|
+
{
|
|
1792
|
+
url: ctx.repository.url,
|
|
1793
|
+
prUrl: pullRequest.url,
|
|
1794
|
+
startingRef: pullRequest.headSha,
|
|
1795
|
+
},
|
|
1796
|
+
],
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
if (typeof cloud === "function") {
|
|
1800
|
+
return yield cloud(ctx, pullRequest);
|
|
1801
|
+
}
|
|
1802
|
+
return cloud;
|
|
1803
|
+
});
|
|
1804
|
+
}
|