@shepai/cli 1.116.0-pr362.c0ee15c → 1.116.0-pr367.8e10c48
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/dist/packages/core/src/application/ports/output/services/index.d.ts +2 -0
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/tunnel-service.interface.d.ts +41 -0
- package/dist/packages/core/src/application/ports/output/services/tunnel-service.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/tunnel-service.interface.js +14 -0
- package/dist/packages/core/src/application/ports/output/services/webhook-service.interface.d.ts +65 -0
- package/dist/packages/core/src/application/ports/output/services/webhook-service.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/webhook-service.interface.js +10 -0
- package/dist/packages/core/src/application/use-cases/features/cleanup-feature-worktree.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/cleanup-feature-worktree.use-case.js +0 -5
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +1 -3
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +2 -30
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +14 -0
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +1 -6
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +1 -6
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/gemini-cli-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/gemini-cli-executor.service.js +1 -6
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +1 -17
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js +0 -12
- package/dist/packages/core/src/infrastructure/services/tunnel/cloudflare-tunnel.service.d.ts +36 -0
- package/dist/packages/core/src/infrastructure/services/tunnel/cloudflare-tunnel.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/tunnel/cloudflare-tunnel.service.js +148 -0
- package/dist/packages/core/src/infrastructure/services/webhook/github-webhook.service.d.ts +75 -0
- package/dist/packages/core/src/infrastructure/services/webhook/github-webhook.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/webhook/github-webhook.service.js +372 -0
- package/dist/packages/core/src/infrastructure/services/webhook/webhook-manager.service.d.ts +82 -0
- package/dist/packages/core/src/infrastructure/services/webhook/webhook-manager.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/webhook/webhook-manager.service.js +192 -0
- package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/ui.command.js +15 -0
- package/dist/src/presentation/web/app/actions/load-webhook-status.d.ts +3 -0
- package/dist/src/presentation/web/app/actions/load-webhook-status.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/load-webhook-status.js +19 -0
- package/dist/src/presentation/web/app/api/webhooks/deliveries/route.d.ts +9 -0
- package/dist/src/presentation/web/app/api/webhooks/deliveries/route.d.ts.map +1 -0
- package/dist/src/presentation/web/app/api/webhooks/deliveries/route.js +27 -0
- package/dist/src/presentation/web/app/api/webhooks/github/route.d.ts +17 -0
- package/dist/src/presentation/web/app/api/webhooks/github/route.d.ts.map +1 -0
- package/dist/src/presentation/web/app/api/webhooks/github/route.js +70 -0
- package/dist/src/presentation/web/app/api/webhooks/status/route.d.ts +9 -0
- package/dist/src/presentation/web/app/api/webhooks/status/route.d.ts.map +1 -0
- package/dist/src/presentation/web/app/api/webhooks/status/route.js +26 -0
- package/dist/src/presentation/web/app/webhooks/page.d.ts +4 -0
- package/dist/src/presentation/web/app/webhooks/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/webhooks/page.js +9 -0
- package/dist/src/presentation/web/components/features/webhooks/types.d.ts +32 -0
- package/dist/src/presentation/web/components/features/webhooks/types.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/types.js +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.d.ts +6 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.js +38 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-delivery-table.stories.js +69 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.d.ts +7 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.js +11 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-repo-list.stories.js +31 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.d.ts +6 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.js +21 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.stories.d.ts +9 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhook-status-cards.stories.js +56 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.d.ts +6 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.js +39 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.stories.d.ts +8 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/webhooks/webhooks-page-client.stories.js +59 -0
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +2 -2
- package/dist/src/presentation/web/dev-server.js +20 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +5 -1
- package/web/.next/build-manifest.json +6 -6
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/routes-manifest.json +24 -0
- package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +4 -4
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page/build-manifest.json +4 -4
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/build-manifest.json +4 -4
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/webhooks/deliveries/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/api/webhooks/deliveries/route/build-manifest.json +11 -0
- package/web/.next/server/app/api/webhooks/deliveries/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/api/webhooks/deliveries/route.js +6 -0
- package/web/.next/server/app/api/webhooks/deliveries/route.js.map +5 -0
- package/web/.next/server/app/api/webhooks/deliveries/route.js.nft.json +1 -0
- package/web/.next/server/app/api/webhooks/deliveries/route_client-reference-manifest.js +2 -0
- package/web/.next/server/app/api/webhooks/github/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/api/webhooks/github/route/build-manifest.json +11 -0
- package/web/.next/server/app/api/webhooks/github/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/api/webhooks/github/route.js +6 -0
- package/web/.next/server/app/api/webhooks/github/route.js.map +5 -0
- package/web/.next/server/app/api/webhooks/github/route.js.nft.json +1 -0
- package/web/.next/server/app/api/webhooks/github/route_client-reference-manifest.js +2 -0
- package/web/.next/server/app/api/webhooks/status/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/api/webhooks/status/route/build-manifest.json +11 -0
- package/web/.next/server/app/api/webhooks/status/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/api/webhooks/status/route.js +6 -0
- package/web/.next/server/app/api/webhooks/status/route.js.map +5 -0
- package/web/.next/server/app/api/webhooks/status/route.js.nft.json +1 -0
- package/web/.next/server/app/api/webhooks/status/route_client-reference-manifest.js +2 -0
- package/web/.next/server/app/settings/page/build-manifest.json +4 -4
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/build-manifest.json +4 -4
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/build-manifest.json +4 -4
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/build-manifest.json +4 -4
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/webhooks/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/webhooks/page/build-manifest.json +18 -0
- package/web/.next/server/app/webhooks/page/next-font-manifest.json +6 -0
- package/web/.next/server/app/webhooks/page/react-loadable-manifest.json +1 -0
- package/web/.next/server/app/webhooks/page/server-reference-manifest.json +35 -0
- package/web/.next/server/app/webhooks/page.js +16 -0
- package/web/.next/server/app/webhooks/page.js.map +5 -0
- package/web/.next/server/app/webhooks/page.js.nft.json +1 -0
- package/web/.next/server/app/webhooks/page_client-reference-manifest.js +2 -0
- package/web/.next/server/app-paths-manifest.json +5 -1
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_deliveries_route_actions_d9e34c8d.js +3 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_deliveries_route_actions_d9e34c8d.js.map +1 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_github_route_actions_1b0d0c38.js +3 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_github_route_actions_1b0d0c38.js.map +1 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_status_route_actions_1a0d86a1.js +3 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_webhooks_status_route_actions_1a0d86a1.js.map +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__15e5d45c._.js +3 -0
- package/web/.next/server/chunks/[root-of-the-server]__15e5d45c._.js.map +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__23be381e._.js +3 -0
- package/web/.next/server/chunks/[root-of-the-server]__23be381e._.js.map +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__9fc760c0._.js +3 -0
- package/web/.next/server/chunks/[root-of-the-server]__9fc760c0._.js.map +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_activity_22f9667f.js +3 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_activity_22f9667f.js.map +1 -0
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d847b7b._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d847b7b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__87a7ae30._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__87a7ae30._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__920dccd5._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__920dccd5._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a42f5a88._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a42f5a88._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_26b2c311._.js +3 -0
- package/web/.next/server/chunks/ssr/_26b2c311._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_27dd06aa._.js +3 -0
- package/web/.next/server/chunks/ssr/_27dd06aa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_28862ed0._.js +3 -0
- package/web/.next/server/chunks/ssr/{_871373f7._.js.map → _28862ed0._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_37f9b23b._.js → _383572e0._.js} +2 -2
- package/web/.next/server/chunks/ssr/_383572e0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_809c53f6._.js +9 -0
- package/web/.next/server/chunks/ssr/_809c53f6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_9eea4c51._.js +3 -0
- package/web/.next/server/chunks/ssr/_9eea4c51._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a4899a76._.js +3 -0
- package/web/.next/server/chunks/ssr/_a4899a76._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_b7eb93fc._.js +4 -0
- package/web/.next/server/chunks/ssr/_b7eb93fc._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_e0a01382._.js +3 -0
- package/web/.next/server/chunks/ssr/_e0a01382._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_f8b36e2c._.js +3 -0
- package/web/.next/server/chunks/ssr/_f8b36e2c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_webhooks_webhooks-page-client_tsx_b2662ea3._.js +3 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_webhooks_webhooks-page-client_tsx_b2662ea3._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_1bb131c4._.js → node_modules__pnpm_747b43ac._.js} +2 -2
- package/web/.next/server/chunks/ssr/node_modules__pnpm_747b43ac._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +4 -4
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +54 -32
- package/web/.next/static/chunks/06b948216df083c1.js +1 -0
- package/web/.next/static/chunks/2bdc11361b8f2602.js +1 -0
- package/web/.next/static/chunks/31f35710932542ef.js +1 -0
- package/web/.next/static/chunks/{4e46e9e2ec8bcce2.js → 385710675a1d06c9.js} +1 -1
- package/web/.next/static/chunks/40b6bcf1a2de4a0f.js +1 -0
- package/web/.next/static/chunks/4714eb891fa4fd81.js +1 -0
- package/web/.next/static/chunks/{df558fa5a59ef099.js → 51ca7e4cad588da4.js} +1 -1
- package/web/.next/static/chunks/523340641468b5f2.js +1 -0
- package/web/.next/static/chunks/5f6161ceb4263319.js +1 -0
- package/web/.next/static/chunks/{84c9b04d5397cc46.js → 604d36c352fff6c0.js} +2 -2
- package/web/.next/static/chunks/{672e3da3ad26005b.js → 98e3a7cf58fc912a.js} +1 -1
- package/web/.next/static/chunks/9a7361e2365b2d8e.js +1 -0
- package/web/.next/static/chunks/9af45e885bd4ccef.js +1 -0
- package/web/.next/static/chunks/bbfb591f6aaa7255.css +1 -0
- package/web/.next/static/chunks/{8392a79c0bd9956b.js → c6dc0749ac370da4.js} +1 -1
- package/web/.next/static/chunks/c7e793951b20a67f.js +1 -0
- package/web/.next/static/chunks/{489412a4676a1d14.js → e510518c9ca6e844.js} +1 -1
- package/web/.next/static/chunks/e9621b096a69e4e8.js +11 -0
- package/web/.next/static/chunks/{9f61c4cc4813cbc1.js → f60771797b58531f.js} +1 -1
- package/web/.next/static/chunks/f644140e21b75f61.js +1 -0
- package/web/.next/static/chunks/{turbopack-426d9bc2450816ba.js → turbopack-b1685b5f87ad1d60.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6367aea0._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b1e68e34._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b1e68e34._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_273d4632._.js +0 -3
- package/web/.next/server/chunks/ssr/_273d4632._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_37f9b23b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6d26a08f._.js +0 -3
- package/web/.next/server/chunks/ssr/_6d26a08f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_871373f7._.js +0 -3
- package/web/.next/server/chunks/ssr/_a68d7e1c._.js +0 -9
- package/web/.next/server/chunks/ssr/_a68d7e1c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_b5fc318a._.js +0 -3
- package/web/.next/server/chunks/ssr/_b5fc318a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f5316e67._.js +0 -3
- package/web/.next/server/chunks/ssr/_f5316e67._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f7926f23._.js +0 -3
- package/web/.next/server/chunks/ssr/_f7926f23._.js.map +0 -1
- package/web/.next/static/chunks/303a1217006489b9.js +0 -1
- package/web/.next/static/chunks/3a806cf059241bc9.js +0 -1
- package/web/.next/static/chunks/57b45edf86522369.css +0 -1
- package/web/.next/static/chunks/619af41a8d3232e5.js +0 -1
- package/web/.next/static/chunks/82cf0022cbfd40cb.js +0 -1
- package/web/.next/static/chunks/84a181ff3270fd9f.js +0 -1
- package/web/.next/static/chunks/a1cb1cf624ae4986.js +0 -1
- package/web/.next/static/chunks/b1f3c0e8e9872ef8.js +0 -1
- package/web/.next/static/chunks/ed3a602003bcb31b.js +0 -1
- package/web/.next/static/chunks/ee6d0ebf271c7b4c.js +0 -11
- package/web/.next/static/chunks/f3ba96e4b2c8be37.js +0 -1
- package/web/.next/static/chunks/fcde0cbb2976b933.js +0 -1
- /package/web/.next/static/{d6lJHy_7WaSuAS7PMm2hW → kQ3LD6zhRbOzb0MYK2n5b}/_buildManifest.js +0 -0
- /package/web/.next/static/{d6lJHy_7WaSuAS7PMm2hW → kQ3LD6zhRbOzb0MYK2n5b}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{d6lJHy_7WaSuAS7PMm2hW → kQ3LD6zhRbOzb0MYK2n5b}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare Tunnel Service
|
|
3
|
+
*
|
|
4
|
+
* Manages a `cloudflared` quick-tunnel process that exposes a local port
|
|
5
|
+
* to the public internet via a random *.trycloudflare.com subdomain.
|
|
6
|
+
*
|
|
7
|
+
* Key behaviors:
|
|
8
|
+
* - Spawns `cloudflared tunnel --url http://localhost:<port>`
|
|
9
|
+
* - Parses the assigned public URL from process stderr
|
|
10
|
+
* - Detects URL changes on reconnection and notifies listeners
|
|
11
|
+
* - Gracefully kills the process on stop()
|
|
12
|
+
*
|
|
13
|
+
* The tunnel exposes the full local port but only the webhook API route
|
|
14
|
+
* should be registered with external services. Path-level filtering
|
|
15
|
+
* happens at the webhook route handler, not the tunnel layer.
|
|
16
|
+
*/
|
|
17
|
+
import { spawn } from 'node:child_process';
|
|
18
|
+
import { IS_WINDOWS } from '../../platform.js';
|
|
19
|
+
const TAG = '[CloudflareTunnel]';
|
|
20
|
+
const CLOUDFLARED_URL_REGEX = /https:\/\/[a-z0-9-]+\.trycloudflare\.com/;
|
|
21
|
+
const STARTUP_TIMEOUT_MS = 30_000;
|
|
22
|
+
const defaultDeps = {
|
|
23
|
+
spawnProcess: spawn,
|
|
24
|
+
};
|
|
25
|
+
export class CloudflareTunnelService {
|
|
26
|
+
process = null;
|
|
27
|
+
publicUrl = null;
|
|
28
|
+
urlChangeHandlers = [];
|
|
29
|
+
deps;
|
|
30
|
+
constructor(deps = {}) {
|
|
31
|
+
this.deps = { ...defaultDeps, ...deps };
|
|
32
|
+
}
|
|
33
|
+
async start(localPort) {
|
|
34
|
+
if (this.process) {
|
|
35
|
+
throw new Error(`${TAG} Tunnel already running at ${this.publicUrl}`);
|
|
36
|
+
}
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const timeout = setTimeout(() => {
|
|
39
|
+
this.killProcess();
|
|
40
|
+
reject(new Error(`${TAG} Timed out waiting for tunnel URL (${STARTUP_TIMEOUT_MS}ms)`));
|
|
41
|
+
}, STARTUP_TIMEOUT_MS);
|
|
42
|
+
const args = ['tunnel', '--url', `http://localhost:${localPort}`];
|
|
43
|
+
const child = this.deps.spawnProcess('cloudflared', args, {
|
|
44
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
45
|
+
...(IS_WINDOWS ? { windowsHide: true } : {}),
|
|
46
|
+
});
|
|
47
|
+
this.process = child;
|
|
48
|
+
const handleOutput = (data) => {
|
|
49
|
+
const line = data.toString();
|
|
50
|
+
const match = line.match(CLOUDFLARED_URL_REGEX);
|
|
51
|
+
if (match) {
|
|
52
|
+
const url = match[0];
|
|
53
|
+
if (!this.publicUrl) {
|
|
54
|
+
// First URL — startup complete
|
|
55
|
+
this.publicUrl = url;
|
|
56
|
+
clearTimeout(timeout);
|
|
57
|
+
// eslint-disable-next-line no-console
|
|
58
|
+
console.log(`${TAG} Tunnel ready: ${url}`);
|
|
59
|
+
resolve(url);
|
|
60
|
+
}
|
|
61
|
+
else if (url !== this.publicUrl) {
|
|
62
|
+
// URL changed — reconnection with new subdomain
|
|
63
|
+
const oldUrl = this.publicUrl;
|
|
64
|
+
this.publicUrl = url;
|
|
65
|
+
// eslint-disable-next-line no-console
|
|
66
|
+
console.log(`${TAG} Tunnel URL changed: ${oldUrl} -> ${url}`);
|
|
67
|
+
this.notifyUrlChange(url);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
child.stdout?.on('data', handleOutput);
|
|
72
|
+
child.stderr?.on('data', handleOutput);
|
|
73
|
+
child.on('error', (err) => {
|
|
74
|
+
clearTimeout(timeout);
|
|
75
|
+
this.process = null;
|
|
76
|
+
this.publicUrl = null;
|
|
77
|
+
if (err.code === 'ENOENT') {
|
|
78
|
+
reject(new Error(`${TAG} 'cloudflared' not found. Install it: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/`));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
reject(new Error(`${TAG} Failed to start tunnel: ${err.message}`));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
child.on('close', (code) => {
|
|
85
|
+
clearTimeout(timeout);
|
|
86
|
+
if (this.process === child) {
|
|
87
|
+
this.process = null;
|
|
88
|
+
const wasRunning = this.publicUrl !== null;
|
|
89
|
+
this.publicUrl = null;
|
|
90
|
+
if (wasRunning) {
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
console.log(`${TAG} Tunnel process exited (code ${code})`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
// Process exited before producing a URL
|
|
96
|
+
reject(new Error(`${TAG} cloudflared exited with code ${code} before producing a URL`));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async stop() {
|
|
103
|
+
this.killProcess();
|
|
104
|
+
this.publicUrl = null;
|
|
105
|
+
}
|
|
106
|
+
getPublicUrl() {
|
|
107
|
+
return this.publicUrl;
|
|
108
|
+
}
|
|
109
|
+
onUrlChange(handler) {
|
|
110
|
+
this.urlChangeHandlers.push(handler);
|
|
111
|
+
}
|
|
112
|
+
isRunning() {
|
|
113
|
+
return this.process !== null && this.publicUrl !== null;
|
|
114
|
+
}
|
|
115
|
+
killProcess() {
|
|
116
|
+
if (this.process) {
|
|
117
|
+
const child = this.process;
|
|
118
|
+
this.process = null;
|
|
119
|
+
try {
|
|
120
|
+
// On Windows, tree-kill is needed for child processes.
|
|
121
|
+
// cloudflared is well-behaved and exits on SIGTERM.
|
|
122
|
+
if (!child.killed) {
|
|
123
|
+
child.kill('SIGTERM');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
// Process already exited
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
notifyUrlChange(newUrl) {
|
|
132
|
+
for (const handler of this.urlChangeHandlers) {
|
|
133
|
+
try {
|
|
134
|
+
const result = handler(newUrl);
|
|
135
|
+
if (result instanceof Promise) {
|
|
136
|
+
result.catch((err) => {
|
|
137
|
+
// eslint-disable-next-line no-console
|
|
138
|
+
console.warn(`${TAG} URL change handler failed:`, err);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
// eslint-disable-next-line no-console
|
|
144
|
+
console.warn(`${TAG} URL change handler threw:`, err);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Webhook Service
|
|
3
|
+
*
|
|
4
|
+
* Manages GitHub webhook registration and incoming event processing.
|
|
5
|
+
* Uses the GitHub CLI (`gh api`) for webhook CRUD operations.
|
|
6
|
+
*
|
|
7
|
+
* Webhook events supplement the existing PR sync polling:
|
|
8
|
+
* - Webhooks provide near-instant event delivery
|
|
9
|
+
* - Polling remains as a fallback for missed events
|
|
10
|
+
*
|
|
11
|
+
* Registered events: pull_request, check_suite, check_run
|
|
12
|
+
*/
|
|
13
|
+
import type { IWebhookService, WebhookEvent, WebhookValidationResult } from '../../../application/ports/output/services/webhook-service.interface.js';
|
|
14
|
+
import type { IFeatureRepository } from '../../../application/ports/output/repositories/feature-repository.interface.js';
|
|
15
|
+
import type { IGitPrService } from '../../../application/ports/output/services/git-pr-service.interface.js';
|
|
16
|
+
import type { INotificationService } from '../../../application/ports/output/services/notification-service.interface.js';
|
|
17
|
+
export type ExecFunction = (file: string, args: string[], options?: object) => Promise<{
|
|
18
|
+
stdout: string;
|
|
19
|
+
stderr: string;
|
|
20
|
+
}>;
|
|
21
|
+
export interface RegisteredWebhook {
|
|
22
|
+
repoFullName: string;
|
|
23
|
+
webhookId: number;
|
|
24
|
+
repositoryPath: string;
|
|
25
|
+
}
|
|
26
|
+
export type WebhookDeliveryStatus = 'success' | 'ignored' | 'error';
|
|
27
|
+
export interface WebhookDeliveryRecord {
|
|
28
|
+
deliveryId: string;
|
|
29
|
+
eventType: string;
|
|
30
|
+
source: string;
|
|
31
|
+
receivedAt: string;
|
|
32
|
+
status: WebhookDeliveryStatus;
|
|
33
|
+
statusMessage: string;
|
|
34
|
+
durationMs: number;
|
|
35
|
+
payload: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export declare class GitHubWebhookService implements IWebhookService {
|
|
38
|
+
private readonly featureRepo;
|
|
39
|
+
private readonly gitPrService;
|
|
40
|
+
private readonly notificationService;
|
|
41
|
+
private readonly execFn;
|
|
42
|
+
private readonly registeredWebhooks;
|
|
43
|
+
private readonly deliveryHistory;
|
|
44
|
+
private webhookSecret;
|
|
45
|
+
constructor(featureRepo: IFeatureRepository, gitPrService: IGitPrService, notificationService: INotificationService, execFn: ExecFunction);
|
|
46
|
+
/**
|
|
47
|
+
* Get the webhook secret for signature validation.
|
|
48
|
+
* Exposed so the API route can validate incoming requests.
|
|
49
|
+
*/
|
|
50
|
+
getSecret(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get the list of registered webhooks (for dashboard display).
|
|
53
|
+
*/
|
|
54
|
+
getRegisteredWebhooks(): readonly RegisteredWebhook[];
|
|
55
|
+
/**
|
|
56
|
+
* Get recent delivery history (newest first).
|
|
57
|
+
*/
|
|
58
|
+
getDeliveryHistory(): readonly WebhookDeliveryRecord[];
|
|
59
|
+
registerWebhooks(publicUrl: string): Promise<void>;
|
|
60
|
+
updateWebhookUrl(newUrl: string): Promise<void>;
|
|
61
|
+
removeWebhooks(): Promise<void>;
|
|
62
|
+
validateSignature(payload: string, signature: string, secret: string): WebhookValidationResult;
|
|
63
|
+
handleEvent(event: WebhookEvent): Promise<void>;
|
|
64
|
+
private recordDelivery;
|
|
65
|
+
private handlePullRequestEvent;
|
|
66
|
+
private handleCheckSuiteEvent;
|
|
67
|
+
private handleCheckRunEvent;
|
|
68
|
+
private findFeatureByPrOrBranch;
|
|
69
|
+
private findFeatureByBranch;
|
|
70
|
+
private updateFeaturePrStatus;
|
|
71
|
+
private updateFeatureCiStatus;
|
|
72
|
+
private registerWebhookForRepo;
|
|
73
|
+
private getRepoFullName;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=github-webhook.service.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/webhook/github-webhook.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-webhook.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/webhook/github-webhook.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,uBAAuB,EACxB,MAAM,yEAAyE,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8EAA8E,CAAC;AASzH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,MAAM,KACb,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,qBAAa,oBAAqB,YAAW,eAAe;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuB;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAC/D,OAAO,CAAC,aAAa,CAAS;gBAG5B,WAAW,EAAE,kBAAkB,EAC/B,YAAY,EAAE,aAAa,EAC3B,mBAAmB,EAAE,oBAAoB,EACzC,MAAM,EAAE,YAAY;IAStB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,qBAAqB,IAAI,SAAS,iBAAiB,EAAE;IAIrD;;OAEG;IACH,kBAAkB,IAAI,SAAS,qBAAqB,EAAE;IAIhD,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC/C,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BrC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,uBAAuB;IAgCxF,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CrD,OAAO,CAAC,cAAc;YAOR,sBAAsB;YAsBtB,qBAAqB;YAiBrB,mBAAmB;YAoBnB,uBAAuB;YAWvB,mBAAmB;YAKnB,qBAAqB;YA6CrB,qBAAqB;YA4BrB,sBAAsB;YAqDtB,eAAe;CAe9B"}
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub Webhook Service
|
|
3
|
+
*
|
|
4
|
+
* Manages GitHub webhook registration and incoming event processing.
|
|
5
|
+
* Uses the GitHub CLI (`gh api`) for webhook CRUD operations.
|
|
6
|
+
*
|
|
7
|
+
* Webhook events supplement the existing PR sync polling:
|
|
8
|
+
* - Webhooks provide near-instant event delivery
|
|
9
|
+
* - Polling remains as a fallback for missed events
|
|
10
|
+
*
|
|
11
|
+
* Registered events: pull_request, check_suite, check_run
|
|
12
|
+
*/
|
|
13
|
+
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
14
|
+
import { SdlcLifecycle, PrStatus, CiStatus } from '../../../domain/generated/output.js';
|
|
15
|
+
import { NotificationEventType, NotificationSeverity } from '../../../domain/generated/output.js';
|
|
16
|
+
const TAG = '[GitHubWebhook]';
|
|
17
|
+
const WEBHOOK_EVENTS = ['pull_request', 'check_suite', 'check_run'];
|
|
18
|
+
const MAX_EVENT_HISTORY = 200;
|
|
19
|
+
export class GitHubWebhookService {
|
|
20
|
+
featureRepo;
|
|
21
|
+
gitPrService;
|
|
22
|
+
notificationService;
|
|
23
|
+
execFn;
|
|
24
|
+
registeredWebhooks = [];
|
|
25
|
+
deliveryHistory = [];
|
|
26
|
+
webhookSecret;
|
|
27
|
+
constructor(featureRepo, gitPrService, notificationService, execFn) {
|
|
28
|
+
this.featureRepo = featureRepo;
|
|
29
|
+
this.gitPrService = gitPrService;
|
|
30
|
+
this.notificationService = notificationService;
|
|
31
|
+
this.execFn = execFn;
|
|
32
|
+
this.webhookSecret = randomBytes(32).toString('hex');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the webhook secret for signature validation.
|
|
36
|
+
* Exposed so the API route can validate incoming requests.
|
|
37
|
+
*/
|
|
38
|
+
getSecret() {
|
|
39
|
+
return this.webhookSecret;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the list of registered webhooks (for dashboard display).
|
|
43
|
+
*/
|
|
44
|
+
getRegisteredWebhooks() {
|
|
45
|
+
return this.registeredWebhooks;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get recent delivery history (newest first).
|
|
49
|
+
*/
|
|
50
|
+
getDeliveryHistory() {
|
|
51
|
+
return this.deliveryHistory;
|
|
52
|
+
}
|
|
53
|
+
async registerWebhooks(publicUrl) {
|
|
54
|
+
const webhookUrl = `${publicUrl}/api/webhooks/github`;
|
|
55
|
+
// Find all repos with features in Review lifecycle
|
|
56
|
+
const features = await this.featureRepo.list({ lifecycle: SdlcLifecycle.Review });
|
|
57
|
+
const repoPaths = new Set();
|
|
58
|
+
for (const feature of features) {
|
|
59
|
+
if (feature.repositoryPath) {
|
|
60
|
+
repoPaths.add(feature.repositoryPath);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
for (const repoPath of repoPaths) {
|
|
64
|
+
await this.registerWebhookForRepo(repoPath, webhookUrl);
|
|
65
|
+
}
|
|
66
|
+
// eslint-disable-next-line no-console
|
|
67
|
+
console.log(`${TAG} Registered webhooks for ${this.registeredWebhooks.length} repositories`);
|
|
68
|
+
}
|
|
69
|
+
async updateWebhookUrl(newUrl) {
|
|
70
|
+
const webhookUrl = `${newUrl}/api/webhooks/github`;
|
|
71
|
+
for (const webhook of this.registeredWebhooks) {
|
|
72
|
+
try {
|
|
73
|
+
await this.execFn('gh', [
|
|
74
|
+
'api',
|
|
75
|
+
'--method',
|
|
76
|
+
'PATCH',
|
|
77
|
+
`-H`,
|
|
78
|
+
'Accept: application/vnd.github+json',
|
|
79
|
+
`/repos/${webhook.repoFullName}/hooks/${webhook.webhookId}`,
|
|
80
|
+
'-f',
|
|
81
|
+
`config[url]=${webhookUrl}`,
|
|
82
|
+
'-f',
|
|
83
|
+
`config[content_type]=json`,
|
|
84
|
+
'-f',
|
|
85
|
+
`config[secret]=${this.webhookSecret}`,
|
|
86
|
+
], { cwd: webhook.repositoryPath });
|
|
87
|
+
// eslint-disable-next-line no-console
|
|
88
|
+
console.log(`${TAG} Updated webhook URL for ${webhook.repoFullName}`);
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
92
|
+
// eslint-disable-next-line no-console
|
|
93
|
+
console.warn(`${TAG} Failed to update webhook for ${webhook.repoFullName}: ${msg}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async removeWebhooks() {
|
|
98
|
+
for (const webhook of this.registeredWebhooks) {
|
|
99
|
+
try {
|
|
100
|
+
await this.execFn('gh', [
|
|
101
|
+
'api',
|
|
102
|
+
'--method',
|
|
103
|
+
'DELETE',
|
|
104
|
+
`-H`,
|
|
105
|
+
'Accept: application/vnd.github+json',
|
|
106
|
+
`/repos/${webhook.repoFullName}/hooks/${webhook.webhookId}`,
|
|
107
|
+
], { cwd: webhook.repositoryPath });
|
|
108
|
+
// eslint-disable-next-line no-console
|
|
109
|
+
console.log(`${TAG} Removed webhook for ${webhook.repoFullName}`);
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
113
|
+
// eslint-disable-next-line no-console
|
|
114
|
+
console.warn(`${TAG} Failed to remove webhook for ${webhook.repoFullName}: ${msg}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
this.registeredWebhooks.length = 0;
|
|
118
|
+
}
|
|
119
|
+
validateSignature(payload, signature, secret) {
|
|
120
|
+
if (!signature) {
|
|
121
|
+
return { valid: false, error: 'Missing signature header' };
|
|
122
|
+
}
|
|
123
|
+
const parts = signature.split('=');
|
|
124
|
+
if (parts.length !== 2 || parts[0] !== 'sha256') {
|
|
125
|
+
return { valid: false, error: 'Invalid signature format (expected sha256=...)' };
|
|
126
|
+
}
|
|
127
|
+
const expected = createHmac('sha256', secret).update(payload).digest('hex');
|
|
128
|
+
const actual = parts[1];
|
|
129
|
+
// Use timing-safe comparison to prevent timing attacks
|
|
130
|
+
try {
|
|
131
|
+
const expectedBuf = Buffer.from(expected, 'hex');
|
|
132
|
+
const actualBuf = Buffer.from(actual, 'hex');
|
|
133
|
+
if (expectedBuf.length !== actualBuf.length) {
|
|
134
|
+
return { valid: false, error: 'Signature length mismatch' };
|
|
135
|
+
}
|
|
136
|
+
if (!timingSafeEqual(expectedBuf, actualBuf)) {
|
|
137
|
+
return { valid: false, error: 'Signature mismatch' };
|
|
138
|
+
}
|
|
139
|
+
return { valid: true };
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
return { valid: false, error: 'Invalid signature encoding' };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async handleEvent(event) {
|
|
146
|
+
const startTime = Date.now();
|
|
147
|
+
// eslint-disable-next-line no-console
|
|
148
|
+
console.log(`${TAG} Received ${event.source}/${event.eventType} (delivery: ${event.deliveryId})`);
|
|
149
|
+
let status = 'success';
|
|
150
|
+
let statusMessage = 'Processed successfully';
|
|
151
|
+
try {
|
|
152
|
+
switch (event.eventType) {
|
|
153
|
+
case 'pull_request':
|
|
154
|
+
await this.handlePullRequestEvent(event.payload);
|
|
155
|
+
break;
|
|
156
|
+
case 'check_suite':
|
|
157
|
+
await this.handleCheckSuiteEvent(event.payload);
|
|
158
|
+
break;
|
|
159
|
+
case 'check_run':
|
|
160
|
+
await this.handleCheckRunEvent(event.payload);
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
status = 'ignored';
|
|
164
|
+
statusMessage = `Unhandled event type: ${event.eventType}`;
|
|
165
|
+
// eslint-disable-next-line no-console
|
|
166
|
+
console.log(`${TAG} Ignoring unhandled event type: ${event.eventType}`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
status = 'error';
|
|
171
|
+
statusMessage = error instanceof Error ? error.message : String(error);
|
|
172
|
+
}
|
|
173
|
+
this.recordDelivery({
|
|
174
|
+
deliveryId: event.deliveryId,
|
|
175
|
+
eventType: event.eventType,
|
|
176
|
+
source: event.source,
|
|
177
|
+
receivedAt: new Date().toISOString(),
|
|
178
|
+
status,
|
|
179
|
+
statusMessage,
|
|
180
|
+
durationMs: Date.now() - startTime,
|
|
181
|
+
payload: event.payload,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
recordDelivery(record) {
|
|
185
|
+
this.deliveryHistory.unshift(record);
|
|
186
|
+
if (this.deliveryHistory.length > MAX_EVENT_HISTORY) {
|
|
187
|
+
this.deliveryHistory.length = MAX_EVENT_HISTORY;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async handlePullRequestEvent(payload) {
|
|
191
|
+
const action = payload.action;
|
|
192
|
+
const pr = payload.pull_request;
|
|
193
|
+
if (!pr)
|
|
194
|
+
return;
|
|
195
|
+
const prNumber = pr.number;
|
|
196
|
+
const prUrl = pr.html_url ?? '';
|
|
197
|
+
const headBranch = pr.head?.ref;
|
|
198
|
+
// Find feature by PR number or branch
|
|
199
|
+
const feature = await this.findFeatureByPrOrBranch(prNumber, headBranch);
|
|
200
|
+
if (!feature)
|
|
201
|
+
return;
|
|
202
|
+
if (action === 'closed' && pr.merged === true) {
|
|
203
|
+
await this.updateFeaturePrStatus(feature, PrStatus.Merged, prNumber, prUrl);
|
|
204
|
+
}
|
|
205
|
+
else if (action === 'closed') {
|
|
206
|
+
await this.updateFeaturePrStatus(feature, PrStatus.Closed, prNumber, prUrl);
|
|
207
|
+
}
|
|
208
|
+
else if (action === 'reopened') {
|
|
209
|
+
await this.updateFeaturePrStatus(feature, PrStatus.Open, prNumber, prUrl);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async handleCheckSuiteEvent(payload) {
|
|
213
|
+
const action = payload.action;
|
|
214
|
+
if (action !== 'completed')
|
|
215
|
+
return;
|
|
216
|
+
const checkSuite = payload.check_suite;
|
|
217
|
+
if (!checkSuite)
|
|
218
|
+
return;
|
|
219
|
+
const conclusion = checkSuite.conclusion;
|
|
220
|
+
const headBranch = checkSuite.head_branch;
|
|
221
|
+
const feature = await this.findFeatureByBranch(headBranch);
|
|
222
|
+
if (!feature)
|
|
223
|
+
return;
|
|
224
|
+
const ciStatus = conclusion === 'success' ? CiStatus.Success : CiStatus.Failure;
|
|
225
|
+
await this.updateFeatureCiStatus(feature, ciStatus);
|
|
226
|
+
}
|
|
227
|
+
async handleCheckRunEvent(payload) {
|
|
228
|
+
const action = payload.action;
|
|
229
|
+
if (action !== 'completed')
|
|
230
|
+
return;
|
|
231
|
+
const checkRun = payload.check_run;
|
|
232
|
+
if (!checkRun)
|
|
233
|
+
return;
|
|
234
|
+
const conclusion = checkRun.conclusion;
|
|
235
|
+
const checkSuite = checkRun.check_suite;
|
|
236
|
+
const headBranch = checkSuite?.head_branch;
|
|
237
|
+
if (!headBranch)
|
|
238
|
+
return;
|
|
239
|
+
const feature = await this.findFeatureByBranch(headBranch);
|
|
240
|
+
if (!feature)
|
|
241
|
+
return;
|
|
242
|
+
const ciStatus = conclusion === 'success' ? CiStatus.Success : CiStatus.Failure;
|
|
243
|
+
await this.updateFeatureCiStatus(feature, ciStatus);
|
|
244
|
+
}
|
|
245
|
+
async findFeatureByPrOrBranch(prNumber, branch) {
|
|
246
|
+
const features = await this.featureRepo.list({ lifecycle: SdlcLifecycle.Review });
|
|
247
|
+
// Try matching by PR number first
|
|
248
|
+
const byPr = features.find((f) => f.pr?.number === prNumber);
|
|
249
|
+
if (byPr)
|
|
250
|
+
return byPr;
|
|
251
|
+
// Fall back to branch matching
|
|
252
|
+
return features.find((f) => f.branch === branch) ?? null;
|
|
253
|
+
}
|
|
254
|
+
async findFeatureByBranch(branch) {
|
|
255
|
+
const features = await this.featureRepo.list({ lifecycle: SdlcLifecycle.Review });
|
|
256
|
+
return features.find((f) => f.branch === branch) ?? null;
|
|
257
|
+
}
|
|
258
|
+
async updateFeaturePrStatus(feature, status, prNumber, prUrl) {
|
|
259
|
+
const oldStatus = feature.pr?.status;
|
|
260
|
+
if (oldStatus === status)
|
|
261
|
+
return;
|
|
262
|
+
feature.pr = { ...feature.pr, status, url: prUrl, number: prNumber };
|
|
263
|
+
if (status === PrStatus.Merged) {
|
|
264
|
+
feature.lifecycle = SdlcLifecycle.Maintain;
|
|
265
|
+
}
|
|
266
|
+
await this.featureRepo.update(feature);
|
|
267
|
+
// Emit notification
|
|
268
|
+
const eventType = status === PrStatus.Merged
|
|
269
|
+
? NotificationEventType.PrMerged
|
|
270
|
+
: status === PrStatus.Closed
|
|
271
|
+
? NotificationEventType.PrClosed
|
|
272
|
+
: NotificationEventType.PrChecksPassed; // reopened
|
|
273
|
+
const severity = status === PrStatus.Merged
|
|
274
|
+
? NotificationSeverity.Success
|
|
275
|
+
: status === PrStatus.Closed
|
|
276
|
+
? NotificationSeverity.Warning
|
|
277
|
+
: NotificationSeverity.Info;
|
|
278
|
+
const event = {
|
|
279
|
+
eventType,
|
|
280
|
+
featureId: feature.id,
|
|
281
|
+
agentRunId: feature.agentRunId ?? '',
|
|
282
|
+
featureName: feature.name,
|
|
283
|
+
message: `PR #${prNumber} ${status.toLowerCase()} for ${feature.name} (via webhook)`,
|
|
284
|
+
severity,
|
|
285
|
+
timestamp: new Date().toISOString(),
|
|
286
|
+
};
|
|
287
|
+
this.notificationService.notify(event);
|
|
288
|
+
}
|
|
289
|
+
async updateFeatureCiStatus(feature, ciStatus) {
|
|
290
|
+
if (!feature.pr)
|
|
291
|
+
return;
|
|
292
|
+
if (feature.pr.ciStatus === ciStatus)
|
|
293
|
+
return;
|
|
294
|
+
feature.pr = { ...feature.pr, ciStatus };
|
|
295
|
+
await this.featureRepo.update(feature);
|
|
296
|
+
const eventType = ciStatus === CiStatus.Success
|
|
297
|
+
? NotificationEventType.PrChecksPassed
|
|
298
|
+
: NotificationEventType.PrChecksFailed;
|
|
299
|
+
const severity = ciStatus === CiStatus.Success ? NotificationSeverity.Success : NotificationSeverity.Error;
|
|
300
|
+
const event = {
|
|
301
|
+
eventType,
|
|
302
|
+
featureId: feature.id,
|
|
303
|
+
agentRunId: feature.agentRunId ?? '',
|
|
304
|
+
featureName: feature.name,
|
|
305
|
+
message: `CI ${ciStatus === CiStatus.Success ? 'passed' : 'failed'} for ${feature.name} (via webhook)`,
|
|
306
|
+
severity,
|
|
307
|
+
timestamp: new Date().toISOString(),
|
|
308
|
+
};
|
|
309
|
+
this.notificationService.notify(event);
|
|
310
|
+
}
|
|
311
|
+
async registerWebhookForRepo(repoPath, webhookUrl) {
|
|
312
|
+
try {
|
|
313
|
+
// Get the repo full name (owner/repo) from the remote URL
|
|
314
|
+
const repoFullName = await this.getRepoFullName(repoPath);
|
|
315
|
+
if (!repoFullName) {
|
|
316
|
+
// eslint-disable-next-line no-console
|
|
317
|
+
console.warn(`${TAG} Could not determine repo name for ${repoPath}`);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
// Create webhook via GitHub API
|
|
321
|
+
const { stdout } = await this.execFn('gh', [
|
|
322
|
+
'api',
|
|
323
|
+
'--method',
|
|
324
|
+
'POST',
|
|
325
|
+
`-H`,
|
|
326
|
+
'Accept: application/vnd.github+json',
|
|
327
|
+
`/repos/${repoFullName}/hooks`,
|
|
328
|
+
'-f',
|
|
329
|
+
'name=web',
|
|
330
|
+
'-f',
|
|
331
|
+
`config[url]=${webhookUrl}`,
|
|
332
|
+
'-f',
|
|
333
|
+
'config[content_type]=json',
|
|
334
|
+
'-f',
|
|
335
|
+
`config[secret]=${this.webhookSecret}`,
|
|
336
|
+
...WEBHOOK_EVENTS.flatMap((e) => ['-f', `events[]=${e}`]),
|
|
337
|
+
'-f',
|
|
338
|
+
'active=true',
|
|
339
|
+
], { cwd: repoPath });
|
|
340
|
+
const response = JSON.parse(stdout);
|
|
341
|
+
const webhookId = response.id;
|
|
342
|
+
this.registeredWebhooks.push({
|
|
343
|
+
repoFullName,
|
|
344
|
+
webhookId,
|
|
345
|
+
repositoryPath: repoPath,
|
|
346
|
+
});
|
|
347
|
+
// eslint-disable-next-line no-console
|
|
348
|
+
console.log(`${TAG} Registered webhook #${webhookId} for ${repoFullName}`);
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
352
|
+
// eslint-disable-next-line no-console
|
|
353
|
+
console.warn(`${TAG} Failed to register webhook for ${repoPath}: ${msg}`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
async getRepoFullName(repoPath) {
|
|
357
|
+
try {
|
|
358
|
+
const remoteUrl = await this.gitPrService.getRemoteUrl(repoPath);
|
|
359
|
+
if (!remoteUrl)
|
|
360
|
+
return null;
|
|
361
|
+
// Parse owner/repo from URL
|
|
362
|
+
// Handles both https://github.com/owner/repo and git@github.com:owner/repo.git
|
|
363
|
+
const match = remoteUrl.match(/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?$/);
|
|
364
|
+
if (!match)
|
|
365
|
+
return null;
|
|
366
|
+
return `${match[1]}/${match[2]}`;
|
|
367
|
+
}
|
|
368
|
+
catch {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Manager Service
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates the Cloudflare Tunnel and GitHub Webhook lifecycle.
|
|
5
|
+
* Follows the singleton pattern used by NotificationWatcherService
|
|
6
|
+
* and PrSyncWatcherService.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle:
|
|
9
|
+
* 1. Start Cloudflare Tunnel to get a public URL
|
|
10
|
+
* 2. Register GitHub webhooks pointing to the tunnel URL
|
|
11
|
+
* 3. Monitor for tunnel URL changes → update webhooks
|
|
12
|
+
* 4. On shutdown → remove webhooks → stop tunnel
|
|
13
|
+
*
|
|
14
|
+
* The manager is optional — if cloudflared is not installed or webhook
|
|
15
|
+
* registration fails, the system falls back to polling gracefully.
|
|
16
|
+
*/
|
|
17
|
+
import type { ITunnelService } from '../../../application/ports/output/services/tunnel-service.interface.js';
|
|
18
|
+
import type { IWebhookService } from '../../../application/ports/output/services/webhook-service.interface.js';
|
|
19
|
+
import type { RegisteredWebhook, WebhookDeliveryRecord } from './github-webhook.service.js';
|
|
20
|
+
export interface WebhookSystemStatus {
|
|
21
|
+
running: boolean;
|
|
22
|
+
tunnel: {
|
|
23
|
+
connected: boolean;
|
|
24
|
+
publicUrl: string | null;
|
|
25
|
+
};
|
|
26
|
+
webhooks: {
|
|
27
|
+
registered: readonly RegisteredWebhook[];
|
|
28
|
+
totalDeliveries: number;
|
|
29
|
+
successCount: number;
|
|
30
|
+
errorCount: number;
|
|
31
|
+
ignoredCount: number;
|
|
32
|
+
};
|
|
33
|
+
startedAt: string | null;
|
|
34
|
+
}
|
|
35
|
+
export declare class WebhookManagerService {
|
|
36
|
+
private readonly tunnelService;
|
|
37
|
+
private readonly webhookService;
|
|
38
|
+
private running;
|
|
39
|
+
private startedAt;
|
|
40
|
+
constructor(tunnelService: ITunnelService, webhookService: IWebhookService);
|
|
41
|
+
/**
|
|
42
|
+
* Start the tunnel and register webhooks.
|
|
43
|
+
* Fails gracefully — logs warnings but does not throw.
|
|
44
|
+
*
|
|
45
|
+
* @param localPort - The local web server port to tunnel
|
|
46
|
+
*/
|
|
47
|
+
start(localPort: number): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Stop the webhook system — remove webhooks, then stop the tunnel.
|
|
50
|
+
*/
|
|
51
|
+
stop(): Promise<void>;
|
|
52
|
+
isRunning(): boolean;
|
|
53
|
+
getTunnelUrl(): string | null;
|
|
54
|
+
getStatus(): WebhookSystemStatus;
|
|
55
|
+
getDeliveryHistory(): readonly WebhookDeliveryRecord[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Initialize the webhook manager singleton.
|
|
59
|
+
* Must be called once during web server startup.
|
|
60
|
+
*
|
|
61
|
+
* @throws Error if the manager is already initialized
|
|
62
|
+
*/
|
|
63
|
+
export declare function initializeWebhookManager(tunnelService: ITunnelService, webhookService: IWebhookService): void;
|
|
64
|
+
/**
|
|
65
|
+
* Get the webhook manager singleton.
|
|
66
|
+
*
|
|
67
|
+
* @returns The webhook manager service
|
|
68
|
+
* @throws Error if the manager hasn't been initialized yet
|
|
69
|
+
*/
|
|
70
|
+
export declare function getWebhookManager(): WebhookManagerService;
|
|
71
|
+
/**
|
|
72
|
+
* Check if the webhook manager has been initialized.
|
|
73
|
+
*/
|
|
74
|
+
export declare function hasWebhookManager(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Reset the webhook manager singleton (for testing purposes only).
|
|
77
|
+
* Stops the manager if running before resetting.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare function resetWebhookManager(): void;
|
|
82
|
+
//# sourceMappingURL=webhook-manager.service.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/webhook/webhook-manager.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-manager.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/webhook/webhook-manager.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wEAAwE,CAAC;AAC7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAC;AAC/G,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EAEtB,MAAM,6BAA6B,CAAC;AAErC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE;QACN,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE;QACR,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;QACzC,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAID,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAuB;gBAE5B,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe;IAK1E;;;;;OAKG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C7C;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA2B3B,SAAS,IAAI,OAAO;IAIpB,YAAY,IAAI,MAAM,GAAG,IAAI;IAI7B,SAAS,IAAI,mBAAmB;IAoChC,kBAAkB,IAAI,SAAS,qBAAqB,EAAE;CAOvD;AAMD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,eAAe,GAC9B,IAAI,CAMN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,qBAAqB,CAQzD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAK1C"}
|