agent-relay 1.1.0 → 1.2.0
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/README.md +1 -1
- package/dist/bridge/spawner.d.ts +53 -0
- package/dist/bridge/spawner.d.ts.map +1 -1
- package/dist/bridge/spawner.js +203 -19
- package/dist/bridge/spawner.js.map +1 -1
- package/dist/bridge/types.d.ts +12 -0
- package/dist/bridge/types.d.ts.map +1 -1
- package/dist/cli/index.js +401 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cloud/api/auth.d.ts +3 -2
- package/dist/cloud/api/auth.d.ts.map +1 -1
- package/dist/cloud/api/auth.js +10 -98
- package/dist/cloud/api/auth.js.map +1 -1
- package/dist/cloud/api/cli-pty-runner.d.ts +54 -0
- package/dist/cloud/api/cli-pty-runner.d.ts.map +1 -0
- package/dist/cloud/api/cli-pty-runner.js +119 -0
- package/dist/cloud/api/cli-pty-runner.js.map +1 -0
- package/dist/cloud/api/generic-webhooks.d.ts +8 -0
- package/dist/cloud/api/generic-webhooks.d.ts.map +1 -0
- package/dist/cloud/api/generic-webhooks.js +129 -0
- package/dist/cloud/api/generic-webhooks.js.map +1 -0
- package/dist/cloud/api/git.d.ts +8 -0
- package/dist/cloud/api/git.d.ts.map +1 -0
- package/dist/cloud/api/git.js +131 -0
- package/dist/cloud/api/git.js.map +1 -0
- package/dist/cloud/api/github-app.d.ts +11 -0
- package/dist/cloud/api/github-app.d.ts.map +1 -0
- package/dist/cloud/api/github-app.js +189 -0
- package/dist/cloud/api/github-app.js.map +1 -0
- package/dist/cloud/api/middleware/planLimits.d.ts +7 -0
- package/dist/cloud/api/middleware/planLimits.d.ts.map +1 -1
- package/dist/cloud/api/middleware/planLimits.js +39 -1
- package/dist/cloud/api/middleware/planLimits.js.map +1 -1
- package/dist/cloud/api/monitoring.d.ts +11 -0
- package/dist/cloud/api/monitoring.d.ts.map +1 -0
- package/dist/cloud/api/monitoring.js +578 -0
- package/dist/cloud/api/monitoring.js.map +1 -0
- package/dist/cloud/api/nango-auth.d.ts +9 -0
- package/dist/cloud/api/nango-auth.d.ts.map +1 -0
- package/dist/cloud/api/nango-auth.js +377 -0
- package/dist/cloud/api/nango-auth.js.map +1 -0
- package/dist/cloud/api/onboarding.d.ts +8 -1
- package/dist/cloud/api/onboarding.d.ts.map +1 -1
- package/dist/cloud/api/onboarding.js +300 -119
- package/dist/cloud/api/onboarding.js.map +1 -1
- package/dist/cloud/api/policy.d.ts +8 -0
- package/dist/cloud/api/policy.d.ts.map +1 -0
- package/dist/cloud/api/policy.js +229 -0
- package/dist/cloud/api/policy.js.map +1 -0
- package/dist/cloud/api/providers.js +114 -42
- package/dist/cloud/api/providers.js.map +1 -1
- package/dist/cloud/api/test-helpers.d.ts +10 -0
- package/dist/cloud/api/test-helpers.d.ts.map +1 -0
- package/dist/cloud/api/test-helpers.js +575 -0
- package/dist/cloud/api/test-helpers.js.map +1 -0
- package/dist/cloud/api/webhooks.d.ts +7 -0
- package/dist/cloud/api/webhooks.d.ts.map +1 -0
- package/dist/cloud/api/webhooks.js +496 -0
- package/dist/cloud/api/webhooks.js.map +1 -0
- package/dist/cloud/api/workspaces.js +225 -8
- package/dist/cloud/api/workspaces.js.map +1 -1
- package/dist/cloud/billing/plans.d.ts.map +1 -1
- package/dist/cloud/billing/plans.js +13 -0
- package/dist/cloud/billing/plans.js.map +1 -1
- package/dist/cloud/billing/types.d.ts +9 -3
- package/dist/cloud/billing/types.d.ts.map +1 -1
- package/dist/cloud/config.d.ts +9 -2
- package/dist/cloud/config.d.ts.map +1 -1
- package/dist/cloud/config.js +13 -4
- package/dist/cloud/config.js.map +1 -1
- package/dist/cloud/db/drizzle.d.ts +84 -1
- package/dist/cloud/db/drizzle.d.ts.map +1 -1
- package/dist/cloud/db/drizzle.js +470 -0
- package/dist/cloud/db/drizzle.js.map +1 -1
- package/dist/cloud/db/index.d.ts +9 -4
- package/dist/cloud/db/index.d.ts.map +1 -1
- package/dist/cloud/db/index.js +11 -3
- package/dist/cloud/db/index.js.map +1 -1
- package/dist/cloud/db/schema.d.ts +3283 -556
- package/dist/cloud/db/schema.d.ts.map +1 -1
- package/dist/cloud/db/schema.js +314 -1
- package/dist/cloud/db/schema.js.map +1 -1
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.d.ts.map +1 -1
- package/dist/cloud/index.js +2 -0
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/provisioner/index.d.ts +24 -0
- package/dist/cloud/provisioner/index.d.ts.map +1 -1
- package/dist/cloud/provisioner/index.js +319 -18
- package/dist/cloud/provisioner/index.js.map +1 -1
- package/dist/cloud/server.d.ts +1 -0
- package/dist/cloud/server.d.ts.map +1 -1
- package/dist/cloud/server.js +357 -13
- package/dist/cloud/server.js.map +1 -1
- package/dist/cloud/services/auto-scaler.d.ts +152 -0
- package/dist/cloud/services/auto-scaler.d.ts.map +1 -0
- package/dist/cloud/services/auto-scaler.js +439 -0
- package/dist/cloud/services/auto-scaler.js.map +1 -0
- package/dist/cloud/services/capacity-manager.d.ts +148 -0
- package/dist/cloud/services/capacity-manager.d.ts.map +1 -0
- package/dist/cloud/services/capacity-manager.js +449 -0
- package/dist/cloud/services/capacity-manager.js.map +1 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts +49 -0
- package/dist/cloud/services/ci-agent-spawner.d.ts.map +1 -0
- package/dist/cloud/services/ci-agent-spawner.js +373 -0
- package/dist/cloud/services/ci-agent-spawner.js.map +1 -0
- package/dist/cloud/services/index.d.ts +12 -0
- package/dist/cloud/services/index.d.ts.map +1 -0
- package/dist/cloud/services/index.js +15 -0
- package/dist/cloud/services/index.js.map +1 -0
- package/dist/cloud/services/mention-handler.d.ts +65 -0
- package/dist/cloud/services/mention-handler.d.ts.map +1 -0
- package/dist/cloud/services/mention-handler.js +405 -0
- package/dist/cloud/services/mention-handler.js.map +1 -0
- package/dist/cloud/services/nango.d.ts +126 -0
- package/dist/cloud/services/nango.d.ts.map +1 -0
- package/dist/cloud/services/nango.js +191 -0
- package/dist/cloud/services/nango.js.map +1 -0
- package/dist/cloud/services/persistence.d.ts +131 -0
- package/dist/cloud/services/persistence.d.ts.map +1 -0
- package/dist/cloud/services/persistence.js +200 -0
- package/dist/cloud/services/persistence.js.map +1 -0
- package/dist/cloud/services/planLimits.d.ts +15 -0
- package/dist/cloud/services/planLimits.d.ts.map +1 -1
- package/dist/cloud/services/planLimits.js +28 -0
- package/dist/cloud/services/planLimits.js.map +1 -1
- package/dist/cloud/services/scaling-orchestrator.d.ts +159 -0
- package/dist/cloud/services/scaling-orchestrator.d.ts.map +1 -0
- package/dist/cloud/services/scaling-orchestrator.js +502 -0
- package/dist/cloud/services/scaling-orchestrator.js.map +1 -0
- package/dist/cloud/services/scaling-policy.d.ts +121 -0
- package/dist/cloud/services/scaling-policy.d.ts.map +1 -0
- package/dist/cloud/services/scaling-policy.js +415 -0
- package/dist/cloud/services/scaling-policy.js.map +1 -0
- package/dist/cloud/vault/index.js +1 -1
- package/dist/cloud/vault/index.js.map +1 -1
- package/dist/cloud/webhooks/index.d.ts +24 -0
- package/dist/cloud/webhooks/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/index.js +29 -0
- package/dist/cloud/webhooks/index.js.map +1 -0
- package/dist/cloud/webhooks/parsers/github.d.ts +8 -0
- package/dist/cloud/webhooks/parsers/github.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/github.js +234 -0
- package/dist/cloud/webhooks/parsers/github.js.map +1 -0
- package/dist/cloud/webhooks/parsers/index.d.ts +23 -0
- package/dist/cloud/webhooks/parsers/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/index.js +30 -0
- package/dist/cloud/webhooks/parsers/index.js.map +1 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/linear.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/linear.js +258 -0
- package/dist/cloud/webhooks/parsers/linear.js.map +1 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts +9 -0
- package/dist/cloud/webhooks/parsers/slack.d.ts.map +1 -0
- package/dist/cloud/webhooks/parsers/slack.js +214 -0
- package/dist/cloud/webhooks/parsers/slack.js.map +1 -0
- package/dist/cloud/webhooks/responders/github.d.ts +8 -0
- package/dist/cloud/webhooks/responders/github.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/github.js +73 -0
- package/dist/cloud/webhooks/responders/github.js.map +1 -0
- package/dist/cloud/webhooks/responders/index.d.ts +23 -0
- package/dist/cloud/webhooks/responders/index.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/index.js +30 -0
- package/dist/cloud/webhooks/responders/index.js.map +1 -0
- package/dist/cloud/webhooks/responders/linear.d.ts +9 -0
- package/dist/cloud/webhooks/responders/linear.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/linear.js +149 -0
- package/dist/cloud/webhooks/responders/linear.js.map +1 -0
- package/dist/cloud/webhooks/responders/slack.d.ts +20 -0
- package/dist/cloud/webhooks/responders/slack.d.ts.map +1 -0
- package/dist/cloud/webhooks/responders/slack.js +178 -0
- package/dist/cloud/webhooks/responders/slack.js.map +1 -0
- package/dist/cloud/webhooks/router.d.ts +25 -0
- package/dist/cloud/webhooks/router.d.ts.map +1 -0
- package/dist/cloud/webhooks/router.js +504 -0
- package/dist/cloud/webhooks/router.js.map +1 -0
- package/dist/cloud/webhooks/rules-engine.d.ts +24 -0
- package/dist/cloud/webhooks/rules-engine.d.ts.map +1 -0
- package/dist/cloud/webhooks/rules-engine.js +287 -0
- package/dist/cloud/webhooks/rules-engine.js.map +1 -0
- package/dist/cloud/webhooks/types.d.ts +186 -0
- package/dist/cloud/webhooks/types.d.ts.map +1 -0
- package/dist/cloud/webhooks/types.js +8 -0
- package/dist/cloud/webhooks/types.js.map +1 -0
- package/dist/continuity/formatter.d.ts +51 -0
- package/dist/continuity/formatter.d.ts.map +1 -0
- package/dist/continuity/formatter.js +313 -0
- package/dist/continuity/formatter.js.map +1 -0
- package/dist/continuity/handoff-store.d.ts +67 -0
- package/dist/continuity/handoff-store.d.ts.map +1 -0
- package/dist/continuity/handoff-store.js +472 -0
- package/dist/continuity/handoff-store.js.map +1 -0
- package/dist/continuity/index.d.ts +45 -0
- package/dist/continuity/index.d.ts.map +1 -0
- package/dist/continuity/index.js +48 -0
- package/dist/continuity/index.js.map +1 -0
- package/dist/continuity/ledger-store.d.ts +110 -0
- package/dist/continuity/ledger-store.d.ts.map +1 -0
- package/dist/continuity/ledger-store.js +500 -0
- package/dist/continuity/ledger-store.js.map +1 -0
- package/dist/continuity/manager.d.ts +178 -0
- package/dist/continuity/manager.d.ts.map +1 -0
- package/dist/continuity/manager.js +562 -0
- package/dist/continuity/manager.js.map +1 -0
- package/dist/continuity/parser.d.ts +76 -0
- package/dist/continuity/parser.d.ts.map +1 -0
- package/dist/continuity/parser.js +579 -0
- package/dist/continuity/parser.js.map +1 -0
- package/dist/continuity/types.d.ts +180 -0
- package/dist/continuity/types.d.ts.map +1 -0
- package/dist/continuity/types.js +9 -0
- package/dist/continuity/types.js.map +1 -0
- package/dist/daemon/agent-manager.d.ts +27 -0
- package/dist/daemon/agent-manager.d.ts.map +1 -1
- package/dist/daemon/agent-manager.js +107 -6
- package/dist/daemon/agent-manager.js.map +1 -1
- package/dist/daemon/agent-registry.d.ts +32 -0
- package/dist/daemon/agent-registry.d.ts.map +1 -1
- package/dist/daemon/agent-registry.js +42 -2
- package/dist/daemon/agent-registry.js.map +1 -1
- package/dist/daemon/api.d.ts +12 -0
- package/dist/daemon/api.d.ts.map +1 -1
- package/dist/daemon/api.js +131 -2
- package/dist/daemon/api.js.map +1 -1
- package/dist/daemon/cli-auth.d.ts +67 -0
- package/dist/daemon/cli-auth.d.ts.map +1 -0
- package/dist/daemon/cli-auth.js +537 -0
- package/dist/daemon/cli-auth.js.map +1 -0
- package/dist/daemon/cloud-sync.d.ts.map +1 -1
- package/dist/daemon/cloud-sync.js +9 -7
- package/dist/daemon/cloud-sync.js.map +1 -1
- package/dist/daemon/orchestrator.d.ts.map +1 -1
- package/dist/daemon/orchestrator.js +30 -0
- package/dist/daemon/orchestrator.js.map +1 -1
- package/dist/daemon/router.d.ts +5 -0
- package/dist/daemon/router.d.ts.map +1 -1
- package/dist/daemon/router.js +78 -26
- package/dist/daemon/router.js.map +1 -1
- package/dist/daemon/server.d.ts +5 -0
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +9 -1
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/services/browser-testing.d.ts +88 -0
- package/dist/daemon/services/browser-testing.d.ts.map +1 -0
- package/dist/daemon/services/browser-testing.js +244 -0
- package/dist/daemon/services/browser-testing.js.map +1 -0
- package/dist/daemon/services/container-spawner.d.ts +135 -0
- package/dist/daemon/services/container-spawner.d.ts.map +1 -0
- package/dist/daemon/services/container-spawner.js +313 -0
- package/dist/daemon/services/container-spawner.js.map +1 -0
- package/dist/daemon/types.d.ts +5 -1
- package/dist/daemon/types.d.ts.map +1 -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/480-2d4111711d4e473c.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/724-73c1ee5f60abe860.js +9 -0
- package/dist/dashboard/out/_next/static/chunks/766-c3a14283c88d815b.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/app/page-7120be68bea622f3.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-dc2e3a1a22478efc.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/history/{page-b6edd4dde8d08194.js → page-56a8b4616a90dc43.js} +1 -1
- package/dist/dashboard/out/_next/static/chunks/app/login/page-3eac37ea6f5dd153.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/metrics/page-1081dd190a331a91.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/page-daf87e86f783f980.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/providers/page-b68a681526eb145e.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/app/signup/page-fee4ed1709070bcd.js +1 -0
- package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +18 -0
- package/dist/dashboard/out/_next/static/chunks/{main-c2f423b9c9f4591b.js → main-97850e03d723ea8c.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/411ce23ffeae9f76.css +1 -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 +2 -2
- 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.d.ts.map +1 -1
- package/dist/dashboard-server/server.js +1308 -8
- package/dist/dashboard-server/server.js.map +1 -1
- package/dist/hooks/emitter.d.ts +40 -0
- package/dist/hooks/emitter.d.ts.map +1 -0
- package/dist/hooks/emitter.js +63 -0
- package/dist/hooks/emitter.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/registry.d.ts +173 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/registry.js +476 -0
- package/dist/hooks/registry.js.map +1 -0
- package/dist/hooks/trajectory-hooks.d.ts +52 -0
- package/dist/hooks/trajectory-hooks.d.ts.map +1 -0
- package/dist/hooks/trajectory-hooks.js +183 -0
- package/dist/hooks/trajectory-hooks.js.map +1 -0
- package/dist/hooks/types.d.ts +141 -0
- package/dist/hooks/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/memory/adapters/index.d.ts +8 -0
- package/dist/memory/adapters/index.d.ts.map +1 -0
- package/dist/memory/adapters/index.js +8 -0
- package/dist/memory/adapters/index.js.map +1 -0
- package/dist/memory/adapters/inmemory.d.ts +59 -0
- package/dist/memory/adapters/inmemory.d.ts.map +1 -0
- package/dist/memory/adapters/inmemory.js +195 -0
- package/dist/memory/adapters/inmemory.js.map +1 -0
- package/dist/memory/adapters/supermemory.d.ts +71 -0
- package/dist/memory/adapters/supermemory.d.ts.map +1 -0
- package/dist/memory/adapters/supermemory.js +338 -0
- package/dist/memory/adapters/supermemory.js.map +1 -0
- package/dist/memory/factory.d.ts +48 -0
- package/dist/memory/factory.d.ts.map +1 -0
- package/dist/memory/factory.js +143 -0
- package/dist/memory/factory.js.map +1 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +32 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memory-hooks.d.ts +60 -0
- package/dist/memory/memory-hooks.d.ts.map +1 -0
- package/dist/memory/memory-hooks.js +313 -0
- package/dist/memory/memory-hooks.js.map +1 -0
- package/dist/memory/service.d.ts +49 -0
- package/dist/memory/service.d.ts.map +1 -0
- package/dist/memory/service.js +146 -0
- package/dist/memory/service.js.map +1 -0
- package/dist/memory/types.d.ts +195 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +8 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/policy/agent-policy.d.ts +225 -0
- package/dist/policy/agent-policy.d.ts.map +1 -0
- package/dist/policy/agent-policy.js +665 -0
- package/dist/policy/agent-policy.js.map +1 -0
- package/dist/policy/cloud-policy-fetcher.d.ts +12 -0
- package/dist/policy/cloud-policy-fetcher.d.ts.map +1 -0
- package/dist/policy/cloud-policy-fetcher.js +64 -0
- package/dist/policy/cloud-policy-fetcher.js.map +1 -0
- package/dist/resiliency/crash-insights.d.ts +156 -0
- package/dist/resiliency/crash-insights.d.ts.map +1 -0
- package/dist/resiliency/crash-insights.js +492 -0
- package/dist/resiliency/crash-insights.js.map +1 -0
- package/dist/resiliency/gossip-health.d.ts +137 -0
- package/dist/resiliency/gossip-health.d.ts.map +1 -0
- package/dist/resiliency/gossip-health.js +241 -0
- package/dist/resiliency/gossip-health.js.map +1 -0
- package/dist/resiliency/index.d.ts +5 -0
- package/dist/resiliency/index.d.ts.map +1 -1
- package/dist/resiliency/index.js +5 -0
- package/dist/resiliency/index.js.map +1 -1
- package/dist/resiliency/leader-watchdog.d.ts +109 -0
- package/dist/resiliency/leader-watchdog.d.ts.map +1 -0
- package/dist/resiliency/leader-watchdog.js +189 -0
- package/dist/resiliency/leader-watchdog.js.map +1 -0
- package/dist/resiliency/memory-monitor.d.ts +172 -0
- package/dist/resiliency/memory-monitor.d.ts.map +1 -0
- package/dist/resiliency/memory-monitor.js +593 -0
- package/dist/resiliency/memory-monitor.js.map +1 -0
- package/dist/resiliency/stateless-lead.d.ts +149 -0
- package/dist/resiliency/stateless-lead.d.ts.map +1 -0
- package/dist/resiliency/stateless-lead.js +308 -0
- package/dist/resiliency/stateless-lead.js.map +1 -0
- package/dist/resiliency/supervisor.d.ts +38 -0
- package/dist/resiliency/supervisor.d.ts.map +1 -1
- package/dist/resiliency/supervisor.js +122 -0
- package/dist/resiliency/supervisor.js.map +1 -1
- package/dist/shared/cli-auth-config.d.ts +91 -0
- package/dist/shared/cli-auth-config.d.ts.map +1 -0
- package/dist/shared/cli-auth-config.js +264 -0
- package/dist/shared/cli-auth-config.js.map +1 -0
- package/dist/storage/adapter.d.ts +1 -1
- package/dist/storage/adapter.d.ts.map +1 -1
- package/dist/trajectory/config.d.ts +84 -0
- package/dist/trajectory/config.d.ts.map +1 -0
- package/dist/trajectory/config.js +163 -0
- package/dist/trajectory/config.js.map +1 -0
- package/dist/trajectory/index.d.ts +8 -0
- package/dist/trajectory/index.d.ts.map +1 -0
- package/dist/trajectory/index.js +8 -0
- package/dist/trajectory/index.js.map +1 -0
- package/dist/trajectory/integration.d.ts +292 -0
- package/dist/trajectory/integration.d.ts.map +1 -0
- package/dist/trajectory/integration.js +834 -0
- package/dist/trajectory/integration.js.map +1 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/project-namespace.d.ts +24 -0
- package/dist/utils/project-namespace.d.ts.map +1 -1
- package/dist/utils/project-namespace.js +84 -0
- package/dist/utils/project-namespace.js.map +1 -1
- package/dist/wrapper/parser.d.ts +10 -0
- package/dist/wrapper/parser.d.ts.map +1 -1
- package/dist/wrapper/parser.js +100 -33
- package/dist/wrapper/parser.js.map +1 -1
- package/dist/wrapper/pty-wrapper.d.ts +197 -16
- package/dist/wrapper/pty-wrapper.d.ts.map +1 -1
- package/dist/wrapper/pty-wrapper.js +943 -106
- package/dist/wrapper/pty-wrapper.js.map +1 -1
- package/dist/wrapper/shared.d.ts +165 -0
- package/dist/wrapper/shared.d.ts.map +1 -0
- package/dist/wrapper/shared.js +270 -0
- package/dist/wrapper/shared.js.map +1 -0
- package/dist/wrapper/tmux-wrapper.d.ts +73 -11
- package/dist/wrapper/tmux-wrapper.d.ts.map +1 -1
- package/dist/wrapper/tmux-wrapper.js +541 -120
- package/dist/wrapper/tmux-wrapper.js.map +1 -1
- package/docs/CLOUD-ARCHITECTURE.md +152 -0
- package/docs/HOOKS_API.md +394 -0
- package/docs/WRAPPER_EVENTS.md +358 -0
- package/docs/agent-policy-snippet.md +40 -0
- package/docs/agent-relay-protocol.md +238 -0
- package/docs/agent-relay-snippet.md +53 -47
- package/docs/archive/EXECUTIVE_SUMMARY.md +358 -0
- package/docs/archive/ROADMAP.md +329 -0
- package/docs/competitive/GASTOWN.md +451 -0
- package/docs/{COMPETITIVE_ANALYSIS.md → competitive/OVERVIEW.md} +1 -0
- package/docs/competitive/README.md +34 -0
- package/docs/competitive/TMUX_ORCHESTRATOR.md +605 -0
- package/docs/dashboard.png +0 -0
- package/docs/design/ci-failure-webhooks.md +812 -0
- package/docs/design/comprehensive-integrations.md +238 -0
- package/docs/design/e2b-sandbox-integration.md +504 -0
- package/docs/design/github-app-permissions.md +264 -0
- package/docs/local-testing.md +428 -0
- package/docs/proposals/continuous-claude-integration.md +622 -0
- package/docs/proposals/custom-commands.md +368 -0
- package/docs/tasks/global-skills-system.tasks.md +230 -0
- package/docs/tasks/webhook-integrations.tasks.md +184 -0
- package/docs/tasks/workspace-capabilities.tasks.md +121 -0
- package/docs/testing/RESILIENCY-TEST-PLAN-2026-01-01.md +366 -0
- package/package.json +16 -7
- package/scripts/cloud-setup.sh +96 -0
- package/scripts/manual-qa.sh +293 -0
- package/scripts/postinstall.js +60 -0
- package/scripts/run-cloud-qa.sh +220 -0
- package/scripts/test-cli-auth/Dockerfile +44 -0
- package/scripts/test-cli-auth/Dockerfile.real +79 -0
- package/scripts/test-cli-auth/README.md +286 -0
- package/scripts/test-cli-auth/ci-test-real-clis.ts +251 -0
- package/scripts/test-cli-auth/ci-test-runner.ts +263 -0
- package/scripts/test-cli-auth/mock-cli.sh +147 -0
- package/scripts/test-cli-auth/package.json +14 -0
- package/scripts/test-cli-auth/test-oauth-flow.ts +220 -0
- package/scripts/test-pty-input-auto.js +222 -0
- package/scripts/test-pty-input.js +150 -0
- 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/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/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/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → H5aWG0udPB4iOUIl_gytz}/_buildManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/{6HHWb2ZmnJ4OSm0zUP7h4 → H5aWG0udPB4iOUIl_gytz}/_ssgManifest.js +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{117-b2cd8d6485aacf2b.js → 117-b100311aff8d5c61.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/{648-8f3f26864ce515e5.js → 648-a13d3c2b1be45466.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/_not-found/{page-0b990dbb71d72a98.js → page-a4973f3e3c82fb67.js} +0 -0
- /package/dist/dashboard/out/_next/static/chunks/app/pricing/{page-d80e03a5297f95b6.js → page-4d72d5a5d8a9b618.js} +0 -0
- /package/docs/{CHANGELOG.md → archive/CHANGELOG.md} +0 -0
- /package/docs/{CLI-SIMPLIFICATION-COMPLETE.md → archive/CLI-SIMPLIFICATION-COMPLETE.md} +0 -0
- /package/docs/{DESIGN_BRIDGE_STAFFING.md → archive/DESIGN_BRIDGE_STAFFING.md} +0 -0
- /package/docs/{DESIGN_V2.md → archive/DESIGN_V2.md} +0 -0
- /package/docs/{MONETIZATION.md → archive/MONETIZATION.md} +0 -0
- /package/docs/{PROPOSAL-trajectories.md → archive/PROPOSAL-trajectories.md} +0 -0
- /package/docs/{SCALING_ANALYSIS.md → archive/SCALING_ANALYSIS.md} +0 -0
- /package/docs/{TESTING_PRESENCE_FEATURES.md → archive/TESTING_PRESENCE_FEATURES.md} +0 -0
- /package/docs/{TMUX_IMPLEMENTATION_NOTES.md → archive/TMUX_IMPLEMENTATION_NOTES.md} +0 -0
- /package/docs/{TMUX_IMPROVEMENTS.md → archive/TMUX_IMPROVEMENTS.md} +0 -0
- /package/docs/{dashboard-v2-plan.md → archive/dashboard-v2-plan.md} +0 -0
- /package/docs/{removable-code-analysis.md → archive/removable-code-analysis.md} +0 -0
- /package/docs/{competitive-analysis-mcp-agent-mail.md → competitive/MCP_AGENT_MAIL.md} +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# GitHub App Permissions
|
|
2
|
+
|
|
3
|
+
This document describes the GitHub App permissions required for Agent Relay's features, particularly the CI failure webhook integration.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Agent Relay uses a GitHub App to:
|
|
8
|
+
1. Receive webhook events (installations, PRs, CI failures)
|
|
9
|
+
2. Access repository code for cloning/syncing
|
|
10
|
+
3. Create commits and push fixes
|
|
11
|
+
4. Interact with PRs (comments, reviews)
|
|
12
|
+
|
|
13
|
+
## Required Permissions
|
|
14
|
+
|
|
15
|
+
### Repository Permissions
|
|
16
|
+
|
|
17
|
+
| Permission | Access Level | Purpose |
|
|
18
|
+
|------------|--------------|---------|
|
|
19
|
+
| **Contents** | Read & Write | Clone repos, push commits, read files |
|
|
20
|
+
| **Pull requests** | Read & Write | Read PR details, create/update PRs, comment |
|
|
21
|
+
| **Checks** | Read | Receive check_run webhooks, read failure details |
|
|
22
|
+
| **Actions** | Read | Receive workflow_run webhooks, read logs |
|
|
23
|
+
| **Commit statuses** | Read | Read status checks, understand CI state |
|
|
24
|
+
| **Metadata** | Read | Basic repo info (required for all apps) |
|
|
25
|
+
|
|
26
|
+
### Organization Permissions
|
|
27
|
+
|
|
28
|
+
| Permission | Access Level | Purpose |
|
|
29
|
+
|------------|--------------|---------|
|
|
30
|
+
| **Members** | Read | Identify organization members for access control |
|
|
31
|
+
|
|
32
|
+
### Account Permissions
|
|
33
|
+
|
|
34
|
+
| Permission | Access Level | Purpose |
|
|
35
|
+
|------------|--------------|---------|
|
|
36
|
+
| **Email addresses** | Read | User identification, notifications |
|
|
37
|
+
|
|
38
|
+
## Webhook Events
|
|
39
|
+
|
|
40
|
+
The following webhook events should be enabled:
|
|
41
|
+
|
|
42
|
+
### Required Events
|
|
43
|
+
|
|
44
|
+
| Event | Purpose |
|
|
45
|
+
|-------|---------|
|
|
46
|
+
| `installation` | Track app installations/uninstallations |
|
|
47
|
+
| `installation_repositories` | Track repo access changes |
|
|
48
|
+
| `check_run` | **CI failure detection** - triggers agent spawn |
|
|
49
|
+
| `workflow_run` | Workflow-level failure tracking |
|
|
50
|
+
| `push` | Detect new commits for sync |
|
|
51
|
+
| `pull_request` | Track PR lifecycle |
|
|
52
|
+
|
|
53
|
+
### Optional Events
|
|
54
|
+
|
|
55
|
+
| Event | Purpose |
|
|
56
|
+
|-------|---------|
|
|
57
|
+
| `issues` | Future: issue-to-agent assignment |
|
|
58
|
+
| `issue_comment` | Future: agent @mentions |
|
|
59
|
+
| `pull_request_review` | Future: review request handling |
|
|
60
|
+
| `check_suite` | Aggregate check status |
|
|
61
|
+
|
|
62
|
+
## Configuration Steps
|
|
63
|
+
|
|
64
|
+
### 1. Create GitHub App
|
|
65
|
+
|
|
66
|
+
1. Go to GitHub Settings > Developer settings > GitHub Apps
|
|
67
|
+
2. Click "New GitHub App"
|
|
68
|
+
3. Fill in basic info:
|
|
69
|
+
- **Name**: Agent Relay (or your instance name)
|
|
70
|
+
- **Homepage URL**: Your dashboard URL
|
|
71
|
+
- **Webhook URL**: `https://your-domain.com/api/webhooks/github`
|
|
72
|
+
|
|
73
|
+
### 2. Set Permissions
|
|
74
|
+
|
|
75
|
+
Under "Permissions & events":
|
|
76
|
+
|
|
77
|
+
**Repository permissions:**
|
|
78
|
+
- Contents: Read and write
|
|
79
|
+
- Pull requests: Read and write
|
|
80
|
+
- Checks: Read-only
|
|
81
|
+
- Actions: Read-only
|
|
82
|
+
- Commit statuses: Read-only
|
|
83
|
+
- Metadata: Read-only (default)
|
|
84
|
+
|
|
85
|
+
**Organization permissions:**
|
|
86
|
+
- Members: Read-only
|
|
87
|
+
|
|
88
|
+
**Account permissions:**
|
|
89
|
+
- Email addresses: Read-only
|
|
90
|
+
|
|
91
|
+
### 3. Subscribe to Events
|
|
92
|
+
|
|
93
|
+
Check the following events:
|
|
94
|
+
- [x] Check run
|
|
95
|
+
- [x] Workflow run
|
|
96
|
+
- [x] Installation
|
|
97
|
+
- [x] Installation and repositories
|
|
98
|
+
- [x] Push
|
|
99
|
+
- [x] Pull request
|
|
100
|
+
|
|
101
|
+
### 4. Generate Keys
|
|
102
|
+
|
|
103
|
+
1. Generate a private key (downloads .pem file)
|
|
104
|
+
2. Note the App ID
|
|
105
|
+
3. Generate a client secret for OAuth
|
|
106
|
+
|
|
107
|
+
### 5. Configure Agent Relay
|
|
108
|
+
|
|
109
|
+
Set environment variables:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# GitHub App credentials
|
|
113
|
+
GITHUB_APP_ID=123456
|
|
114
|
+
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
|
|
115
|
+
GITHUB_CLIENT_ID=Iv1.abc123
|
|
116
|
+
GITHUB_CLIENT_SECRET=secret123
|
|
117
|
+
|
|
118
|
+
# Webhook secret (generate a random string)
|
|
119
|
+
GITHUB_WEBHOOK_SECRET=whsec_random_string_here
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Permission Rationale
|
|
123
|
+
|
|
124
|
+
### Why Contents: Write?
|
|
125
|
+
|
|
126
|
+
Agents need to push fixes to branches. This includes:
|
|
127
|
+
- Creating new commits
|
|
128
|
+
- Pushing to existing branches
|
|
129
|
+
- Creating new branches for fixes
|
|
130
|
+
|
|
131
|
+
### Why Checks: Read (not Write)?
|
|
132
|
+
|
|
133
|
+
We only receive check failure events and read results. We don't:
|
|
134
|
+
- Create our own checks
|
|
135
|
+
- Update check status
|
|
136
|
+
|
|
137
|
+
CI runs in GitHub Actions and creates its own checks.
|
|
138
|
+
|
|
139
|
+
### Why Pull Requests: Write?
|
|
140
|
+
|
|
141
|
+
Agents may need to:
|
|
142
|
+
- Comment on PRs with fix summaries
|
|
143
|
+
- Request reviews after fixes
|
|
144
|
+
- Update PR descriptions
|
|
145
|
+
|
|
146
|
+
### Why Actions: Read?
|
|
147
|
+
|
|
148
|
+
For workflow_run events that provide:
|
|
149
|
+
- Workflow-level failure context
|
|
150
|
+
- Access to workflow logs (future)
|
|
151
|
+
|
|
152
|
+
## Security Considerations
|
|
153
|
+
|
|
154
|
+
### Webhook Secret
|
|
155
|
+
|
|
156
|
+
Always configure a webhook secret:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
function verifyGitHubSignature(payload: string, signature: string, secret: string): boolean {
|
|
160
|
+
const expected = `sha256=${crypto
|
|
161
|
+
.createHmac('sha256', secret)
|
|
162
|
+
.update(payload)
|
|
163
|
+
.digest('hex')}`;
|
|
164
|
+
return crypto.timingSafeEqual(
|
|
165
|
+
Buffer.from(signature),
|
|
166
|
+
Buffer.from(expected)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Private Key Storage
|
|
172
|
+
|
|
173
|
+
- Never commit the private key to version control
|
|
174
|
+
- Use secure secret management (Vault, AWS Secrets Manager, etc.)
|
|
175
|
+
- Rotate keys periodically
|
|
176
|
+
|
|
177
|
+
### Installation Scope
|
|
178
|
+
|
|
179
|
+
When users install the app:
|
|
180
|
+
- Recommend "Only select repositories" over "All repositories"
|
|
181
|
+
- Document which repos will be monitored
|
|
182
|
+
- Allow easy un-installation
|
|
183
|
+
|
|
184
|
+
### Token Expiry
|
|
185
|
+
|
|
186
|
+
GitHub App installation tokens expire after 1 hour:
|
|
187
|
+
- Cache tokens with expiry tracking
|
|
188
|
+
- Refresh before expiration
|
|
189
|
+
- Handle 401 errors with token refresh
|
|
190
|
+
|
|
191
|
+
## Minimal Permissions Option
|
|
192
|
+
|
|
193
|
+
For users who want minimal permissions:
|
|
194
|
+
|
|
195
|
+
| Permission | Access | Notes |
|
|
196
|
+
|------------|--------|-------|
|
|
197
|
+
| Contents | Read | Can clone, cannot push |
|
|
198
|
+
| Pull requests | Read | Can read PRs, cannot comment |
|
|
199
|
+
| Checks | Read | Receive failures |
|
|
200
|
+
|
|
201
|
+
With minimal permissions:
|
|
202
|
+
- Agents can analyze failures but cannot push fixes
|
|
203
|
+
- Manual intervention required for commits
|
|
204
|
+
- Good for "notify only" mode
|
|
205
|
+
|
|
206
|
+
## Events Flow
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
┌──────────────┐ webhook ┌─────────────────┐
|
|
210
|
+
│ GitHub CI │ ──────────────────>│ Agent Relay │
|
|
211
|
+
│ (check_run │ │ /webhooks │
|
|
212
|
+
│ failed) │ └────────┬────────┘
|
|
213
|
+
└──────────────┘ │
|
|
214
|
+
│ verify signature
|
|
215
|
+
│ parse payload
|
|
216
|
+
▼
|
|
217
|
+
┌─────────────────┐
|
|
218
|
+
│ Record failure │
|
|
219
|
+
│ in database │
|
|
220
|
+
└────────┬────────┘
|
|
221
|
+
│
|
|
222
|
+
│ spawn agent
|
|
223
|
+
▼
|
|
224
|
+
┌─────────────────┐
|
|
225
|
+
│ Agent fixes │
|
|
226
|
+
│ and pushes │
|
|
227
|
+
└────────┬────────┘
|
|
228
|
+
│
|
|
229
|
+
│ uses Contents:write
|
|
230
|
+
▼
|
|
231
|
+
┌─────────────────┐
|
|
232
|
+
│ GitHub CI │
|
|
233
|
+
│ re-runs │
|
|
234
|
+
└─────────────────┘
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Troubleshooting
|
|
238
|
+
|
|
239
|
+
### Webhook Not Received
|
|
240
|
+
|
|
241
|
+
1. Check webhook URL is correct and accessible
|
|
242
|
+
2. Verify webhook secret matches configuration
|
|
243
|
+
3. Check GitHub App webhook delivery logs
|
|
244
|
+
4. Ensure firewall allows GitHub IPs
|
|
245
|
+
|
|
246
|
+
### Permission Denied Errors
|
|
247
|
+
|
|
248
|
+
1. Verify app is installed on the repository
|
|
249
|
+
2. Check installation hasn't been suspended
|
|
250
|
+
3. Confirm required permissions are granted
|
|
251
|
+
4. Regenerate installation token
|
|
252
|
+
|
|
253
|
+
### CI Events Not Triggering
|
|
254
|
+
|
|
255
|
+
1. Verify `check_run` event is subscribed
|
|
256
|
+
2. Check check is from a GitHub Action (not external CI)
|
|
257
|
+
3. Ensure webhook URL is receiving events (check delivery logs)
|
|
258
|
+
|
|
259
|
+
## References
|
|
260
|
+
|
|
261
|
+
- [GitHub Apps documentation](https://docs.github.com/en/apps)
|
|
262
|
+
- [Webhook events and payloads](https://docs.github.com/en/webhooks/webhook-events-and-payloads)
|
|
263
|
+
- [GitHub App permissions](https://docs.github.com/en/rest/overview/permissions-required-for-github-apps)
|
|
264
|
+
- [Check runs API](https://docs.github.com/en/rest/checks/runs)
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
# Agent Relay Cloud - Local Testing Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to run the complete Agent Relay Cloud stack locally for development and QA testing.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The local testing environment simulates the full cloud deployment with:
|
|
8
|
+
- **PostgreSQL** - Database for users, workspaces, metrics, crashes
|
|
9
|
+
- **Redis** - Session storage and pub/sub messaging
|
|
10
|
+
- **Cloud API Server** - Express.js control plane
|
|
11
|
+
- **Daemon Simulators** - Simulated local daemons reporting metrics
|
|
12
|
+
- **Integration Tests** - Comprehensive API tests
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
1. **Docker** (version 20.10+)
|
|
17
|
+
2. **Docker Compose** (v2.0+)
|
|
18
|
+
3. **Node.js** (v20+) - for running tests locally
|
|
19
|
+
4. **Git** - for cloning the repository
|
|
20
|
+
|
|
21
|
+
### Verify Prerequisites
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
docker --version # Should be 20.10+
|
|
25
|
+
docker compose version # Should be 2.0+
|
|
26
|
+
node --version # Should be v20+
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
### Option 1: Full QA Suite (Recommended)
|
|
32
|
+
|
|
33
|
+
Run the complete test suite with a single command:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
./scripts/run-cloud-qa.sh
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This will:
|
|
40
|
+
1. Build all Docker images
|
|
41
|
+
2. Start PostgreSQL and Redis
|
|
42
|
+
3. Start the Cloud API server
|
|
43
|
+
4. Start simulated daemons
|
|
44
|
+
5. Run integration tests
|
|
45
|
+
6. Clean up all containers
|
|
46
|
+
|
|
47
|
+
### Option 2: Manual Setup
|
|
48
|
+
|
|
49
|
+
For development and debugging, you may want to run components separately.
|
|
50
|
+
|
|
51
|
+
#### Step 1: Start Infrastructure
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Start PostgreSQL and Redis
|
|
55
|
+
docker compose -f docker-compose.test.yml up -d postgres redis
|
|
56
|
+
|
|
57
|
+
# Verify they're healthy
|
|
58
|
+
docker compose -f docker-compose.test.yml ps
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Step 2: Start Cloud Server
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Start the cloud API server
|
|
65
|
+
docker compose -f docker-compose.test.yml up -d cloud
|
|
66
|
+
|
|
67
|
+
# Check logs
|
|
68
|
+
docker compose -f docker-compose.test.yml logs -f cloud
|
|
69
|
+
|
|
70
|
+
# Verify it's running
|
|
71
|
+
curl http://localhost:3100/health
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Step 3: Start Daemon Simulators
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Start simulated daemons that report metrics
|
|
78
|
+
docker compose -f docker-compose.test.yml up -d daemon-simulator-1 daemon-simulator-2
|
|
79
|
+
|
|
80
|
+
# View simulator logs
|
|
81
|
+
docker compose -f docker-compose.test.yml logs -f daemon-simulator-1
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Step 4: Run Tests
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Run integration tests in Docker
|
|
88
|
+
docker compose -f docker-compose.test.yml --profile test run test-runner
|
|
89
|
+
|
|
90
|
+
# Or run locally
|
|
91
|
+
CLOUD_API_URL=http://localhost:3100 npm run test:integration
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Docker Compose Services
|
|
95
|
+
|
|
96
|
+
### docker-compose.test.yml
|
|
97
|
+
|
|
98
|
+
| Service | Port | Description |
|
|
99
|
+
|---------|------|-------------|
|
|
100
|
+
| `postgres` | 5433 | PostgreSQL database |
|
|
101
|
+
| `redis` | 6380 | Redis for sessions/pub-sub |
|
|
102
|
+
| `cloud` | 3100 | Cloud API server |
|
|
103
|
+
| `daemon-simulator-1` | - | Simulated daemon (3 agents, memory growth) |
|
|
104
|
+
| `daemon-simulator-2` | - | Simulated daemon (2 agents, normal) |
|
|
105
|
+
| `daemon-simulator-crash` | - | Crash simulation daemon (profile: crash-test) |
|
|
106
|
+
| `test-runner` | - | Integration test runner (profile: test) |
|
|
107
|
+
|
|
108
|
+
### docker-compose.dev.yml
|
|
109
|
+
|
|
110
|
+
For regular development (not testing):
|
|
111
|
+
|
|
112
|
+
| Service | Port | Description |
|
|
113
|
+
|---------|------|-------------|
|
|
114
|
+
| `postgres` | 5432 | PostgreSQL database |
|
|
115
|
+
| `redis` | 6379 | Redis |
|
|
116
|
+
| `cloud` | 3000 | Cloud API + Dashboard |
|
|
117
|
+
| `workspace` | 3888, 3889 | Example workspace (profile: workspace) |
|
|
118
|
+
|
|
119
|
+
## Test Modes
|
|
120
|
+
|
|
121
|
+
### Quick Smoke Test
|
|
122
|
+
|
|
123
|
+
Fast validation that the stack is working:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
./scripts/run-cloud-qa.sh --quick
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Full Integration Tests
|
|
130
|
+
|
|
131
|
+
Complete test suite with all scenarios:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
./scripts/run-cloud-qa.sh
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Keep Running After Tests
|
|
138
|
+
|
|
139
|
+
Useful for debugging:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
./scripts/run-cloud-qa.sh --keep
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Then access:
|
|
146
|
+
- Cloud API: http://localhost:3100
|
|
147
|
+
- Health check: http://localhost:3100/health
|
|
148
|
+
- Test status: http://localhost:3100/api/test/status
|
|
149
|
+
|
|
150
|
+
### Show Logs
|
|
151
|
+
|
|
152
|
+
View container logs after tests:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
./scripts/run-cloud-qa.sh --logs
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Test Infrastructure
|
|
159
|
+
|
|
160
|
+
### Daemon Simulator
|
|
161
|
+
|
|
162
|
+
Located in `test/cloud/daemon-simulator.ts`, this simulates local daemons that:
|
|
163
|
+
- Connect to the cloud API
|
|
164
|
+
- Report agent memory metrics
|
|
165
|
+
- Report crashes (configurable)
|
|
166
|
+
- Report memory alerts
|
|
167
|
+
|
|
168
|
+
Configuration via environment variables:
|
|
169
|
+
|
|
170
|
+
| Variable | Default | Description |
|
|
171
|
+
|----------|---------|-------------|
|
|
172
|
+
| `DAEMON_NAME` | test-daemon | Name of the daemon |
|
|
173
|
+
| `CLOUD_API_URL` | http://localhost:3000 | Cloud API URL |
|
|
174
|
+
| `AGENT_COUNT` | 3 | Number of agents to simulate |
|
|
175
|
+
| `REPORT_INTERVAL_MS` | 10000 | Metrics report interval |
|
|
176
|
+
| `SIMULATE_MEMORY_GROWTH` | false | Simulate memory leak |
|
|
177
|
+
| `SIMULATE_CRASH` | false | Trigger crash after delay |
|
|
178
|
+
| `CRASH_AFTER_SECONDS` | 60 | Delay before crash |
|
|
179
|
+
|
|
180
|
+
### Test Helpers API
|
|
181
|
+
|
|
182
|
+
In non-production mode, these endpoints are available:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Check if test mode is enabled
|
|
186
|
+
GET /api/test/status
|
|
187
|
+
|
|
188
|
+
# Create a test user (bypasses OAuth)
|
|
189
|
+
POST /api/test/create-user
|
|
190
|
+
Body: { "email": "test@example.com", "name": "Test User" }
|
|
191
|
+
|
|
192
|
+
# Create a test daemon with API key
|
|
193
|
+
POST /api/test/create-daemon
|
|
194
|
+
Body: { "name": "my-daemon", "machineId": "optional-machine-id" }
|
|
195
|
+
|
|
196
|
+
# Cleanup test data
|
|
197
|
+
DELETE /api/test/cleanup
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Integration Tests
|
|
201
|
+
|
|
202
|
+
Located in `test/cloud/monitoring.integration.test.ts`:
|
|
203
|
+
|
|
204
|
+
- Health check validation
|
|
205
|
+
- Metrics reporting (authenticated/unauthenticated)
|
|
206
|
+
- Crash reporting
|
|
207
|
+
- Alert reporting
|
|
208
|
+
- Dashboard API authentication
|
|
209
|
+
- Multiple daemon scenarios
|
|
210
|
+
- Alert escalation
|
|
211
|
+
- Crash pattern detection
|
|
212
|
+
|
|
213
|
+
## Running Tests Locally
|
|
214
|
+
|
|
215
|
+
### Unit Tests (Fast)
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# All unit tests
|
|
219
|
+
npm test
|
|
220
|
+
|
|
221
|
+
# Specific module
|
|
222
|
+
npm test -- src/resiliency/
|
|
223
|
+
|
|
224
|
+
# Watch mode
|
|
225
|
+
npm test -- --watch
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Integration Tests
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Start the stack first
|
|
232
|
+
docker compose -f docker-compose.test.yml up -d postgres redis cloud
|
|
233
|
+
|
|
234
|
+
# Run integration tests
|
|
235
|
+
CLOUD_API_URL=http://localhost:3100 npm run test:integration
|
|
236
|
+
|
|
237
|
+
# Or with Docker
|
|
238
|
+
docker compose -f docker-compose.test.yml --profile test run test-runner
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Coverage Report
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
npm run test:coverage
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Development Workflow
|
|
248
|
+
|
|
249
|
+
### Making Changes
|
|
250
|
+
|
|
251
|
+
1. Make code changes
|
|
252
|
+
2. Run unit tests: `npm test`
|
|
253
|
+
3. Start test stack: `docker compose -f docker-compose.test.yml up -d`
|
|
254
|
+
4. Run integration tests: `npm run test:integration`
|
|
255
|
+
5. Cleanup: `docker compose -f docker-compose.test.yml down -v`
|
|
256
|
+
|
|
257
|
+
### Debugging Cloud Server
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Start with logs
|
|
261
|
+
docker compose -f docker-compose.test.yml up cloud
|
|
262
|
+
|
|
263
|
+
# Or attach to running container
|
|
264
|
+
docker compose -f docker-compose.test.yml logs -f cloud
|
|
265
|
+
|
|
266
|
+
# Shell into container
|
|
267
|
+
docker compose -f docker-compose.test.yml exec cloud sh
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Database Access
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
# Connect to PostgreSQL
|
|
274
|
+
docker compose -f docker-compose.test.yml exec postgres psql -U agent_relay -d agent_relay_test
|
|
275
|
+
|
|
276
|
+
# View tables
|
|
277
|
+
\dt
|
|
278
|
+
|
|
279
|
+
# Query metrics
|
|
280
|
+
SELECT * FROM agent_metrics ORDER BY recorded_at DESC LIMIT 10;
|
|
281
|
+
|
|
282
|
+
# Query crashes
|
|
283
|
+
SELECT * FROM agent_crashes ORDER BY crashed_at DESC LIMIT 10;
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Redis Access
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Connect to Redis
|
|
290
|
+
docker compose -f docker-compose.test.yml exec redis redis-cli
|
|
291
|
+
|
|
292
|
+
# View keys
|
|
293
|
+
KEYS *
|
|
294
|
+
|
|
295
|
+
# Monitor pub/sub
|
|
296
|
+
SUBSCRIBE coordinator:messages
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Troubleshooting
|
|
300
|
+
|
|
301
|
+
### Container Won't Start
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# Check logs
|
|
305
|
+
docker compose -f docker-compose.test.yml logs <service-name>
|
|
306
|
+
|
|
307
|
+
# Rebuild images
|
|
308
|
+
docker compose -f docker-compose.test.yml build --no-cache
|
|
309
|
+
|
|
310
|
+
# Remove volumes and restart
|
|
311
|
+
docker compose -f docker-compose.test.yml down -v
|
|
312
|
+
docker compose -f docker-compose.test.yml up -d
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Database Connection Issues
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# Verify PostgreSQL is healthy
|
|
319
|
+
docker compose -f docker-compose.test.yml ps postgres
|
|
320
|
+
|
|
321
|
+
# Check connection from cloud container
|
|
322
|
+
docker compose -f docker-compose.test.yml exec cloud sh
|
|
323
|
+
> nc -zv postgres 5432
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Port Conflicts
|
|
327
|
+
|
|
328
|
+
If ports are already in use:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Find what's using the port
|
|
332
|
+
lsof -i :3100
|
|
333
|
+
|
|
334
|
+
# Or change ports in docker-compose.test.yml
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Memory Issues
|
|
338
|
+
|
|
339
|
+
Docker may run out of memory with many containers:
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
# Check Docker resource usage
|
|
343
|
+
docker stats
|
|
344
|
+
|
|
345
|
+
# Prune unused resources
|
|
346
|
+
docker system prune -a
|
|
347
|
+
|
|
348
|
+
# Increase Docker memory limit in Docker Desktop settings
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## CI/CD Integration
|
|
352
|
+
|
|
353
|
+
### GitHub Actions
|
|
354
|
+
|
|
355
|
+
The test suite runs in GitHub Actions. See `.github/workflows/test.yml`:
|
|
356
|
+
|
|
357
|
+
```yaml
|
|
358
|
+
- name: Run Integration Tests
|
|
359
|
+
run: |
|
|
360
|
+
docker compose -f docker-compose.test.yml up -d postgres redis cloud
|
|
361
|
+
sleep 30
|
|
362
|
+
CLOUD_API_URL=http://localhost:3100 npm run test:integration
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Local CI Simulation
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
# Simulate CI environment
|
|
369
|
+
./scripts/run-cloud-qa.sh
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Adding New Tests
|
|
373
|
+
|
|
374
|
+
### Unit Tests
|
|
375
|
+
|
|
376
|
+
1. Create `*.test.ts` file alongside the source
|
|
377
|
+
2. Use Vitest patterns (describe, it, expect)
|
|
378
|
+
3. Mock external dependencies
|
|
379
|
+
|
|
380
|
+
### Integration Tests
|
|
381
|
+
|
|
382
|
+
1. Add tests to `test/cloud/monitoring.integration.test.ts`
|
|
383
|
+
2. Use the test helper API for setup
|
|
384
|
+
3. Clean up test data in afterAll
|
|
385
|
+
|
|
386
|
+
### New Simulator Scenarios
|
|
387
|
+
|
|
388
|
+
1. Add new service to `docker-compose.test.yml`
|
|
389
|
+
2. Configure via environment variables
|
|
390
|
+
3. Use appropriate profile if optional
|
|
391
|
+
|
|
392
|
+
## Reference
|
|
393
|
+
|
|
394
|
+
### Environment Variables
|
|
395
|
+
|
|
396
|
+
**Cloud Server:**
|
|
397
|
+
- `NODE_ENV` - development/test/production
|
|
398
|
+
- `DATABASE_URL` - PostgreSQL connection string
|
|
399
|
+
- `REDIS_URL` - Redis connection string
|
|
400
|
+
- `SESSION_SECRET` - Session encryption key
|
|
401
|
+
- `RELAY_CLOUD_ENABLED` - Enable cloud features
|
|
402
|
+
- `RELAY_MEMORY_MONITORING` - Enable memory monitoring
|
|
403
|
+
|
|
404
|
+
**Test:**
|
|
405
|
+
- `CLOUD_API_URL` - Cloud server URL for tests
|
|
406
|
+
- `TEST_TIMEOUT` - Test timeout in milliseconds
|
|
407
|
+
|
|
408
|
+
### Useful Commands
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
# Full QA suite
|
|
412
|
+
./scripts/run-cloud-qa.sh
|
|
413
|
+
|
|
414
|
+
# Quick test
|
|
415
|
+
./scripts/run-cloud-qa.sh --quick
|
|
416
|
+
|
|
417
|
+
# Keep running
|
|
418
|
+
./scripts/run-cloud-qa.sh --keep
|
|
419
|
+
|
|
420
|
+
# Cleanup only
|
|
421
|
+
./scripts/run-cloud-qa.sh --cleanup
|
|
422
|
+
|
|
423
|
+
# View all containers
|
|
424
|
+
docker compose -f docker-compose.test.yml ps
|
|
425
|
+
|
|
426
|
+
# Stop everything
|
|
427
|
+
docker compose -f docker-compose.test.yml down -v
|
|
428
|
+
```
|