agent-relay 1.1.0 → 1.2.3
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/.gitattributes +3 -0
- package/.nvmrc +1 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.json +65 -0
- package/.trajectories/completed/2026-01/traj_1dviorhnkcb5.md +37 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.json +65 -0
- package/.trajectories/completed/2026-01/traj_1k5if5snst2e.md +37 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.json +49 -0
- package/.trajectories/completed/2026-01/traj_1rp3rges5811.md +31 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.json +113 -0
- package/.trajectories/completed/2026-01/traj_22bhyulruouw.md +57 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.json +53 -0
- package/.trajectories/completed/2026-01/traj_2dao7ddgnta0.md +32 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.json +26 -0
- package/.trajectories/completed/2026-01/traj_3t0440mjeunc.md +6 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.json +47 -0
- package/.trajectories/completed/2026-01/traj_45x9494d9xnr.md +32 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.json +53 -0
- package/.trajectories/completed/2026-01/traj_4aa0bb77s4nh.md +32 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.json +59 -0
- package/.trajectories/completed/2026-01/traj_5lhmzq8rxpqv.md +33 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.json +53 -0
- package/.trajectories/completed/2026-01/traj_5vr4e9erb1fs.md +32 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.json +48 -0
- package/.trajectories/completed/2026-01/traj_6fgiwdoklvym.md +24 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.json +209 -0
- package/.trajectories/completed/2026-01/traj_7ludwvz45veh.md +97 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.json +48 -0
- package/.trajectories/completed/2026-01/traj_9921cuhel0pj.md +24 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.json +49 -0
- package/.trajectories/completed/2026-01/traj_ajs7zqfux4wc.md +23 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.json +53 -0
- package/.trajectories/completed/2026-01/traj_cvtqhlwcq9s0.md +32 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.json +49 -0
- package/.trajectories/completed/2026-01/traj_cxofprm2m2en.md +31 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.json +26 -0
- package/.trajectories/completed/2026-01/traj_d2hhz3k0vrhn.md +6 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.json +59 -0
- package/.trajectories/completed/2026-01/traj_dfuvww9pege5.md +37 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.json +77 -0
- package/.trajectories/completed/2026-01/traj_g0fisy9h51mf.md +42 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.json +53 -0
- package/.trajectories/completed/2026-01/traj_gjdre5voouod.md +32 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.json +25 -0
- package/.trajectories/completed/2026-01/traj_gtlyqtta3x8l.md +15 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.json +101 -0
- package/.trajectories/completed/2026-01/traj_h4xijiuip3w4.md +44 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.json +22 -0
- package/.trajectories/completed/2026-01/traj_hhxte7w4gjjx.md +5 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.json +53 -0
- package/.trajectories/completed/2026-01/traj_hpungyhoj6v5.md +32 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.json +25 -0
- package/.trajectories/completed/2026-01/traj_m2xkjv0w2sq7.md +15 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.json +53 -0
- package/.trajectories/completed/2026-01/traj_noq5zbvnrdvz.md +32 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.json +53 -0
- package/.trajectories/completed/2026-01/traj_ntbs6ppopf46.md +32 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.json +48 -0
- package/.trajectories/completed/2026-01/traj_ozd98si6a7ns.md +24 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.json +53 -0
- package/.trajectories/completed/2026-01/traj_prdza7a5cxp5.md +32 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.json +77 -0
- package/.trajectories/completed/2026-01/traj_qb3twvvywfwi.md +42 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.json +53 -0
- package/.trajectories/completed/2026-01/traj_qft54mi7nfor.md +32 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.json +83 -0
- package/.trajectories/completed/2026-01/traj_qx9uhf8whhxo.md +47 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.json +59 -0
- package/.trajectories/completed/2026-01/traj_rd9toccj18a0.md +37 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.json +48 -0
- package/.trajectories/completed/2026-01/traj_rt4fiw3ecp50.md +16 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.json +59 -0
- package/.trajectories/completed/2026-01/traj_st8j35b0hrlc.md +37 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.json +53 -0
- package/.trajectories/completed/2026-01/traj_t1yy8m7hbuxp.md +32 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.json +84 -0
- package/.trajectories/completed/2026-01/traj_tmux_orchestrator_analysis.md +109 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.json +53 -0
- package/.trajectories/completed/2026-01/traj_u9n9eqasw16k.md +32 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.json +71 -0
- package/.trajectories/completed/2026-01/traj_v87hypnongqx.md +42 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.json +53 -0
- package/.trajectories/completed/2026-01/traj_wkp2fgzdyinb.md +32 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.json +20 -0
- package/.trajectories/completed/2026-01/traj_x14t8w8rn7xg.md +6 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.json +175 -0
- package/.trajectories/completed/2026-01/traj_xnwbznkvv8ua.md +82 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.json +47 -0
- package/.trajectories/completed/2026-01/traj_ysjc8zaeqtd3.md +32 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.json +59 -0
- package/.trajectories/completed/2026-01/traj_yvdadtvdgnz3.md +37 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.json +53 -0
- package/.trajectories/completed/2026-01/traj_z0vcw1wrzide.md +32 -0
- package/.trajectories/index.json +314 -0
- package/ARCHITECTURE.md +1245 -0
- package/README.md +1 -1
- package/TESTING.md +278 -0
- package/deploy/init-db.sql +5 -0
- package/deploy/scripts/setup-fly-workspaces.sh +69 -0
- package/deploy/scripts/setup-railway.sh +75 -0
- package/deploy/workspace/entrypoint-browser.sh +118 -0
- package/deploy/workspace/entrypoint.sh +348 -0
- package/deploy/workspace/git-credential-relay +111 -0
- package/dist/bridge/spawner.d.ts +53 -0
- package/dist/bridge/spawner.js +203 -19
- package/dist/bridge/types.d.ts +12 -0
- package/dist/cli/index.js +618 -5
- package/dist/cloud/api/auth.d.ts +3 -2
- package/dist/cloud/api/auth.js +10 -98
- package/dist/cloud/api/billing.js +30 -9
- package/dist/cloud/api/cli-pty-runner.d.ts +54 -0
- package/dist/cloud/api/cli-pty-runner.js +119 -0
- package/dist/cloud/api/codex-auth-helper.d.ts +15 -0
- package/dist/cloud/api/codex-auth-helper.js +100 -0
- package/dist/cloud/api/generic-webhooks.d.ts +8 -0
- package/dist/cloud/api/generic-webhooks.js +129 -0
- package/dist/cloud/api/git.d.ts +8 -0
- package/dist/cloud/api/git.js +152 -0
- package/dist/cloud/api/github-app.d.ts +11 -0
- package/dist/cloud/api/github-app.js +189 -0
- package/dist/cloud/api/middleware/planLimits.d.ts +7 -0
- package/dist/cloud/api/middleware/planLimits.js +39 -1
- package/dist/cloud/api/monitoring.d.ts +11 -0
- package/dist/cloud/api/monitoring.js +578 -0
- package/dist/cloud/api/nango-auth.d.ts +9 -0
- package/dist/cloud/api/nango-auth.js +377 -0
- package/dist/cloud/api/onboarding.d.ts +8 -1
- package/dist/cloud/api/onboarding.js +313 -119
- package/dist/cloud/api/policy.d.ts +8 -0
- package/dist/cloud/api/policy.js +229 -0
- package/dist/cloud/api/providers.js +114 -42
- package/dist/cloud/api/repos.d.ts +1 -0
- package/dist/cloud/api/repos.js +186 -0
- package/dist/cloud/api/test-helpers.d.ts +10 -0
- package/dist/cloud/api/test-helpers.js +575 -0
- package/dist/cloud/api/webhooks.d.ts +8 -0
- package/dist/cloud/api/webhooks.js +645 -0
- package/dist/cloud/api/workspaces.js +320 -12
- package/dist/cloud/billing/plans.js +32 -19
- package/dist/cloud/billing/types.d.ts +9 -3
- package/dist/cloud/config.d.ts +9 -2
- package/dist/cloud/config.js +13 -4
- package/dist/cloud/db/drizzle.d.ts +84 -1
- package/dist/cloud/db/drizzle.js +470 -0
- package/dist/cloud/db/index.d.ts +9 -4
- package/dist/cloud/db/index.js +11 -3
- package/dist/cloud/db/schema.d.ts +3283 -556
- package/dist/cloud/db/schema.js +314 -1
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/provisioner/index.d.ts +56 -0
- package/dist/cloud/provisioner/index.js +676 -34
- package/dist/cloud/server.d.ts +1 -0
- package/dist/cloud/server.js +362 -13
- package/dist/cloud/services/auto-scaler.d.ts +152 -0
- package/dist/cloud/services/auto-scaler.js +439 -0
- package/dist/cloud/services/capacity-manager.d.ts +148 -0
- package/dist/cloud/services/capacity-manager.js +449 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts +49 -0
- package/dist/cloud/services/ci-agent-spawner.js +373 -0
- package/dist/cloud/services/index.d.ts +12 -0
- package/dist/cloud/services/index.js +15 -0
- package/dist/cloud/services/mention-handler.d.ts +65 -0
- package/dist/cloud/services/mention-handler.js +405 -0
- package/dist/cloud/services/nango.d.ts +186 -0
- package/dist/cloud/services/nango.js +344 -0
- package/dist/cloud/services/persistence.d.ts +131 -0
- package/dist/cloud/services/persistence.js +200 -0
- package/dist/cloud/services/planLimits.d.ts +37 -0
- package/dist/cloud/services/planLimits.js +86 -5
- package/dist/cloud/services/scaling-orchestrator.d.ts +159 -0
- package/dist/cloud/services/scaling-orchestrator.js +502 -0
- package/dist/cloud/services/scaling-policy.d.ts +121 -0
- package/dist/cloud/services/scaling-policy.js +415 -0
- package/dist/cloud/vault/index.js +1 -1
- package/dist/cloud/webhooks/index.d.ts +24 -0
- package/dist/cloud/webhooks/index.js +29 -0
- package/dist/cloud/webhooks/parsers/github.d.ts +8 -0
- package/dist/cloud/webhooks/parsers/github.js +234 -0
- package/dist/cloud/webhooks/parsers/index.d.ts +23 -0
- package/dist/cloud/webhooks/parsers/index.js +30 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/linear.js +258 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/slack.js +214 -0
- package/dist/cloud/webhooks/responders/github.d.ts +8 -0
- package/dist/cloud/webhooks/responders/github.js +73 -0
- package/dist/cloud/webhooks/responders/index.d.ts +23 -0
- package/dist/cloud/webhooks/responders/index.js +30 -0
- package/dist/cloud/webhooks/responders/linear.d.ts +9 -0
- package/dist/cloud/webhooks/responders/linear.js +149 -0
- package/dist/cloud/webhooks/responders/slack.d.ts +20 -0
- package/dist/cloud/webhooks/responders/slack.js +178 -0
- package/dist/cloud/webhooks/router.d.ts +25 -0
- package/dist/cloud/webhooks/router.js +504 -0
- package/dist/cloud/webhooks/rules-engine.d.ts +24 -0
- package/dist/cloud/webhooks/rules-engine.js +287 -0
- package/dist/cloud/webhooks/types.d.ts +186 -0
- package/dist/cloud/webhooks/types.js +8 -0
- package/dist/continuity/formatter.d.ts +51 -0
- package/dist/continuity/formatter.js +313 -0
- package/dist/continuity/handoff-store.d.ts +67 -0
- package/dist/continuity/handoff-store.js +472 -0
- package/dist/continuity/index.d.ts +45 -0
- package/dist/continuity/index.js +48 -0
- package/dist/continuity/ledger-store.d.ts +110 -0
- package/dist/continuity/ledger-store.js +500 -0
- package/dist/continuity/manager.d.ts +178 -0
- package/dist/continuity/manager.js +562 -0
- package/dist/continuity/parser.d.ts +76 -0
- package/dist/continuity/parser.js +579 -0
- package/dist/continuity/types.d.ts +180 -0
- package/dist/continuity/types.js +9 -0
- package/dist/daemon/agent-manager.d.ts +27 -0
- package/dist/daemon/agent-manager.js +107 -6
- package/dist/daemon/agent-registry.d.ts +32 -0
- package/dist/daemon/agent-registry.js +42 -2
- package/dist/daemon/api.d.ts +12 -0
- package/dist/daemon/api.js +131 -2
- package/dist/daemon/cli-auth.d.ts +67 -0
- package/dist/daemon/cli-auth.js +537 -0
- package/dist/daemon/cloud-sync.js +9 -7
- package/dist/daemon/orchestrator.js +30 -0
- package/dist/daemon/router.d.ts +5 -0
- package/dist/daemon/router.js +78 -26
- package/dist/daemon/server.d.ts +5 -0
- package/dist/daemon/server.js +9 -1
- package/dist/daemon/services/browser-testing.d.ts +88 -0
- package/dist/daemon/services/browser-testing.js +244 -0
- package/dist/daemon/services/container-spawner.d.ts +135 -0
- package/dist/daemon/services/container-spawner.js +313 -0
- package/dist/daemon/types.d.ts +5 -1
- package/dist/dashboard/out/404.html +1 -1
- package/dist/dashboard/out/_next/static/chunks/116-2502180def231162.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/699-3b1cd6618a45d259.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/724-2dae7627550ab88f.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/766-1f2dd8cb7f766b0b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-3fdfa60e53f2810d.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e6381e5a6e1fbcfd.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-3538dfe0ffe984b8.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/{page-b6edd4dde8d08194.js → page-abb9ab2d329f56e9.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-c0d118c0f92d969c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/login/page-c22d080201cbd9fb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-67a3e98d9a43a6ed.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-77e9c65420a06cfb.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-b08ed1c34d14434a.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-e88bc117ef7671c3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-68d34f50baa8ab6b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/{main-app-5d692157a8eb1fd9.js → main-app-6e8e8d3ef4e0192a.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/{main-c2f423b9c9f4591b.js → main-ed4e1fb6f29c34cf.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +1 -0
- package/dist/dashboard/out/_next/static/css/29852f26181969a0.css +1 -0
- package/dist/dashboard/out/_next/static/css/7c3ae9e8617d42a5.css +1 -0
- package/dist/dashboard/out/app/onboarding.html +1 -0
- package/dist/dashboard/out/app/onboarding.txt +7 -0
- package/dist/dashboard/out/app.html +1 -14
- package/dist/dashboard/out/app.txt +2 -2
- package/dist/dashboard/out/connect-repos.html +1 -0
- package/dist/dashboard/out/connect-repos.txt +7 -0
- package/dist/dashboard/out/history.html +1 -1
- package/dist/dashboard/out/history.txt +2 -2
- package/dist/dashboard/out/index.html +1 -1
- package/dist/dashboard/out/index.txt +2 -2
- package/dist/dashboard/out/login.html +6 -0
- package/dist/dashboard/out/login.txt +7 -0
- package/dist/dashboard/out/metrics.html +1 -1
- package/dist/dashboard/out/metrics.txt +2 -2
- package/dist/dashboard/out/pricing.html +3 -3
- package/dist/dashboard/out/pricing.txt +2 -2
- package/dist/dashboard/out/providers.html +1 -0
- package/dist/dashboard/out/providers.txt +7 -0
- package/dist/dashboard/out/signup.html +6 -0
- package/dist/dashboard/out/signup.txt +7 -0
- package/dist/dashboard-server/server.js +1308 -8
- package/dist/hooks/emitter.d.ts +40 -0
- package/dist/hooks/emitter.js +63 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/registry.d.ts +173 -0
- package/dist/hooks/registry.js +476 -0
- package/dist/hooks/trajectory-hooks.d.ts +52 -0
- package/dist/hooks/trajectory-hooks.js +183 -0
- package/dist/hooks/types.d.ts +141 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/memory/adapters/index.d.ts +8 -0
- package/dist/memory/adapters/index.js +8 -0
- package/dist/memory/adapters/inmemory.d.ts +59 -0
- package/dist/memory/adapters/inmemory.js +195 -0
- package/dist/memory/adapters/supermemory.d.ts +71 -0
- package/dist/memory/adapters/supermemory.js +338 -0
- package/dist/memory/factory.d.ts +48 -0
- package/dist/memory/factory.js +143 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.js +32 -0
- package/dist/memory/memory-hooks.d.ts +60 -0
- package/dist/memory/memory-hooks.js +313 -0
- package/dist/memory/service.d.ts +49 -0
- package/dist/memory/service.js +146 -0
- package/dist/memory/types.d.ts +195 -0
- package/dist/memory/types.js +8 -0
- package/dist/policy/agent-policy.d.ts +225 -0
- package/dist/policy/agent-policy.js +665 -0
- package/dist/policy/cloud-policy-fetcher.d.ts +12 -0
- package/dist/policy/cloud-policy-fetcher.js +64 -0
- package/dist/resiliency/crash-insights.d.ts +156 -0
- package/dist/resiliency/crash-insights.js +492 -0
- package/dist/resiliency/gossip-health.d.ts +137 -0
- package/dist/resiliency/gossip-health.js +241 -0
- package/dist/resiliency/index.d.ts +5 -0
- package/dist/resiliency/index.js +5 -0
- package/dist/resiliency/leader-watchdog.d.ts +109 -0
- package/dist/resiliency/leader-watchdog.js +189 -0
- package/dist/resiliency/memory-monitor.d.ts +172 -0
- package/dist/resiliency/memory-monitor.js +593 -0
- package/dist/resiliency/stateless-lead.d.ts +149 -0
- package/dist/resiliency/stateless-lead.js +308 -0
- package/dist/resiliency/supervisor.d.ts +38 -0
- package/dist/resiliency/supervisor.js +122 -0
- package/dist/shared/cli-auth-config.d.ts +91 -0
- package/dist/shared/cli-auth-config.js +264 -0
- package/dist/storage/adapter.d.ts +1 -1
- package/dist/trajectory/config.d.ts +84 -0
- package/dist/trajectory/config.js +163 -0
- package/dist/trajectory/index.d.ts +8 -0
- package/dist/trajectory/index.js +8 -0
- package/dist/trajectory/integration.d.ts +292 -0
- package/dist/trajectory/integration.js +834 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/project-namespace.d.ts +24 -0
- package/dist/utils/project-namespace.js +84 -0
- package/dist/wrapper/parser.d.ts +10 -0
- package/dist/wrapper/parser.js +100 -33
- package/dist/wrapper/pty-wrapper.d.ts +197 -16
- package/dist/wrapper/pty-wrapper.js +943 -106
- package/dist/wrapper/shared.d.ts +165 -0
- package/dist/wrapper/shared.js +270 -0
- package/dist/wrapper/tmux-wrapper.d.ts +73 -11
- package/dist/wrapper/tmux-wrapper.js +541 -120
- package/package.json +16 -16
- package/scripts/postinstall.js +60 -0
- package/test-push.txt +1 -0
- package/bin/tmux +0 -0
- package/dist/bridge/config.d.ts.map +0 -1
- package/dist/bridge/config.js.map +0 -1
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/index.js.map +0 -1
- package/dist/bridge/multi-project-client.d.ts.map +0 -1
- package/dist/bridge/multi-project-client.js.map +0 -1
- package/dist/bridge/shadow-cli.d.ts.map +0 -1
- package/dist/bridge/shadow-cli.js.map +0 -1
- package/dist/bridge/shadow-config.d.ts.map +0 -1
- package/dist/bridge/shadow-config.js.map +0 -1
- package/dist/bridge/spawner.d.ts.map +0 -1
- package/dist/bridge/spawner.js.map +0 -1
- package/dist/bridge/teams-config.d.ts.map +0 -1
- package/dist/bridge/teams-config.js.map +0 -1
- package/dist/bridge/types.d.ts.map +0 -1
- package/dist/bridge/types.js.map +0 -1
- package/dist/bridge/utils.d.ts.map +0 -1
- package/dist/bridge/utils.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/cloud/api/auth.d.ts.map +0 -1
- package/dist/cloud/api/auth.js.map +0 -1
- package/dist/cloud/api/billing.d.ts.map +0 -1
- package/dist/cloud/api/billing.js.map +0 -1
- package/dist/cloud/api/coordinators.d.ts.map +0 -1
- package/dist/cloud/api/coordinators.js.map +0 -1
- package/dist/cloud/api/daemons.d.ts.map +0 -1
- package/dist/cloud/api/daemons.js.map +0 -1
- package/dist/cloud/api/middleware/planLimits.d.ts.map +0 -1
- package/dist/cloud/api/middleware/planLimits.js.map +0 -1
- package/dist/cloud/api/onboarding.d.ts.map +0 -1
- package/dist/cloud/api/onboarding.js.map +0 -1
- package/dist/cloud/api/providers.d.ts.map +0 -1
- package/dist/cloud/api/providers.js.map +0 -1
- package/dist/cloud/api/repos.d.ts.map +0 -1
- package/dist/cloud/api/repos.js.map +0 -1
- package/dist/cloud/api/teams.d.ts.map +0 -1
- package/dist/cloud/api/teams.js.map +0 -1
- package/dist/cloud/api/usage.d.ts.map +0 -1
- package/dist/cloud/api/usage.js.map +0 -1
- package/dist/cloud/api/workspaces.d.ts.map +0 -1
- package/dist/cloud/api/workspaces.js.map +0 -1
- package/dist/cloud/billing/index.d.ts.map +0 -1
- package/dist/cloud/billing/index.js.map +0 -1
- package/dist/cloud/billing/plans.d.ts.map +0 -1
- package/dist/cloud/billing/plans.js.map +0 -1
- package/dist/cloud/billing/service.d.ts.map +0 -1
- package/dist/cloud/billing/service.js.map +0 -1
- package/dist/cloud/billing/types.d.ts.map +0 -1
- package/dist/cloud/billing/types.js.map +0 -1
- package/dist/cloud/config.d.ts.map +0 -1
- package/dist/cloud/config.js.map +0 -1
- package/dist/cloud/db/drizzle.d.ts.map +0 -1
- package/dist/cloud/db/drizzle.js.map +0 -1
- package/dist/cloud/db/index.d.ts.map +0 -1
- package/dist/cloud/db/index.js.map +0 -1
- package/dist/cloud/db/schema.d.ts.map +0 -1
- package/dist/cloud/db/schema.js.map +0 -1
- package/dist/cloud/index.d.ts.map +0 -1
- package/dist/cloud/index.js.map +0 -1
- package/dist/cloud/provisioner/index.d.ts.map +0 -1
- package/dist/cloud/provisioner/index.js.map +0 -1
- package/dist/cloud/server.d.ts.map +0 -1
- package/dist/cloud/server.js.map +0 -1
- package/dist/cloud/services/coordinator.d.ts.map +0 -1
- package/dist/cloud/services/coordinator.js.map +0 -1
- package/dist/cloud/services/planLimits.d.ts.map +0 -1
- package/dist/cloud/services/planLimits.js.map +0 -1
- package/dist/cloud/vault/index.d.ts.map +0 -1
- package/dist/cloud/vault/index.js.map +0 -1
- package/dist/daemon/agent-manager.d.ts.map +0 -1
- package/dist/daemon/agent-manager.js.map +0 -1
- package/dist/daemon/agent-registry.d.ts.map +0 -1
- package/dist/daemon/agent-registry.js.map +0 -1
- package/dist/daemon/api.d.ts.map +0 -1
- package/dist/daemon/api.js.map +0 -1
- package/dist/daemon/auth.d.ts.map +0 -1
- package/dist/daemon/auth.js.map +0 -1
- package/dist/daemon/cloud-sync.d.ts.map +0 -1
- package/dist/daemon/cloud-sync.js.map +0 -1
- package/dist/daemon/connection.d.ts.map +0 -1
- package/dist/daemon/connection.js.map +0 -1
- package/dist/daemon/index.d.ts.map +0 -1
- package/dist/daemon/index.js.map +0 -1
- package/dist/daemon/orchestrator.d.ts.map +0 -1
- package/dist/daemon/orchestrator.js.map +0 -1
- package/dist/daemon/registry.d.ts.map +0 -1
- package/dist/daemon/registry.js.map +0 -1
- package/dist/daemon/router.d.ts.map +0 -1
- package/dist/daemon/router.js.map +0 -1
- package/dist/daemon/server.d.ts.map +0 -1
- package/dist/daemon/server.js.map +0 -1
- package/dist/daemon/types.d.ts.map +0 -1
- package/dist/daemon/types.js.map +0 -1
- package/dist/daemon/workspace-manager.d.ts.map +0 -1
- package/dist/daemon/workspace-manager.js.map +0 -1
- package/dist/dashboard/out/_next/static/chunks/693-7b3301d8f6bc5014.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/713-f78477eb185f1f4d.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/766-e53e1cfe39b0b5b5.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/900-037c64bfd797fb2a.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/app/page-e3d9e1f4466b9bae.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/layout-2433bb48965f4333.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-e68825a81db67ba1.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/page-cc108bf68c8a657f.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/app/pricing/page-d80e03a5297f95b6.js +0 -1
- package/dist/dashboard/out/_next/static/chunks/webpack-a5acc2831d094776.js +0 -1
- package/dist/dashboard/out/_next/static/css/79b80143647a07d7.css +0 -1
- package/dist/dashboard/out/_next/static/css/8cf277370ad48cfe.css +0 -1
- package/dist/dashboard-server/metrics.d.ts.map +0 -1
- package/dist/dashboard-server/metrics.js.map +0 -1
- package/dist/dashboard-server/needs-attention.d.ts.map +0 -1
- package/dist/dashboard-server/needs-attention.js.map +0 -1
- package/dist/dashboard-server/server.d.ts.map +0 -1
- package/dist/dashboard-server/server.js.map +0 -1
- package/dist/dashboard-server/start.d.ts.map +0 -1
- package/dist/dashboard-server/start.js.map +0 -1
- package/dist/hooks/inbox-check/hook.d.ts.map +0 -1
- package/dist/hooks/inbox-check/hook.js.map +0 -1
- package/dist/hooks/inbox-check/index.d.ts.map +0 -1
- package/dist/hooks/inbox-check/index.js.map +0 -1
- package/dist/hooks/inbox-check/types.d.ts.map +0 -1
- package/dist/hooks/inbox-check/types.js.map +0 -1
- package/dist/hooks/inbox-check/utils.d.ts.map +0 -1
- package/dist/hooks/inbox-check/utils.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/types.d.ts.map +0 -1
- package/dist/hooks/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/protocol/framing.d.ts.map +0 -1
- package/dist/protocol/framing.js.map +0 -1
- package/dist/protocol/index.d.ts.map +0 -1
- package/dist/protocol/index.js.map +0 -1
- package/dist/protocol/types.d.ts.map +0 -1
- package/dist/protocol/types.js.map +0 -1
- package/dist/resiliency/context-persistence.d.ts.map +0 -1
- package/dist/resiliency/context-persistence.js.map +0 -1
- package/dist/resiliency/health-monitor.d.ts.map +0 -1
- package/dist/resiliency/health-monitor.js.map +0 -1
- package/dist/resiliency/index.d.ts.map +0 -1
- package/dist/resiliency/index.js.map +0 -1
- package/dist/resiliency/logger.d.ts.map +0 -1
- package/dist/resiliency/logger.js.map +0 -1
- package/dist/resiliency/metrics.d.ts.map +0 -1
- package/dist/resiliency/metrics.js.map +0 -1
- package/dist/resiliency/provider-context.d.ts.map +0 -1
- package/dist/resiliency/provider-context.js.map +0 -1
- package/dist/resiliency/supervisor.d.ts.map +0 -1
- package/dist/resiliency/supervisor.js.map +0 -1
- package/dist/state/agent-state.d.ts.map +0 -1
- package/dist/state/agent-state.js.map +0 -1
- package/dist/storage/adapter.d.ts.map +0 -1
- package/dist/storage/adapter.js.map +0 -1
- package/dist/storage/sqlite-adapter.d.ts.map +0 -1
- package/dist/storage/sqlite-adapter.js.map +0 -1
- package/dist/utils/agent-config.d.ts.map +0 -1
- package/dist/utils/agent-config.js.map +0 -1
- package/dist/utils/command-resolver.d.ts.map +0 -1
- package/dist/utils/command-resolver.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/name-generator.d.ts.map +0 -1
- package/dist/utils/name-generator.js.map +0 -1
- package/dist/utils/project-namespace.d.ts.map +0 -1
- package/dist/utils/project-namespace.js.map +0 -1
- package/dist/utils/tmux-resolver.d.ts.map +0 -1
- package/dist/utils/tmux-resolver.js.map +0 -1
- package/dist/utils/update-checker.d.ts.map +0 -1
- package/dist/utils/update-checker.js.map +0 -1
- package/dist/wrapper/client.d.ts.map +0 -1
- package/dist/wrapper/client.js.map +0 -1
- package/dist/wrapper/inbox.d.ts.map +0 -1
- package/dist/wrapper/inbox.js.map +0 -1
- package/dist/wrapper/index.d.ts.map +0 -1
- package/dist/wrapper/index.js.map +0 -1
- package/dist/wrapper/parser.d.ts.map +0 -1
- package/dist/wrapper/parser.js.map +0 -1
- package/dist/wrapper/pty-wrapper.d.ts.map +0 -1
- package/dist/wrapper/pty-wrapper.js.map +0 -1
- package/dist/wrapper/tmux-wrapper.d.ts.map +0 -1
- package/dist/wrapper/tmux-wrapper.js.map +0 -1
- package/docs/AGENTS.md +0 -513
- package/docs/ARCHITECTURE_DECISIONS.md +0 -175
- package/docs/CHANGELOG.md +0 -11
- package/docs/CLI-SIMPLIFICATION-COMPLETE.md +0 -48
- package/docs/CLOUD-ARCHITECTURE.md +0 -652
- package/docs/CLOUD-ONBOARDING-DESIGN.md +0 -1983
- package/docs/COMPETITIVE_ANALYSIS.md +0 -897
- package/docs/CONTRIBUTING.md +0 -151
- package/docs/DESIGN_BRIDGE_STAFFING.md +0 -878
- package/docs/DESIGN_V2.md +0 -1079
- package/docs/INTEGRATION-GUIDE.md +0 -926
- package/docs/MONETIZATION.md +0 -1679
- package/docs/PROPOSAL-trajectories.md +0 -1582
- package/docs/PROTOCOL.md +0 -325
- package/docs/SCALING_ANALYSIS.md +0 -280
- package/docs/TESTING_PRESENCE_FEATURES.md +0 -327
- package/docs/TMUX_IMPLEMENTATION_NOTES.md +0 -364
- package/docs/TMUX_IMPROVEMENTS.md +0 -968
- package/docs/agent-relay-snippet.md +0 -168
- package/docs/competitive-analysis-mcp-agent-mail.md +0 -389
- package/docs/dashboard-v2-plan.md +0 -179
- package/docs/guides/CLOUD.md +0 -236
- package/docs/guides/LOCAL.md +0 -535
- package/docs/guides/SELF-HOSTED.md +0 -494
- package/docs/proposals/shadow-as-subagent.md +0 -765
- package/docs/proposals/slack-bot-integration.md +0 -1457
- package/docs/removable-code-analysis.md +0 -24
- package/scripts/dev/PUBLIC_RELEASE_PLAN.md +0 -88
- package/scripts/dev/dev-team-setup.sh +0 -431
- package/scripts/e2e-test.sh +0 -119
- package/scripts/games/game-protocol.md +0 -79
- package/scripts/games/hearts-setup.sh +0 -264
- package/scripts/tictactoe-setup.sh +0 -181
- /package/dist/dashboard/out/_next/static/chunks/{117-b2cd8d6485aacf2b.js → 117-f7b8ab0809342e77.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{648-8f3f26864ce515e5.js → 648-5cc6e1921389a58a.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/_not-found/{page-0b990dbb71d72a98.js → page-53b8a69f76db17d0.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{fd9d1056-bf46c09eb57e019c.js → fd9d1056-609918ca7b6280bb.js} +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → wPgKJtcOmTFLpUncDg16A}/_ssgManifest.js +0 -0
package/dist/cloud/api/auth.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth API Routes
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Session management routes.
|
|
5
|
+
* User login is handled via Nango (see nango-auth.ts).
|
|
6
|
+
* GitHub repo operations are in github-app.ts.
|
|
5
7
|
*/
|
|
6
8
|
import { Request, Response } from 'express';
|
|
7
9
|
export declare const authRouter: import("express-serve-static-core").Router;
|
|
@@ -9,7 +11,6 @@ declare module 'express-session' {
|
|
|
9
11
|
interface SessionData {
|
|
10
12
|
userId?: string;
|
|
11
13
|
githubToken?: string;
|
|
12
|
-
oauthState?: string;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
/**
|
package/dist/cloud/api/auth.js
CHANGED
|
@@ -1,111 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth API Routes
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Session management routes.
|
|
5
|
+
* User login is handled via Nango (see nango-auth.ts).
|
|
6
|
+
* GitHub repo operations are in github-app.ts.
|
|
5
7
|
*/
|
|
6
8
|
import { Router } from 'express';
|
|
7
|
-
import crypto from 'crypto';
|
|
8
|
-
import { getConfig } from '../config.js';
|
|
9
9
|
import { db } from '../db/index.js';
|
|
10
10
|
export const authRouter = Router();
|
|
11
11
|
/**
|
|
12
12
|
* GET /api/auth/github
|
|
13
|
-
*
|
|
13
|
+
* Redirect to Nango login flow
|
|
14
|
+
* @deprecated Use /api/auth/nango/login-session instead
|
|
14
15
|
*/
|
|
15
|
-
authRouter.get('/github', (
|
|
16
|
-
|
|
17
|
-
const state = crypto.randomBytes(16).toString('hex');
|
|
18
|
-
// Store state in session for CSRF protection
|
|
19
|
-
req.session.oauthState = state;
|
|
20
|
-
const params = new URLSearchParams({
|
|
21
|
-
client_id: config.github.clientId,
|
|
22
|
-
redirect_uri: `${config.publicUrl}/api/auth/github/callback`,
|
|
23
|
-
scope: 'read:user user:email repo',
|
|
24
|
-
state,
|
|
25
|
-
});
|
|
26
|
-
res.redirect(`https://github.com/login/oauth/authorize?${params}`);
|
|
27
|
-
});
|
|
28
|
-
/**
|
|
29
|
-
* GET /api/auth/github/callback
|
|
30
|
-
* GitHub OAuth callback
|
|
31
|
-
*/
|
|
32
|
-
authRouter.get('/github/callback', async (req, res) => {
|
|
33
|
-
const config = getConfig();
|
|
34
|
-
const { code, state } = req.query;
|
|
35
|
-
// Verify state
|
|
36
|
-
if (state !== req.session.oauthState) {
|
|
37
|
-
return res.status(400).json({ error: 'Invalid state parameter' });
|
|
38
|
-
}
|
|
39
|
-
try {
|
|
40
|
-
// Exchange code for token
|
|
41
|
-
const tokenResponse = await fetch('https://github.com/login/oauth/access_token', {
|
|
42
|
-
method: 'POST',
|
|
43
|
-
headers: {
|
|
44
|
-
'Content-Type': 'application/json',
|
|
45
|
-
Accept: 'application/json',
|
|
46
|
-
},
|
|
47
|
-
body: JSON.stringify({
|
|
48
|
-
client_id: config.github.clientId,
|
|
49
|
-
client_secret: config.github.clientSecret,
|
|
50
|
-
code,
|
|
51
|
-
}),
|
|
52
|
-
});
|
|
53
|
-
const tokenData = await tokenResponse.json();
|
|
54
|
-
if (tokenData.error) {
|
|
55
|
-
throw new Error(tokenData.error_description || tokenData.error);
|
|
56
|
-
}
|
|
57
|
-
const accessToken = tokenData.access_token;
|
|
58
|
-
// Get user info
|
|
59
|
-
const userResponse = await fetch('https://api.github.com/user', {
|
|
60
|
-
headers: {
|
|
61
|
-
Authorization: `Bearer ${accessToken}`,
|
|
62
|
-
Accept: 'application/vnd.github.v3+json',
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
const userData = await userResponse.json();
|
|
66
|
-
// Get user email if not public
|
|
67
|
-
let email = userData.email;
|
|
68
|
-
if (!email) {
|
|
69
|
-
const emailsResponse = await fetch('https://api.github.com/user/emails', {
|
|
70
|
-
headers: {
|
|
71
|
-
Authorization: `Bearer ${accessToken}`,
|
|
72
|
-
Accept: 'application/vnd.github.v3+json',
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
const emails = await emailsResponse.json();
|
|
76
|
-
const primaryEmail = emails.find((e) => e.primary);
|
|
77
|
-
email = primaryEmail?.email;
|
|
78
|
-
}
|
|
79
|
-
// Create or update user
|
|
80
|
-
const user = await db.users.upsert({
|
|
81
|
-
githubId: String(userData.id),
|
|
82
|
-
githubUsername: userData.login,
|
|
83
|
-
email,
|
|
84
|
-
avatarUrl: userData.avatar_url,
|
|
85
|
-
});
|
|
86
|
-
// Store GitHub token as a credential
|
|
87
|
-
await db.credentials.upsert({
|
|
88
|
-
userId: user.id,
|
|
89
|
-
provider: 'github',
|
|
90
|
-
accessToken,
|
|
91
|
-
scopes: ['read:user', 'user:email', 'repo'],
|
|
92
|
-
providerAccountId: String(userData.id),
|
|
93
|
-
providerAccountEmail: email,
|
|
94
|
-
});
|
|
95
|
-
// Set session
|
|
96
|
-
req.session.userId = user.id;
|
|
97
|
-
req.session.githubToken = accessToken;
|
|
98
|
-
delete req.session.oauthState;
|
|
99
|
-
// Redirect to dashboard or onboarding
|
|
100
|
-
const redirectTo = user.onboardingCompletedAt
|
|
101
|
-
? '/dashboard'
|
|
102
|
-
: '/onboarding/providers';
|
|
103
|
-
res.redirect(redirectTo);
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
console.error('GitHub OAuth error:', error);
|
|
107
|
-
res.redirect('/login?error=oauth_failed');
|
|
108
|
-
}
|
|
16
|
+
authRouter.get('/github', (_req, res) => {
|
|
17
|
+
res.redirect('/api/auth/nango/login-session');
|
|
109
18
|
});
|
|
110
19
|
/**
|
|
111
20
|
* POST /api/auth/logout
|
|
@@ -141,6 +50,8 @@ authRouter.get('/me', async (req, res) => {
|
|
|
141
50
|
}));
|
|
142
51
|
// Get pending invites
|
|
143
52
|
const pendingInvites = await db.workspaceMembers.getPendingInvites(user.id);
|
|
53
|
+
// Check for pending GitHub installation request
|
|
54
|
+
const pendingGitHubApproval = !!user.pendingInstallationRequest;
|
|
144
55
|
res.json({
|
|
145
56
|
id: user.id,
|
|
146
57
|
githubUsername: user.githubUsername,
|
|
@@ -149,6 +60,7 @@ authRouter.get('/me', async (req, res) => {
|
|
|
149
60
|
plan: user.plan,
|
|
150
61
|
connectedProviders,
|
|
151
62
|
pendingInvites: pendingInvites.length,
|
|
63
|
+
pendingGitHubApproval,
|
|
152
64
|
onboardingCompleted: !!user.onboardingCompletedAt,
|
|
153
65
|
});
|
|
154
66
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Router } from 'express';
|
|
7
7
|
import { getBillingService, getAllPlans, getPlan, comparePlans } from '../billing/index.js';
|
|
8
8
|
import { getConfig } from '../config.js';
|
|
9
|
+
import { db } from '../db/index.js';
|
|
9
10
|
export const billingRouter = Router();
|
|
10
11
|
/**
|
|
11
12
|
* Middleware to require authentication
|
|
@@ -315,8 +316,14 @@ billingRouter.post('/webhook',
|
|
|
315
316
|
}
|
|
316
317
|
const billing = getBillingService();
|
|
317
318
|
try {
|
|
318
|
-
//
|
|
319
|
-
|
|
319
|
+
// Use the preserved raw body from express.json verify callback
|
|
320
|
+
// This is critical for Stripe signature verification - JSON.stringify(req.body) won't work
|
|
321
|
+
const rawBody = req.rawBody;
|
|
322
|
+
if (!rawBody) {
|
|
323
|
+
console.error('Raw body not available for Stripe webhook verification');
|
|
324
|
+
res.status(400).json({ error: 'Raw body not available' });
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
320
327
|
// Verify and parse event
|
|
321
328
|
const event = billing.verifyWebhookSignature(rawBody, sig);
|
|
322
329
|
// Process the event
|
|
@@ -330,16 +337,30 @@ billingRouter.post('/webhook',
|
|
|
330
337
|
// Handle specific events
|
|
331
338
|
switch (billingEvent.type) {
|
|
332
339
|
case 'subscription.created':
|
|
333
|
-
case 'subscription.updated':
|
|
334
|
-
//
|
|
335
|
-
|
|
336
|
-
|
|
340
|
+
case 'subscription.updated': {
|
|
341
|
+
// Extract subscription tier and update user's plan
|
|
342
|
+
if (billingEvent.userId) {
|
|
343
|
+
const subscription = billingEvent.data;
|
|
344
|
+
const tier = billing.getTierFromSubscription(subscription);
|
|
345
|
+
// Update user's plan in database
|
|
346
|
+
await db.users.update(billingEvent.userId, { plan: tier });
|
|
347
|
+
console.log(`Updated user ${billingEvent.userId} plan to: ${tier}`);
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
console.warn('Subscription event received without userId:', billingEvent.id);
|
|
351
|
+
}
|
|
337
352
|
break;
|
|
338
|
-
|
|
339
|
-
|
|
353
|
+
}
|
|
354
|
+
case 'subscription.canceled': {
|
|
355
|
+
// Reset user to free plan
|
|
356
|
+
if (billingEvent.userId) {
|
|
357
|
+
await db.users.update(billingEvent.userId, { plan: 'free' });
|
|
358
|
+
console.log(`User ${billingEvent.userId} subscription canceled, reset to free plan`);
|
|
359
|
+
}
|
|
340
360
|
break;
|
|
361
|
+
}
|
|
341
362
|
case 'invoice.payment_failed':
|
|
342
|
-
//
|
|
363
|
+
// Log payment failure (don't immediately downgrade - Stripe retries)
|
|
343
364
|
console.log('Payment failed for user:', billingEvent.userId);
|
|
344
365
|
break;
|
|
345
366
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI PTY Runner
|
|
3
|
+
*
|
|
4
|
+
* Shared module for running CLI auth flows via PTY.
|
|
5
|
+
* Used by both production (onboarding.ts) and tests (ci-test-real-clis.ts).
|
|
6
|
+
*
|
|
7
|
+
* This module has minimal dependencies (only node-pty) so it can be
|
|
8
|
+
* used in isolated test containers without the full server stack.
|
|
9
|
+
*/
|
|
10
|
+
import { CLI_AUTH_CONFIG, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, getSupportedProviders, type CLIAuthConfig, type PromptHandler } from '../../shared/cli-auth-config.js';
|
|
11
|
+
export { CLI_AUTH_CONFIG, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, getSupportedProviders, type CLIAuthConfig, type PromptHandler, };
|
|
12
|
+
export declare function validateAllProviderConfigs(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Result of running a CLI auth flow via PTY
|
|
15
|
+
*/
|
|
16
|
+
export interface PTYAuthResult {
|
|
17
|
+
authUrl: string | null;
|
|
18
|
+
success: boolean;
|
|
19
|
+
promptsHandled: string[];
|
|
20
|
+
output: string;
|
|
21
|
+
exitCode: number | null;
|
|
22
|
+
error?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options for running CLI auth via PTY
|
|
26
|
+
*/
|
|
27
|
+
export interface PTYAuthOptions {
|
|
28
|
+
/** Callback when auth URL is found */
|
|
29
|
+
onAuthUrl?: (url: string) => void;
|
|
30
|
+
/** Callback when a prompt is handled */
|
|
31
|
+
onPromptHandled?: (description: string) => void;
|
|
32
|
+
/** Callback for raw PTY output */
|
|
33
|
+
onOutput?: (data: string) => void;
|
|
34
|
+
/** Environment variables override */
|
|
35
|
+
env?: Record<string, string>;
|
|
36
|
+
/** Working directory */
|
|
37
|
+
cwd?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Run CLI auth flow via PTY
|
|
41
|
+
*
|
|
42
|
+
* This is the core PTY runner used by both production and tests.
|
|
43
|
+
* It handles:
|
|
44
|
+
* - Spawning the CLI with proper TTY emulation
|
|
45
|
+
* - Auto-responding to interactive prompts
|
|
46
|
+
* - Extracting auth URLs from output
|
|
47
|
+
* - Detecting success patterns
|
|
48
|
+
*
|
|
49
|
+
* @param config - CLI auth configuration for the provider
|
|
50
|
+
* @param options - Optional callbacks and overrides
|
|
51
|
+
* @returns Promise resolving to auth result
|
|
52
|
+
*/
|
|
53
|
+
export declare function runCLIAuthViaPTY(config: CLIAuthConfig, options?: PTYAuthOptions): Promise<PTYAuthResult>;
|
|
54
|
+
//# sourceMappingURL=cli-pty-runner.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI PTY Runner
|
|
3
|
+
*
|
|
4
|
+
* Shared module for running CLI auth flows via PTY.
|
|
5
|
+
* Used by both production (onboarding.ts) and tests (ci-test-real-clis.ts).
|
|
6
|
+
*
|
|
7
|
+
* This module has minimal dependencies (only node-pty) so it can be
|
|
8
|
+
* used in isolated test containers without the full server stack.
|
|
9
|
+
*/
|
|
10
|
+
import * as pty from 'node-pty';
|
|
11
|
+
// Import shared config and utilities
|
|
12
|
+
import { CLI_AUTH_CONFIG, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, validateAllProviderConfigs as validateAllConfigs, getSupportedProviders, } from '../../shared/cli-auth-config.js';
|
|
13
|
+
// Re-export everything from shared config for backward compatibility
|
|
14
|
+
export { CLI_AUTH_CONFIG, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, getSupportedProviders, };
|
|
15
|
+
// Wrapper that throws instead of returning array (backward compatible)
|
|
16
|
+
export function validateAllProviderConfigs() {
|
|
17
|
+
const errors = validateAllConfigs();
|
|
18
|
+
if (errors.length > 0) {
|
|
19
|
+
throw new Error(`Invalid provider configurations:\n${errors.join('\n')}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Run CLI auth flow via PTY
|
|
24
|
+
*
|
|
25
|
+
* This is the core PTY runner used by both production and tests.
|
|
26
|
+
* It handles:
|
|
27
|
+
* - Spawning the CLI with proper TTY emulation
|
|
28
|
+
* - Auto-responding to interactive prompts
|
|
29
|
+
* - Extracting auth URLs from output
|
|
30
|
+
* - Detecting success patterns
|
|
31
|
+
*
|
|
32
|
+
* @param config - CLI auth configuration for the provider
|
|
33
|
+
* @param options - Optional callbacks and overrides
|
|
34
|
+
* @returns Promise resolving to auth result
|
|
35
|
+
*/
|
|
36
|
+
export async function runCLIAuthViaPTY(config, options = {}) {
|
|
37
|
+
const result = {
|
|
38
|
+
authUrl: null,
|
|
39
|
+
success: false,
|
|
40
|
+
promptsHandled: [],
|
|
41
|
+
output: '',
|
|
42
|
+
exitCode: null,
|
|
43
|
+
};
|
|
44
|
+
const respondedPrompts = new Set();
|
|
45
|
+
return new Promise((resolve) => {
|
|
46
|
+
try {
|
|
47
|
+
const proc = pty.spawn(config.command, config.args, {
|
|
48
|
+
name: 'xterm-256color',
|
|
49
|
+
cols: 120,
|
|
50
|
+
rows: 30,
|
|
51
|
+
cwd: options.cwd || process.cwd(),
|
|
52
|
+
env: {
|
|
53
|
+
...process.env,
|
|
54
|
+
NO_COLOR: '1',
|
|
55
|
+
TERM: 'xterm-256color',
|
|
56
|
+
// Prevent CLIs from trying to open browsers
|
|
57
|
+
BROWSER: 'echo',
|
|
58
|
+
DISPLAY: '',
|
|
59
|
+
...options.env,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
// Timeout handler
|
|
63
|
+
const timeout = setTimeout(() => {
|
|
64
|
+
proc.kill();
|
|
65
|
+
result.error = 'Timeout waiting for auth URL';
|
|
66
|
+
resolve(result);
|
|
67
|
+
}, config.waitTimeout + 5000);
|
|
68
|
+
proc.onData((data) => {
|
|
69
|
+
result.output += data;
|
|
70
|
+
options.onOutput?.(data);
|
|
71
|
+
// Check for matching prompts and auto-respond
|
|
72
|
+
const matchingPrompt = findMatchingPrompt(data, config.prompts, respondedPrompts);
|
|
73
|
+
if (matchingPrompt) {
|
|
74
|
+
respondedPrompts.add(matchingPrompt.description);
|
|
75
|
+
result.promptsHandled.push(matchingPrompt.description);
|
|
76
|
+
options.onPromptHandled?.(matchingPrompt.description);
|
|
77
|
+
const delay = matchingPrompt.delay ?? 100;
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
try {
|
|
80
|
+
proc.write(matchingPrompt.response);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Process may have exited
|
|
84
|
+
}
|
|
85
|
+
}, delay);
|
|
86
|
+
}
|
|
87
|
+
// Look for auth URL
|
|
88
|
+
const cleanText = stripAnsiCodes(data);
|
|
89
|
+
const match = cleanText.match(config.urlPattern);
|
|
90
|
+
if (match && match[1] && !result.authUrl) {
|
|
91
|
+
result.authUrl = match[1];
|
|
92
|
+
options.onAuthUrl?.(result.authUrl);
|
|
93
|
+
}
|
|
94
|
+
// Check for success indicators
|
|
95
|
+
if (matchesSuccessPattern(data, config.successPatterns)) {
|
|
96
|
+
result.success = true;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
proc.onExit(({ exitCode }) => {
|
|
100
|
+
clearTimeout(timeout);
|
|
101
|
+
result.exitCode = exitCode;
|
|
102
|
+
// Consider it a success if we got a URL (main goal)
|
|
103
|
+
// or if exit code was 0 with success pattern
|
|
104
|
+
if (result.authUrl || (exitCode === 0 && result.success)) {
|
|
105
|
+
result.success = true;
|
|
106
|
+
}
|
|
107
|
+
if (!result.authUrl && !result.success && !result.error) {
|
|
108
|
+
result.error = 'Failed to extract auth URL from CLI output';
|
|
109
|
+
}
|
|
110
|
+
resolve(result);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
result.error = err instanceof Error ? err.message : 'Unknown error';
|
|
115
|
+
resolve(result);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=cli-pty-runner.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Auth Helper API
|
|
3
|
+
*
|
|
4
|
+
* Provides endpoints for the `npx agent-relay codex-auth` CLI command
|
|
5
|
+
* to capture OAuth callbacks locally and send them to the cloud.
|
|
6
|
+
*
|
|
7
|
+
* This solves the "This site can't be reached" problem where Codex redirects
|
|
8
|
+
* to localhost:1455 after auth but nothing is listening.
|
|
9
|
+
*/
|
|
10
|
+
export declare const codexAuthHelperRouter: import("express-serve-static-core").Router;
|
|
11
|
+
/**
|
|
12
|
+
* Stop the cleanup interval. Call this on server shutdown.
|
|
13
|
+
*/
|
|
14
|
+
export declare function stopCodexAuthCleanup(): void;
|
|
15
|
+
//# sourceMappingURL=codex-auth-helper.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex Auth Helper API
|
|
3
|
+
*
|
|
4
|
+
* Provides endpoints for the `npx agent-relay codex-auth` CLI command
|
|
5
|
+
* to capture OAuth callbacks locally and send them to the cloud.
|
|
6
|
+
*
|
|
7
|
+
* This solves the "This site can't be reached" problem where Codex redirects
|
|
8
|
+
* to localhost:1455 after auth but nothing is listening.
|
|
9
|
+
*/
|
|
10
|
+
import { Router } from 'express';
|
|
11
|
+
import crypto from 'crypto';
|
|
12
|
+
import { requireAuth } from './auth.js';
|
|
13
|
+
export const codexAuthHelperRouter = Router();
|
|
14
|
+
const pendingAuthSessions = new Map();
|
|
15
|
+
// Clean up old sessions every minute
|
|
16
|
+
const cleanupInterval = setInterval(() => {
|
|
17
|
+
const now = Date.now();
|
|
18
|
+
for (const [id, session] of pendingAuthSessions) {
|
|
19
|
+
// Remove sessions older than 10 minutes
|
|
20
|
+
if (now - session.createdAt.getTime() > 10 * 60 * 1000) {
|
|
21
|
+
pendingAuthSessions.delete(id);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}, 60000);
|
|
25
|
+
/**
|
|
26
|
+
* Stop the cleanup interval. Call this on server shutdown.
|
|
27
|
+
*/
|
|
28
|
+
export function stopCodexAuthCleanup() {
|
|
29
|
+
clearInterval(cleanupInterval);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* POST /api/auth/codex-helper/cli-session
|
|
33
|
+
* Create a new auth session for the CLI command.
|
|
34
|
+
* Returns an authSessionId that the CLI uses to send the auth code.
|
|
35
|
+
*/
|
|
36
|
+
codexAuthHelperRouter.post('/cli-session', requireAuth, async (req, res) => {
|
|
37
|
+
const userId = req.session.userId;
|
|
38
|
+
const authSessionId = crypto.randomUUID();
|
|
39
|
+
pendingAuthSessions.set(authSessionId, {
|
|
40
|
+
userId,
|
|
41
|
+
createdAt: new Date(),
|
|
42
|
+
});
|
|
43
|
+
console.log(`[codex-helper] Created CLI session ${authSessionId} for user ${userId}`);
|
|
44
|
+
res.json({
|
|
45
|
+
authSessionId,
|
|
46
|
+
expiresIn: 600, // 10 minutes
|
|
47
|
+
command: `npx agent-relay codex-auth --token=${authSessionId}`,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* POST /api/auth/codex-helper/callback
|
|
52
|
+
* Receives the auth code from the CLI.
|
|
53
|
+
* No auth required - validated by authSessionId.
|
|
54
|
+
*/
|
|
55
|
+
codexAuthHelperRouter.post('/callback', async (req, res) => {
|
|
56
|
+
const { authSessionId, code, error } = req.body;
|
|
57
|
+
if (!authSessionId) {
|
|
58
|
+
return res.status(400).json({ error: 'Missing authSessionId' });
|
|
59
|
+
}
|
|
60
|
+
const session = pendingAuthSessions.get(authSessionId);
|
|
61
|
+
if (!session) {
|
|
62
|
+
return res.status(404).json({ error: 'Session not found or expired' });
|
|
63
|
+
}
|
|
64
|
+
if (error) {
|
|
65
|
+
console.log(`[codex-helper] Auth error for session ${authSessionId}:`, error);
|
|
66
|
+
pendingAuthSessions.delete(authSessionId);
|
|
67
|
+
return res.json({ success: false, error });
|
|
68
|
+
}
|
|
69
|
+
if (!code) {
|
|
70
|
+
return res.status(400).json({ error: 'Missing auth code' });
|
|
71
|
+
}
|
|
72
|
+
// Store the code so the polling endpoint can retrieve it
|
|
73
|
+
session.code = code;
|
|
74
|
+
pendingAuthSessions.set(authSessionId, session);
|
|
75
|
+
console.log(`[codex-helper] Auth code received for session ${authSessionId}`);
|
|
76
|
+
res.json({ success: true, message: 'Auth code received. You can close this terminal.' });
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* GET /api/auth/codex-helper/status/:authSessionId
|
|
80
|
+
* Check if auth code has been received.
|
|
81
|
+
* The dashboard polls this to know when the CLI has captured the callback.
|
|
82
|
+
*/
|
|
83
|
+
codexAuthHelperRouter.get('/status/:authSessionId', requireAuth, async (req, res) => {
|
|
84
|
+
const { authSessionId } = req.params;
|
|
85
|
+
const session = pendingAuthSessions.get(authSessionId);
|
|
86
|
+
if (!session || session.userId !== req.session.userId) {
|
|
87
|
+
return res.status(404).json({ error: 'Session not found or expired' });
|
|
88
|
+
}
|
|
89
|
+
if (session.code) {
|
|
90
|
+
// Clean up session after successful retrieval (code is single-use)
|
|
91
|
+
const code = session.code;
|
|
92
|
+
pendingAuthSessions.delete(authSessionId);
|
|
93
|
+
return res.json({
|
|
94
|
+
ready: true,
|
|
95
|
+
code,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
res.json({ ready: false });
|
|
99
|
+
});
|
|
100
|
+
//# sourceMappingURL=codex-auth-helper.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Webhooks API Routes
|
|
3
|
+
*
|
|
4
|
+
* Provides endpoints for receiving webhooks from any configured source.
|
|
5
|
+
* Routes: POST /api/webhooks/:source
|
|
6
|
+
*/
|
|
7
|
+
export declare const genericWebhooksRouter: import("express-serve-static-core").Router;
|
|
8
|
+
//# sourceMappingURL=generic-webhooks.d.ts.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Webhooks API Routes
|
|
3
|
+
*
|
|
4
|
+
* Provides endpoints for receiving webhooks from any configured source.
|
|
5
|
+
* Routes: POST /api/webhooks/:source
|
|
6
|
+
*/
|
|
7
|
+
import { Router } from 'express';
|
|
8
|
+
import { processWebhook, getWebhookConfig } from '../webhooks/index.js';
|
|
9
|
+
export const genericWebhooksRouter = Router();
|
|
10
|
+
/**
|
|
11
|
+
* POST /api/webhooks/:source
|
|
12
|
+
* Receive a webhook from any configured source
|
|
13
|
+
*/
|
|
14
|
+
genericWebhooksRouter.post('/:source', async (req, res) => {
|
|
15
|
+
const { source } = req.params;
|
|
16
|
+
// For Slack URL verification challenge
|
|
17
|
+
if (source === 'slack' && req.body?.type === 'url_verification') {
|
|
18
|
+
return res.json({ challenge: req.body.challenge });
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
// Get raw body for signature verification
|
|
22
|
+
// Note: This requires express.raw() middleware or similar
|
|
23
|
+
const rawBody = typeof req.body === 'string'
|
|
24
|
+
? req.body
|
|
25
|
+
: JSON.stringify(req.body);
|
|
26
|
+
const result = await processWebhook(source, rawBody, req.headers);
|
|
27
|
+
if (!result.success && result.responses[0]?.error === 'Invalid signature') {
|
|
28
|
+
return res.status(401).json({ error: 'Invalid signature' });
|
|
29
|
+
}
|
|
30
|
+
if (!result.success && result.responses[0]?.error?.includes('Unknown webhook source')) {
|
|
31
|
+
return res.status(404).json({ error: `Unknown webhook source: ${source}` });
|
|
32
|
+
}
|
|
33
|
+
console.log(`[webhooks] Processed ${source} webhook: ${result.eventType} (${result.matchedRules.length} rules matched)`);
|
|
34
|
+
res.json({
|
|
35
|
+
success: result.success,
|
|
36
|
+
eventId: result.eventId,
|
|
37
|
+
eventType: result.eventType,
|
|
38
|
+
matchedRules: result.matchedRules,
|
|
39
|
+
actionsExecuted: result.actions.length,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error(`[webhooks] Error processing ${source} webhook:`, error);
|
|
44
|
+
res.status(500).json({
|
|
45
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* GET /api/webhooks/config
|
|
51
|
+
* Get the current webhook configuration (for debugging)
|
|
52
|
+
*/
|
|
53
|
+
genericWebhooksRouter.get('/config', (_req, res) => {
|
|
54
|
+
const config = getWebhookConfig();
|
|
55
|
+
res.json({
|
|
56
|
+
sources: Object.entries(config.sources).map(([id, source]) => ({
|
|
57
|
+
id,
|
|
58
|
+
name: source.name,
|
|
59
|
+
enabled: source.enabled,
|
|
60
|
+
parser: source.parser,
|
|
61
|
+
responder: source.responder,
|
|
62
|
+
})),
|
|
63
|
+
rules: config.rules.map(rule => ({
|
|
64
|
+
id: rule.id,
|
|
65
|
+
name: rule.name,
|
|
66
|
+
enabled: rule.enabled,
|
|
67
|
+
source: rule.source,
|
|
68
|
+
eventType: rule.eventType,
|
|
69
|
+
condition: rule.condition,
|
|
70
|
+
actionType: rule.action.type,
|
|
71
|
+
priority: rule.priority,
|
|
72
|
+
})),
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
/**
|
|
76
|
+
* GET /api/webhooks/sources
|
|
77
|
+
* List available webhook sources with their setup instructions
|
|
78
|
+
*/
|
|
79
|
+
genericWebhooksRouter.get('/sources', (_req, res) => {
|
|
80
|
+
const baseUrl = process.env.PUBLIC_URL || 'https://your-domain.com';
|
|
81
|
+
res.json({
|
|
82
|
+
sources: [
|
|
83
|
+
{
|
|
84
|
+
id: 'github',
|
|
85
|
+
name: 'GitHub',
|
|
86
|
+
webhookUrl: `${baseUrl}/api/webhooks/github`,
|
|
87
|
+
setupInstructions: [
|
|
88
|
+
'1. Go to your repository Settings > Webhooks > Add webhook',
|
|
89
|
+
`2. Set Payload URL to: ${baseUrl}/api/webhooks/github`,
|
|
90
|
+
'3. Set Content type to: application/json',
|
|
91
|
+
'4. Set Secret to your GITHUB_WEBHOOK_SECRET value',
|
|
92
|
+
'5. Select events: Check runs, Issues, Issue comments, Pull request review comments',
|
|
93
|
+
],
|
|
94
|
+
requiredEnvVars: ['GITHUB_WEBHOOK_SECRET'],
|
|
95
|
+
events: ['check_run', 'issues', 'issue_comment', 'pull_request_review_comment'],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'linear',
|
|
99
|
+
name: 'Linear',
|
|
100
|
+
webhookUrl: `${baseUrl}/api/webhooks/linear`,
|
|
101
|
+
setupInstructions: [
|
|
102
|
+
'1. Go to Linear Settings > API > Webhooks',
|
|
103
|
+
'2. Create a new webhook',
|
|
104
|
+
`3. Set URL to: ${baseUrl}/api/webhooks/linear`,
|
|
105
|
+
'4. Copy the signing secret to LINEAR_WEBHOOK_SECRET',
|
|
106
|
+
'5. Select events: Issues, Comments',
|
|
107
|
+
],
|
|
108
|
+
requiredEnvVars: ['LINEAR_WEBHOOK_SECRET', 'LINEAR_API_KEY'],
|
|
109
|
+
events: ['Issue', 'Comment', 'IssueLabel'],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'slack',
|
|
113
|
+
name: 'Slack',
|
|
114
|
+
webhookUrl: `${baseUrl}/api/webhooks/slack`,
|
|
115
|
+
setupInstructions: [
|
|
116
|
+
'1. Create a Slack App at api.slack.com/apps',
|
|
117
|
+
'2. Enable Event Subscriptions',
|
|
118
|
+
`3. Set Request URL to: ${baseUrl}/api/webhooks/slack`,
|
|
119
|
+
'4. Subscribe to bot events: app_mention, message.channels',
|
|
120
|
+
'5. Copy Signing Secret to SLACK_SIGNING_SECRET',
|
|
121
|
+
'6. Install the app to your workspace',
|
|
122
|
+
],
|
|
123
|
+
requiredEnvVars: ['SLACK_SIGNING_SECRET', 'SLACK_BOT_TOKEN'],
|
|
124
|
+
events: ['app_mention', 'message', 'reaction_added'],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=generic-webhooks.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Gateway API Routes
|
|
3
|
+
*
|
|
4
|
+
* Provides fresh GitHub tokens to workspace containers for git operations.
|
|
5
|
+
* This gateway pattern ensures tokens are always valid (Nango handles refresh).
|
|
6
|
+
*/
|
|
7
|
+
export declare const gitRouter: import("express-serve-static-core").Router;
|
|
8
|
+
//# sourceMappingURL=git.d.ts.map
|