agent-relay 2.0.22 → 2.0.24

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.
Files changed (534) hide show
  1. package/bin/relay-pty-linux-arm64 +0 -0
  2. package/dist/src/cli/index.d.ts +3 -3
  3. package/dist/src/cli/index.js +58 -74
  4. package/package.json +21 -62
  5. package/packages/api-types/package.json +1 -1
  6. package/packages/bridge/package.json +8 -8
  7. package/packages/cli-tester/package.json +1 -1
  8. package/packages/config/package.json +2 -2
  9. package/packages/continuity/package.json +1 -1
  10. package/packages/daemon/dist/orchestrator.js +19 -1
  11. package/packages/daemon/package.json +12 -12
  12. package/packages/hooks/package.json +4 -4
  13. package/packages/mcp/package.json +2 -2
  14. package/packages/memory/package.json +2 -2
  15. package/packages/policy/package.json +2 -2
  16. package/packages/protocol/package.json +1 -1
  17. package/packages/resiliency/package.json +1 -1
  18. package/packages/sdk/package.json +2 -2
  19. package/packages/spawner/package.json +1 -1
  20. package/packages/state/package.json +1 -1
  21. package/packages/storage/package.json +2 -2
  22. package/packages/telemetry/package.json +1 -1
  23. package/packages/trajectory/package.json +2 -2
  24. package/packages/user-directory/package.json +2 -2
  25. package/packages/utils/dist/update-checker.js +4 -0
  26. package/packages/utils/package.json +1 -1
  27. package/packages/wrapper/package.json +6 -6
  28. package/deploy/init-db.sql +0 -5
  29. package/deploy/scripts/setup-fly-workspaces.sh +0 -69
  30. package/deploy/scripts/setup-railway.sh +0 -75
  31. package/deploy/workspace/codex.config.toml +0 -20
  32. package/deploy/workspace/entrypoint-browser.sh +0 -118
  33. package/deploy/workspace/entrypoint.sh +0 -612
  34. package/deploy/workspace/gh-credential-relay +0 -90
  35. package/deploy/workspace/gh-relay +0 -156
  36. package/deploy/workspace/git-credential-relay +0 -330
  37. package/deploy/workspace/git-credential-relay.test.sh +0 -230
  38. package/dist/dashboard/out/404.html +0 -1
  39. package/dist/dashboard/out/_next/static/91mkGYq3qbG8WHE6VytQ8/_buildManifest.js +0 -1
  40. package/dist/dashboard/out/_next/static/91mkGYq3qbG8WHE6VytQ8/_ssgManifest.js +0 -1
  41. package/dist/dashboard/out/_next/static/chunks/116-a883fca163f3a5bc.js +0 -1
  42. package/dist/dashboard/out/_next/static/chunks/117-c8afed19e821a35d.js +0 -2
  43. package/dist/dashboard/out/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
  44. package/dist/dashboard/out/_next/static/chunks/320-a6304232cd0ee2ce.js +0 -1
  45. package/dist/dashboard/out/_next/static/chunks/532-bace199897eeab37.js +0 -9
  46. package/dist/dashboard/out/_next/static/chunks/631-16b905e5920f9b59.js +0 -1
  47. package/dist/dashboard/out/_next/static/chunks/648-acb2ff9f77cbfbd3.js +0 -1
  48. package/dist/dashboard/out/_next/static/chunks/766-2aea80818f7eb0d8.js +0 -1
  49. package/dist/dashboard/out/_next/static/chunks/83-26d2bde54616ee90.js +0 -1
  50. package/dist/dashboard/out/_next/static/chunks/847-f1f467060f32afff.js +0 -1
  51. package/dist/dashboard/out/_next/static/chunks/891-5cb1513eeb97a891.js +0 -1
  52. package/dist/dashboard/out/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +0 -1
  53. package/dist/dashboard/out/_next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +0 -1
  54. package/dist/dashboard/out/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js +0 -1
  55. package/dist/dashboard/out/_next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +0 -1
  56. package/dist/dashboard/out/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +0 -1
  57. package/dist/dashboard/out/_next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +0 -1
  58. package/dist/dashboard/out/_next/static/chunks/app/history/page-9965d2483011b846.js +0 -1
  59. package/dist/dashboard/out/_next/static/chunks/app/layout-6b91e33784c20610.js +0 -1
  60. package/dist/dashboard/out/_next/static/chunks/app/login/page-435eceb0073be027.js +0 -1
  61. package/dist/dashboard/out/_next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +0 -1
  62. package/dist/dashboard/out/_next/static/chunks/app/page-8119d4246743574e.js +0 -1
  63. package/dist/dashboard/out/_next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +0 -1
  64. package/dist/dashboard/out/_next/static/chunks/app/providers/page-ecb16ffd3b36262b.js +0 -1
  65. package/dist/dashboard/out/_next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +0 -1
  66. package/dist/dashboard/out/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +0 -1
  67. package/dist/dashboard/out/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
  68. package/dist/dashboard/out/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
  69. package/dist/dashboard/out/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
  70. package/dist/dashboard/out/_next/static/chunks/main-311c3db74dcfadb7.js +0 -1
  71. package/dist/dashboard/out/_next/static/chunks/main-app-fdbeb09028f57c9f.js +0 -1
  72. package/dist/dashboard/out/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
  73. package/dist/dashboard/out/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
  74. package/dist/dashboard/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  75. package/dist/dashboard/out/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
  76. package/dist/dashboard/out/_next/static/css/4034f236dd1a3178.css +0 -1
  77. package/dist/dashboard/out/_next/static/css/6892f8422896ef7a.css +0 -1
  78. package/dist/dashboard/out/alt-logos/agent-relay-logo-128.png +0 -0
  79. package/dist/dashboard/out/alt-logos/agent-relay-logo-256.png +0 -0
  80. package/dist/dashboard/out/alt-logos/agent-relay-logo-32.png +0 -0
  81. package/dist/dashboard/out/alt-logos/agent-relay-logo-512.png +0 -0
  82. package/dist/dashboard/out/alt-logos/agent-relay-logo-64.png +0 -0
  83. package/dist/dashboard/out/alt-logos/agent-relay-logo.svg +0 -45
  84. package/dist/dashboard/out/alt-logos/logo.svg +0 -38
  85. package/dist/dashboard/out/alt-logos/monogram-logo-128.png +0 -0
  86. package/dist/dashboard/out/alt-logos/monogram-logo-256.png +0 -0
  87. package/dist/dashboard/out/alt-logos/monogram-logo-32.png +0 -0
  88. package/dist/dashboard/out/alt-logos/monogram-logo-512.png +0 -0
  89. package/dist/dashboard/out/alt-logos/monogram-logo-64.png +0 -0
  90. package/dist/dashboard/out/alt-logos/monogram-logo.svg +0 -38
  91. package/dist/dashboard/out/app/onboarding.html +0 -1
  92. package/dist/dashboard/out/app/onboarding.txt +0 -7
  93. package/dist/dashboard/out/app.html +0 -1
  94. package/dist/dashboard/out/app.txt +0 -7
  95. package/dist/dashboard/out/apple-icon.png +0 -0
  96. package/dist/dashboard/out/cloud/link.html +0 -1
  97. package/dist/dashboard/out/cloud/link.txt +0 -7
  98. package/dist/dashboard/out/complete-profile.html +0 -5
  99. package/dist/dashboard/out/complete-profile.txt +0 -7
  100. package/dist/dashboard/out/connect-repos.html +0 -1
  101. package/dist/dashboard/out/connect-repos.txt +0 -7
  102. package/dist/dashboard/out/history.html +0 -1
  103. package/dist/dashboard/out/history.txt +0 -7
  104. package/dist/dashboard/out/index.html +0 -1
  105. package/dist/dashboard/out/index.txt +0 -7
  106. package/dist/dashboard/out/login.html +0 -5
  107. package/dist/dashboard/out/login.txt +0 -7
  108. package/dist/dashboard/out/metrics.html +0 -1
  109. package/dist/dashboard/out/metrics.txt +0 -7
  110. package/dist/dashboard/out/pricing.html +0 -13
  111. package/dist/dashboard/out/pricing.txt +0 -7
  112. package/dist/dashboard/out/providers/setup/claude.html +0 -1
  113. package/dist/dashboard/out/providers/setup/claude.txt +0 -8
  114. package/dist/dashboard/out/providers/setup/codex.html +0 -1
  115. package/dist/dashboard/out/providers/setup/codex.txt +0 -8
  116. package/dist/dashboard/out/providers/setup/cursor.html +0 -1
  117. package/dist/dashboard/out/providers/setup/cursor.txt +0 -8
  118. package/dist/dashboard/out/providers.html +0 -1
  119. package/dist/dashboard/out/providers.txt +0 -7
  120. package/dist/dashboard/out/signup.html +0 -6
  121. package/dist/dashboard/out/signup.txt +0 -7
  122. package/dist/src/cloud/index.d.ts +0 -8
  123. package/dist/src/cloud/index.js +0 -8
  124. package/dist/src/dashboard-server/index.d.ts +0 -8
  125. package/dist/src/dashboard-server/index.js +0 -8
  126. package/packages/cloud/dist/api/admin.d.ts +0 -8
  127. package/packages/cloud/dist/api/admin.js +0 -225
  128. package/packages/cloud/dist/api/auth.d.ts +0 -20
  129. package/packages/cloud/dist/api/auth.js +0 -138
  130. package/packages/cloud/dist/api/billing.d.ts +0 -7
  131. package/packages/cloud/dist/api/billing.js +0 -564
  132. package/packages/cloud/dist/api/cli-pty-runner.d.ts +0 -53
  133. package/packages/cloud/dist/api/cli-pty-runner.js +0 -175
  134. package/packages/cloud/dist/api/codex-auth-helper.d.ts +0 -21
  135. package/packages/cloud/dist/api/codex-auth-helper.js +0 -327
  136. package/packages/cloud/dist/api/consensus.d.ts +0 -13
  137. package/packages/cloud/dist/api/consensus.js +0 -261
  138. package/packages/cloud/dist/api/coordinators.d.ts +0 -8
  139. package/packages/cloud/dist/api/coordinators.js +0 -750
  140. package/packages/cloud/dist/api/daemons.d.ts +0 -12
  141. package/packages/cloud/dist/api/daemons.js +0 -535
  142. package/packages/cloud/dist/api/email-auth.d.ts +0 -11
  143. package/packages/cloud/dist/api/email-auth.js +0 -347
  144. package/packages/cloud/dist/api/generic-webhooks.d.ts +0 -8
  145. package/packages/cloud/dist/api/generic-webhooks.js +0 -129
  146. package/packages/cloud/dist/api/git.d.ts +0 -8
  147. package/packages/cloud/dist/api/git.js +0 -269
  148. package/packages/cloud/dist/api/github-app.d.ts +0 -11
  149. package/packages/cloud/dist/api/github-app.js +0 -223
  150. package/packages/cloud/dist/api/middleware/planLimits.d.ts +0 -43
  151. package/packages/cloud/dist/api/middleware/planLimits.js +0 -202
  152. package/packages/cloud/dist/api/monitoring.d.ts +0 -11
  153. package/packages/cloud/dist/api/monitoring.js +0 -578
  154. package/packages/cloud/dist/api/nango-auth.d.ts +0 -9
  155. package/packages/cloud/dist/api/nango-auth.js +0 -741
  156. package/packages/cloud/dist/api/onboarding.d.ts +0 -15
  157. package/packages/cloud/dist/api/onboarding.js +0 -679
  158. package/packages/cloud/dist/api/policy.d.ts +0 -8
  159. package/packages/cloud/dist/api/policy.js +0 -229
  160. package/packages/cloud/dist/api/provider-env.d.ts +0 -26
  161. package/packages/cloud/dist/api/provider-env.js +0 -141
  162. package/packages/cloud/dist/api/providers.d.ts +0 -7
  163. package/packages/cloud/dist/api/providers.js +0 -574
  164. package/packages/cloud/dist/api/repos.d.ts +0 -8
  165. package/packages/cloud/dist/api/repos.js +0 -577
  166. package/packages/cloud/dist/api/sessions.d.ts +0 -11
  167. package/packages/cloud/dist/api/sessions.js +0 -302
  168. package/packages/cloud/dist/api/teams.d.ts +0 -7
  169. package/packages/cloud/dist/api/teams.js +0 -281
  170. package/packages/cloud/dist/api/test-helpers.d.ts +0 -10
  171. package/packages/cloud/dist/api/test-helpers.js +0 -745
  172. package/packages/cloud/dist/api/usage.d.ts +0 -7
  173. package/packages/cloud/dist/api/usage.js +0 -111
  174. package/packages/cloud/dist/api/webhooks.d.ts +0 -8
  175. package/packages/cloud/dist/api/webhooks.js +0 -645
  176. package/packages/cloud/dist/api/workspaces.d.ts +0 -25
  177. package/packages/cloud/dist/api/workspaces.js +0 -1799
  178. package/packages/cloud/dist/billing/index.d.ts +0 -9
  179. package/packages/cloud/dist/billing/index.js +0 -9
  180. package/packages/cloud/dist/billing/plans.d.ts +0 -39
  181. package/packages/cloud/dist/billing/plans.js +0 -245
  182. package/packages/cloud/dist/billing/service.d.ts +0 -80
  183. package/packages/cloud/dist/billing/service.js +0 -388
  184. package/packages/cloud/dist/billing/types.d.ts +0 -141
  185. package/packages/cloud/dist/billing/types.js +0 -7
  186. package/packages/cloud/dist/config.d.ts +0 -5
  187. package/packages/cloud/dist/config.js +0 -5
  188. package/packages/cloud/dist/db/bulk-ingest.d.ts +0 -89
  189. package/packages/cloud/dist/db/bulk-ingest.js +0 -268
  190. package/packages/cloud/dist/db/drizzle.d.ts +0 -290
  191. package/packages/cloud/dist/db/drizzle.js +0 -1422
  192. package/packages/cloud/dist/db/index.d.ts +0 -56
  193. package/packages/cloud/dist/db/index.js +0 -70
  194. package/packages/cloud/dist/db/schema.d.ts +0 -5117
  195. package/packages/cloud/dist/db/schema.js +0 -656
  196. package/packages/cloud/dist/index.d.ts +0 -11
  197. package/packages/cloud/dist/index.js +0 -38
  198. package/packages/cloud/dist/provisioner/index.d.ts +0 -207
  199. package/packages/cloud/dist/provisioner/index.js +0 -2118
  200. package/packages/cloud/dist/server.d.ts +0 -17
  201. package/packages/cloud/dist/server.js +0 -2034
  202. package/packages/cloud/dist/services/auto-scaler.d.ts +0 -152
  203. package/packages/cloud/dist/services/auto-scaler.js +0 -439
  204. package/packages/cloud/dist/services/capacity-manager.d.ts +0 -148
  205. package/packages/cloud/dist/services/capacity-manager.js +0 -449
  206. package/packages/cloud/dist/services/ci-agent-spawner.d.ts +0 -49
  207. package/packages/cloud/dist/services/ci-agent-spawner.js +0 -373
  208. package/packages/cloud/dist/services/cloud-message-bus.d.ts +0 -28
  209. package/packages/cloud/dist/services/cloud-message-bus.js +0 -19
  210. package/packages/cloud/dist/services/compute-enforcement.d.ts +0 -57
  211. package/packages/cloud/dist/services/compute-enforcement.js +0 -175
  212. package/packages/cloud/dist/services/coordinator.d.ts +0 -62
  213. package/packages/cloud/dist/services/coordinator.js +0 -389
  214. package/packages/cloud/dist/services/index.d.ts +0 -17
  215. package/packages/cloud/dist/services/index.js +0 -25
  216. package/packages/cloud/dist/services/intro-expiration.d.ts +0 -60
  217. package/packages/cloud/dist/services/intro-expiration.js +0 -252
  218. package/packages/cloud/dist/services/mention-handler.d.ts +0 -65
  219. package/packages/cloud/dist/services/mention-handler.js +0 -405
  220. package/packages/cloud/dist/services/nango.d.ts +0 -219
  221. package/packages/cloud/dist/services/nango.js +0 -424
  222. package/packages/cloud/dist/services/persistence.d.ts +0 -131
  223. package/packages/cloud/dist/services/persistence.js +0 -200
  224. package/packages/cloud/dist/services/planLimits.d.ts +0 -147
  225. package/packages/cloud/dist/services/planLimits.js +0 -335
  226. package/packages/cloud/dist/services/presence-registry.d.ts +0 -56
  227. package/packages/cloud/dist/services/presence-registry.js +0 -91
  228. package/packages/cloud/dist/services/scaling-orchestrator.d.ts +0 -159
  229. package/packages/cloud/dist/services/scaling-orchestrator.js +0 -502
  230. package/packages/cloud/dist/services/scaling-policy.d.ts +0 -121
  231. package/packages/cloud/dist/services/scaling-policy.js +0 -415
  232. package/packages/cloud/dist/services/ssh-security.d.ts +0 -31
  233. package/packages/cloud/dist/services/ssh-security.js +0 -63
  234. package/packages/cloud/dist/services/workspace-keepalive.d.ts +0 -76
  235. package/packages/cloud/dist/services/workspace-keepalive.js +0 -234
  236. package/packages/cloud/dist/shims/consensus.d.ts +0 -23
  237. package/packages/cloud/dist/shims/consensus.js +0 -5
  238. package/packages/cloud/dist/webhooks/index.d.ts +0 -24
  239. package/packages/cloud/dist/webhooks/index.js +0 -29
  240. package/packages/cloud/dist/webhooks/parsers/github.d.ts +0 -8
  241. package/packages/cloud/dist/webhooks/parsers/github.js +0 -234
  242. package/packages/cloud/dist/webhooks/parsers/index.d.ts +0 -23
  243. package/packages/cloud/dist/webhooks/parsers/index.js +0 -30
  244. package/packages/cloud/dist/webhooks/parsers/linear.d.ts +0 -9
  245. package/packages/cloud/dist/webhooks/parsers/linear.js +0 -258
  246. package/packages/cloud/dist/webhooks/parsers/slack.d.ts +0 -9
  247. package/packages/cloud/dist/webhooks/parsers/slack.js +0 -214
  248. package/packages/cloud/dist/webhooks/responders/github.d.ts +0 -8
  249. package/packages/cloud/dist/webhooks/responders/github.js +0 -73
  250. package/packages/cloud/dist/webhooks/responders/index.d.ts +0 -23
  251. package/packages/cloud/dist/webhooks/responders/index.js +0 -30
  252. package/packages/cloud/dist/webhooks/responders/linear.d.ts +0 -9
  253. package/packages/cloud/dist/webhooks/responders/linear.js +0 -149
  254. package/packages/cloud/dist/webhooks/responders/slack.d.ts +0 -20
  255. package/packages/cloud/dist/webhooks/responders/slack.js +0 -178
  256. package/packages/cloud/dist/webhooks/router.d.ts +0 -25
  257. package/packages/cloud/dist/webhooks/router.js +0 -504
  258. package/packages/cloud/dist/webhooks/rules-engine.d.ts +0 -24
  259. package/packages/cloud/dist/webhooks/rules-engine.js +0 -287
  260. package/packages/cloud/dist/webhooks/types.d.ts +0 -186
  261. package/packages/cloud/dist/webhooks/types.js +0 -8
  262. package/packages/cloud/package.json +0 -60
  263. package/packages/dashboard/README.md +0 -48
  264. package/packages/dashboard/dist/health-worker-manager.d.ts +0 -62
  265. package/packages/dashboard/dist/health-worker-manager.js +0 -144
  266. package/packages/dashboard/dist/health-worker.d.ts +0 -9
  267. package/packages/dashboard/dist/health-worker.js +0 -79
  268. package/packages/dashboard/dist/index.d.ts +0 -20
  269. package/packages/dashboard/dist/index.js +0 -19
  270. package/packages/dashboard/dist/metrics.d.ts +0 -105
  271. package/packages/dashboard/dist/metrics.js +0 -193
  272. package/packages/dashboard/dist/needs-attention.d.ts +0 -24
  273. package/packages/dashboard/dist/needs-attention.js +0 -78
  274. package/packages/dashboard/dist/server.d.ts +0 -25
  275. package/packages/dashboard/dist/server.js +0 -5270
  276. package/packages/dashboard/dist/start.d.ts +0 -6
  277. package/packages/dashboard/dist/start.js +0 -13
  278. package/packages/dashboard/dist/types/threading.d.ts +0 -8
  279. package/packages/dashboard/dist/types/threading.js +0 -2
  280. package/packages/dashboard/dist/user-bridge.d.ts +0 -154
  281. package/packages/dashboard/dist/user-bridge.js +0 -372
  282. package/packages/dashboard/package.json +0 -65
  283. package/packages/dashboard/ui/app/app/onboarding/page.tsx +0 -394
  284. package/packages/dashboard/ui/app/app/page.tsx +0 -667
  285. package/packages/dashboard/ui/app/apple-icon.png +0 -0
  286. package/packages/dashboard/ui/app/cloud/link/page.tsx +0 -464
  287. package/packages/dashboard/ui/app/complete-profile/page.tsx +0 -204
  288. package/packages/dashboard/ui/app/connect-repos/page.tsx +0 -410
  289. package/packages/dashboard/ui/app/favicon.png +0 -0
  290. package/packages/dashboard/ui/app/globals.css +0 -59
  291. package/packages/dashboard/ui/app/history/page.tsx +0 -658
  292. package/packages/dashboard/ui/app/layout.tsx +0 -25
  293. package/packages/dashboard/ui/app/login/page.tsx +0 -424
  294. package/packages/dashboard/ui/app/metrics/page.tsx +0 -751
  295. package/packages/dashboard/ui/app/page.tsx +0 -59
  296. package/packages/dashboard/ui/app/pricing/page.tsx +0 -7
  297. package/packages/dashboard/ui/app/providers/page.tsx +0 -193
  298. package/packages/dashboard/ui/app/providers/setup/[provider]/ProviderSetupClient.tsx +0 -148
  299. package/packages/dashboard/ui/app/providers/setup/[provider]/constants.ts +0 -35
  300. package/packages/dashboard/ui/app/providers/setup/[provider]/page.tsx +0 -42
  301. package/packages/dashboard/ui/app/signup/page.tsx +0 -533
  302. package/packages/dashboard/ui/index.ts +0 -49
  303. package/packages/dashboard/ui/landing/LandingPage.tsx +0 -713
  304. package/packages/dashboard/ui/landing/PricingPage.tsx +0 -559
  305. package/packages/dashboard/ui/landing/index.ts +0 -6
  306. package/packages/dashboard/ui/landing/styles.css +0 -2850
  307. package/packages/dashboard/ui/lib/agent-merge.ts +0 -35
  308. package/packages/dashboard/ui/lib/api.ts +0 -1155
  309. package/packages/dashboard/ui/lib/cloudApi.ts +0 -877
  310. package/packages/dashboard/ui/lib/colors.ts +0 -218
  311. package/packages/dashboard/ui/lib/hierarchy.ts +0 -242
  312. package/packages/dashboard/ui/lib/stuckDetection.ts +0 -142
  313. package/packages/dashboard/ui/next-env.d.ts +0 -5
  314. package/packages/dashboard/ui/next.config.js +0 -41
  315. package/packages/dashboard/ui/package-lock.json +0 -2882
  316. package/packages/dashboard/ui/package.json +0 -33
  317. package/packages/dashboard/ui/postcss.config.js +0 -5
  318. package/packages/dashboard/ui/react-components/ActivityFeed.tsx +0 -216
  319. package/packages/dashboard/ui/react-components/AddWorkspaceModal.tsx +0 -170
  320. package/packages/dashboard/ui/react-components/AgentCard.tsx +0 -587
  321. package/packages/dashboard/ui/react-components/AgentList.tsx +0 -411
  322. package/packages/dashboard/ui/react-components/AgentProfilePanel.tsx +0 -564
  323. package/packages/dashboard/ui/react-components/App.tsx +0 -3033
  324. package/packages/dashboard/ui/react-components/BillingPanel.tsx +0 -922
  325. package/packages/dashboard/ui/react-components/BillingResult.tsx +0 -447
  326. package/packages/dashboard/ui/react-components/BroadcastComposer.tsx +0 -690
  327. package/packages/dashboard/ui/react-components/ChannelAdminPanel.tsx +0 -773
  328. package/packages/dashboard/ui/react-components/ChannelBrowser.tsx +0 -385
  329. package/packages/dashboard/ui/react-components/ChannelChat.tsx +0 -261
  330. package/packages/dashboard/ui/react-components/ChannelSidebar.tsx +0 -399
  331. package/packages/dashboard/ui/react-components/CloudSessionProvider.tsx +0 -130
  332. package/packages/dashboard/ui/react-components/CommandPalette.tsx +0 -815
  333. package/packages/dashboard/ui/react-components/ConfirmationDialog.tsx +0 -133
  334. package/packages/dashboard/ui/react-components/ConversationHistory.tsx +0 -518
  335. package/packages/dashboard/ui/react-components/CoordinatorPanel.tsx +0 -944
  336. package/packages/dashboard/ui/react-components/DecisionQueue.tsx +0 -717
  337. package/packages/dashboard/ui/react-components/DirectMessageView.tsx +0 -164
  338. package/packages/dashboard/ui/react-components/FileAutocomplete.tsx +0 -368
  339. package/packages/dashboard/ui/react-components/FleetOverview.tsx +0 -278
  340. package/packages/dashboard/ui/react-components/LogViewer.tsx +0 -310
  341. package/packages/dashboard/ui/react-components/LogViewerPanel.tsx +0 -482
  342. package/packages/dashboard/ui/react-components/Logo.tsx +0 -284
  343. package/packages/dashboard/ui/react-components/MentionAutocomplete.tsx +0 -384
  344. package/packages/dashboard/ui/react-components/MessageComposer.tsx +0 -457
  345. package/packages/dashboard/ui/react-components/MessageList.tsx +0 -649
  346. package/packages/dashboard/ui/react-components/MessageSenderName.tsx +0 -91
  347. package/packages/dashboard/ui/react-components/MessageStatusIndicator.tsx +0 -142
  348. package/packages/dashboard/ui/react-components/NewConversationModal.tsx +0 -400
  349. package/packages/dashboard/ui/react-components/NotificationToast.tsx +0 -488
  350. package/packages/dashboard/ui/react-components/OnlineUsersIndicator.tsx +0 -164
  351. package/packages/dashboard/ui/react-components/Pagination.tsx +0 -124
  352. package/packages/dashboard/ui/react-components/PricingPlans.tsx +0 -386
  353. package/packages/dashboard/ui/react-components/ProjectList.tsx +0 -625
  354. package/packages/dashboard/ui/react-components/ProviderAuthFlow.tsx +0 -853
  355. package/packages/dashboard/ui/react-components/ProviderConnectionList.tsx +0 -378
  356. package/packages/dashboard/ui/react-components/ProvisioningProgress.tsx +0 -730
  357. package/packages/dashboard/ui/react-components/RepoAccessPanel.tsx +0 -549
  358. package/packages/dashboard/ui/react-components/ServerCard.tsx +0 -202
  359. package/packages/dashboard/ui/react-components/SessionExpiredModal.tsx +0 -128
  360. package/packages/dashboard/ui/react-components/SpawnModal.tsx +0 -804
  361. package/packages/dashboard/ui/react-components/TaskAssignmentUI.tsx +0 -375
  362. package/packages/dashboard/ui/react-components/TerminalProviderSetup.tsx +0 -608
  363. package/packages/dashboard/ui/react-components/ThemeProvider.tsx +0 -325
  364. package/packages/dashboard/ui/react-components/ThinkingIndicator.tsx +0 -231
  365. package/packages/dashboard/ui/react-components/ThreadList.tsx +0 -198
  366. package/packages/dashboard/ui/react-components/ThreadPanel.tsx +0 -346
  367. package/packages/dashboard/ui/react-components/TrajectoryViewer.tsx +0 -698
  368. package/packages/dashboard/ui/react-components/TypingIndicator.tsx +0 -69
  369. package/packages/dashboard/ui/react-components/UsageBanner.tsx +0 -231
  370. package/packages/dashboard/ui/react-components/UserProfilePanel.tsx +0 -233
  371. package/packages/dashboard/ui/react-components/WorkspaceContext.tsx +0 -107
  372. package/packages/dashboard/ui/react-components/WorkspaceSelector.tsx +0 -234
  373. package/packages/dashboard/ui/react-components/WorkspaceStatusIndicator.tsx +0 -370
  374. package/packages/dashboard/ui/react-components/XTermInteractive.tsx +0 -510
  375. package/packages/dashboard/ui/react-components/XTermLogViewer.tsx +0 -719
  376. package/packages/dashboard/ui/react-components/channels/ChannelDialogs.tsx +0 -1411
  377. package/packages/dashboard/ui/react-components/channels/ChannelHeader.tsx +0 -317
  378. package/packages/dashboard/ui/react-components/channels/ChannelMessageList.tsx +0 -463
  379. package/packages/dashboard/ui/react-components/channels/ChannelViewV1.tsx +0 -146
  380. package/packages/dashboard/ui/react-components/channels/MessageInput.tsx +0 -288
  381. package/packages/dashboard/ui/react-components/channels/SearchInput.tsx +0 -172
  382. package/packages/dashboard/ui/react-components/channels/SearchResults.tsx +0 -336
  383. package/packages/dashboard/ui/react-components/channels/api.ts +0 -697
  384. package/packages/dashboard/ui/react-components/channels/index.ts +0 -76
  385. package/packages/dashboard/ui/react-components/channels/mockApi.ts +0 -344
  386. package/packages/dashboard/ui/react-components/channels/types.ts +0 -566
  387. package/packages/dashboard/ui/react-components/hooks/index.ts +0 -57
  388. package/packages/dashboard/ui/react-components/hooks/useAgentLogs.ts +0 -394
  389. package/packages/dashboard/ui/react-components/hooks/useAgents.ts +0 -127
  390. package/packages/dashboard/ui/react-components/hooks/useBroadcastDedup.ts +0 -86
  391. package/packages/dashboard/ui/react-components/hooks/useChannelAdmin.ts +0 -329
  392. package/packages/dashboard/ui/react-components/hooks/useChannelBrowser.ts +0 -239
  393. package/packages/dashboard/ui/react-components/hooks/useChannelCommands.ts +0 -138
  394. package/packages/dashboard/ui/react-components/hooks/useChannels.ts +0 -328
  395. package/packages/dashboard/ui/react-components/hooks/useDebounce.ts +0 -29
  396. package/packages/dashboard/ui/react-components/hooks/useDirectMessage.ts +0 -141
  397. package/packages/dashboard/ui/react-components/hooks/useMessages.ts +0 -309
  398. package/packages/dashboard/ui/react-components/hooks/useOrchestrator.ts +0 -364
  399. package/packages/dashboard/ui/react-components/hooks/usePinnedAgents.ts +0 -140
  400. package/packages/dashboard/ui/react-components/hooks/usePresence.ts +0 -340
  401. package/packages/dashboard/ui/react-components/hooks/useRecentRepos.ts +0 -130
  402. package/packages/dashboard/ui/react-components/hooks/useSession.ts +0 -209
  403. package/packages/dashboard/ui/react-components/hooks/useTrajectory.ts +0 -265
  404. package/packages/dashboard/ui/react-components/hooks/useWebSocket.ts +0 -169
  405. package/packages/dashboard/ui/react-components/hooks/useWorkspaceMembers.ts +0 -120
  406. package/packages/dashboard/ui/react-components/hooks/useWorkspaceRepos.ts +0 -73
  407. package/packages/dashboard/ui/react-components/hooks/useWorkspaceStatus.ts +0 -237
  408. package/packages/dashboard/ui/react-components/index.ts +0 -81
  409. package/packages/dashboard/ui/react-components/layout/Header.tsx +0 -355
  410. package/packages/dashboard/ui/react-components/layout/RepoContextHeader.tsx +0 -361
  411. package/packages/dashboard/ui/react-components/layout/Sidebar.archive.test.tsx +0 -126
  412. package/packages/dashboard/ui/react-components/layout/Sidebar.test.tsx +0 -691
  413. package/packages/dashboard/ui/react-components/layout/Sidebar.tsx +0 -930
  414. package/packages/dashboard/ui/react-components/layout/index.ts +0 -7
  415. package/packages/dashboard/ui/react-components/settings/BillingSettingsPanel.tsx +0 -564
  416. package/packages/dashboard/ui/react-components/settings/SettingsPage.tsx +0 -544
  417. package/packages/dashboard/ui/react-components/settings/TeamSettingsPanel.tsx +0 -560
  418. package/packages/dashboard/ui/react-components/settings/WorkspaceSettingsPanel.tsx +0 -1386
  419. package/packages/dashboard/ui/react-components/settings/index.ts +0 -11
  420. package/packages/dashboard/ui/react-components/settings/types.ts +0 -53
  421. package/packages/dashboard/ui/react-components/utils/messageFormatting.tsx +0 -370
  422. package/packages/dashboard/ui/tailwind.config.js +0 -148
  423. package/packages/dashboard/ui/types/index.ts +0 -304
  424. package/packages/dashboard/ui/types/threading.ts +0 -7
  425. package/packages/dashboard/ui-dist/404.html +0 -1
  426. package/packages/dashboard/ui-dist/_next/static/91mkGYq3qbG8WHE6VytQ8/_buildManifest.js +0 -1
  427. package/packages/dashboard/ui-dist/_next/static/91mkGYq3qbG8WHE6VytQ8/_ssgManifest.js +0 -1
  428. package/packages/dashboard/ui-dist/_next/static/T2rV14eEU5OweDeV29SvG/_buildManifest.js +0 -1
  429. package/packages/dashboard/ui-dist/_next/static/T2rV14eEU5OweDeV29SvG/_ssgManifest.js +0 -1
  430. package/packages/dashboard/ui-dist/_next/static/chunks/116-a883fca163f3a5bc.js +0 -1
  431. package/packages/dashboard/ui-dist/_next/static/chunks/117-c8afed19e821a35d.js +0 -2
  432. package/packages/dashboard/ui-dist/_next/static/chunks/282-980c2eb8fff20123.js +0 -1
  433. package/packages/dashboard/ui-dist/_next/static/chunks/320-a6304232cd0ee2ce.js +0 -1
  434. package/packages/dashboard/ui-dist/_next/static/chunks/532-bace199897eeab37.js +0 -9
  435. package/packages/dashboard/ui-dist/_next/static/chunks/631-16b905e5920f9b59.js +0 -1
  436. package/packages/dashboard/ui-dist/_next/static/chunks/648-acb2ff9f77cbfbd3.js +0 -1
  437. package/packages/dashboard/ui-dist/_next/static/chunks/766-2aea80818f7eb0d8.js +0 -1
  438. package/packages/dashboard/ui-dist/_next/static/chunks/83-26d2bde54616ee90.js +0 -1
  439. package/packages/dashboard/ui-dist/_next/static/chunks/847-f1f467060f32afff.js +0 -1
  440. package/packages/dashboard/ui-dist/_next/static/chunks/891-5cb1513eeb97a891.js +0 -1
  441. package/packages/dashboard/ui-dist/_next/static/chunks/app/_not-found/page-60501fddbafba9dc.js +0 -1
  442. package/packages/dashboard/ui-dist/_next/static/chunks/app/app/onboarding/page-9914652442f7e4fb.js +0 -1
  443. package/packages/dashboard/ui-dist/_next/static/chunks/app/app/page-366fb7c078d4e9e0.js +0 -1
  444. package/packages/dashboard/ui-dist/_next/static/chunks/app/cloud/link/page-fa1d5842aa90e8a6.js +0 -1
  445. package/packages/dashboard/ui-dist/_next/static/chunks/app/complete-profile/page-dd64bbdf66b639cd.js +0 -1
  446. package/packages/dashboard/ui-dist/_next/static/chunks/app/connect-repos/page-113060009ef35bc2.js +0 -1
  447. package/packages/dashboard/ui-dist/_next/static/chunks/app/history/page-9965d2483011b846.js +0 -1
  448. package/packages/dashboard/ui-dist/_next/static/chunks/app/layout-6b91e33784c20610.js +0 -1
  449. package/packages/dashboard/ui-dist/_next/static/chunks/app/login/page-435eceb0073be027.js +0 -1
  450. package/packages/dashboard/ui-dist/_next/static/chunks/app/metrics/page-1e37ef8e73940b40.js +0 -1
  451. package/packages/dashboard/ui-dist/_next/static/chunks/app/page-8119d4246743574e.js +0 -1
  452. package/packages/dashboard/ui-dist/_next/static/chunks/app/pricing/page-9db3ebdfa567a7c9.js +0 -1
  453. package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/page-ecb16ffd3b36262b.js +0 -1
  454. package/packages/dashboard/ui-dist/_next/static/chunks/app/providers/setup/[provider]/page-4dbe33f0f7691b7c.js +0 -1
  455. package/packages/dashboard/ui-dist/_next/static/chunks/app/signup/page-c7a0a28341365ae0.js +0 -1
  456. package/packages/dashboard/ui-dist/_next/static/chunks/e868780c-48e5f147c90a3a41.js +0 -18
  457. package/packages/dashboard/ui-dist/_next/static/chunks/fd9d1056-609918ca7b6280bb.js +0 -1
  458. package/packages/dashboard/ui-dist/_next/static/chunks/framework-f66176bb897dc684.js +0 -1
  459. package/packages/dashboard/ui-dist/_next/static/chunks/main-311c3db74dcfadb7.js +0 -1
  460. package/packages/dashboard/ui-dist/_next/static/chunks/main-app-fdbeb09028f57c9f.js +0 -1
  461. package/packages/dashboard/ui-dist/_next/static/chunks/pages/_app-72b849fbd24ac258.js +0 -1
  462. package/packages/dashboard/ui-dist/_next/static/chunks/pages/_error-7ba65e1336b92748.js +0 -1
  463. package/packages/dashboard/ui-dist/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
  464. package/packages/dashboard/ui-dist/_next/static/chunks/webpack-1cdd8ed57114d5e1.js +0 -1
  465. package/packages/dashboard/ui-dist/_next/static/css/4034f236dd1a3178.css +0 -1
  466. package/packages/dashboard/ui-dist/_next/static/css/6892f8422896ef7a.css +0 -1
  467. package/packages/dashboard/ui-dist/_next/static/l8L2OscDSR2vsMIlWcC48/_buildManifest.js +0 -1
  468. package/packages/dashboard/ui-dist/_next/static/l8L2OscDSR2vsMIlWcC48/_ssgManifest.js +0 -1
  469. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-128.png +0 -0
  470. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-256.png +0 -0
  471. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-32.png +0 -0
  472. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-512.png +0 -0
  473. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo-64.png +0 -0
  474. package/packages/dashboard/ui-dist/alt-logos/agent-relay-logo.svg +0 -45
  475. package/packages/dashboard/ui-dist/alt-logos/logo.svg +0 -38
  476. package/packages/dashboard/ui-dist/alt-logos/monogram-logo-128.png +0 -0
  477. package/packages/dashboard/ui-dist/alt-logos/monogram-logo-256.png +0 -0
  478. package/packages/dashboard/ui-dist/alt-logos/monogram-logo-32.png +0 -0
  479. package/packages/dashboard/ui-dist/alt-logos/monogram-logo-512.png +0 -0
  480. package/packages/dashboard/ui-dist/alt-logos/monogram-logo-64.png +0 -0
  481. package/packages/dashboard/ui-dist/alt-logos/monogram-logo.svg +0 -38
  482. package/packages/dashboard/ui-dist/app/onboarding.html +0 -1
  483. package/packages/dashboard/ui-dist/app/onboarding.txt +0 -7
  484. package/packages/dashboard/ui-dist/app.html +0 -1
  485. package/packages/dashboard/ui-dist/app.txt +0 -7
  486. package/packages/dashboard/ui-dist/apple-icon.png +0 -0
  487. package/packages/dashboard/ui-dist/cloud/link.html +0 -1
  488. package/packages/dashboard/ui-dist/cloud/link.txt +0 -7
  489. package/packages/dashboard/ui-dist/complete-profile.html +0 -5
  490. package/packages/dashboard/ui-dist/complete-profile.txt +0 -7
  491. package/packages/dashboard/ui-dist/connect-repos.html +0 -1
  492. package/packages/dashboard/ui-dist/connect-repos.txt +0 -7
  493. package/packages/dashboard/ui-dist/history.html +0 -1
  494. package/packages/dashboard/ui-dist/history.txt +0 -7
  495. package/packages/dashboard/ui-dist/index.html +0 -1
  496. package/packages/dashboard/ui-dist/index.txt +0 -7
  497. package/packages/dashboard/ui-dist/login.html +0 -5
  498. package/packages/dashboard/ui-dist/login.txt +0 -7
  499. package/packages/dashboard/ui-dist/metrics.html +0 -1
  500. package/packages/dashboard/ui-dist/metrics.txt +0 -7
  501. package/packages/dashboard/ui-dist/pricing.html +0 -13
  502. package/packages/dashboard/ui-dist/pricing.txt +0 -7
  503. package/packages/dashboard/ui-dist/providers/setup/claude.html +0 -1
  504. package/packages/dashboard/ui-dist/providers/setup/claude.txt +0 -8
  505. package/packages/dashboard/ui-dist/providers/setup/codex.html +0 -1
  506. package/packages/dashboard/ui-dist/providers/setup/codex.txt +0 -8
  507. package/packages/dashboard/ui-dist/providers/setup/cursor.html +0 -1
  508. package/packages/dashboard/ui-dist/providers/setup/cursor.txt +0 -8
  509. package/packages/dashboard/ui-dist/providers.html +0 -1
  510. package/packages/dashboard/ui-dist/providers.txt +0 -7
  511. package/packages/dashboard/ui-dist/signup.html +0 -6
  512. package/packages/dashboard/ui-dist/signup.txt +0 -7
  513. package/packages/dashboard-server/dist/health-worker-manager.d.ts +0 -62
  514. package/packages/dashboard-server/dist/health-worker-manager.js +0 -144
  515. package/packages/dashboard-server/dist/health-worker.d.ts +0 -9
  516. package/packages/dashboard-server/dist/health-worker.js +0 -79
  517. package/packages/dashboard-server/dist/index.d.ts +0 -18
  518. package/packages/dashboard-server/dist/index.js +0 -17
  519. package/packages/dashboard-server/dist/metrics.d.ts +0 -105
  520. package/packages/dashboard-server/dist/metrics.js +0 -193
  521. package/packages/dashboard-server/dist/needs-attention.d.ts +0 -24
  522. package/packages/dashboard-server/dist/needs-attention.js +0 -78
  523. package/packages/dashboard-server/dist/server.d.ts +0 -25
  524. package/packages/dashboard-server/dist/server.js +0 -5158
  525. package/packages/dashboard-server/dist/start.d.ts +0 -6
  526. package/packages/dashboard-server/dist/start.js +0 -13
  527. package/packages/dashboard-server/dist/types/threading.d.ts +0 -8
  528. package/packages/dashboard-server/dist/types/threading.js +0 -2
  529. package/packages/dashboard-server/dist/user-bridge.d.ts +0 -158
  530. package/packages/dashboard-server/dist/user-bridge.js +0 -390
  531. package/packages/dashboard-server/package.json +0 -55
  532. package/scripts/run-migrations.js +0 -43
  533. package/scripts/setup-stripe-products.ts +0 -312
  534. package/scripts/verify-schema.js +0 -134
@@ -1,679 +0,0 @@
1
- /**
2
- * Onboarding API Routes
3
- *
4
- * Handles CLI proxy authentication for Claude Code and other providers.
5
- * Spawns CLI tools via PTY to get auth URLs, captures tokens.
6
- *
7
- * Uses relay-pty binary for PTY emulation, which provides:
8
- * 1. TTY detection for CLIs that behave differently in non-TTY
9
- * 2. Proper interactive OAuth flow handling
10
- * 3. Better Node.js version compatibility (no native compilation)
11
- */
12
- import { Router } from 'express';
13
- import * as crypto from 'crypto';
14
- import { requireAuth } from './auth.js';
15
- import { db } from '../db/index.js';
16
- import { setProviderApiKeyEnv } from './provider-env.js';
17
- // Import for local use
18
- import { CLI_AUTH_CONFIG, runCLIAuthViaPTY, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, validateAllProviderConfigs, getSupportedProviders, } from './cli-pty-runner.js';
19
- // Re-export from shared module for backward compatibility
20
- export { CLI_AUTH_CONFIG, runCLIAuthViaPTY, stripAnsiCodes, matchesSuccessPattern, findMatchingPrompt, validateProviderConfig, validateAllProviderConfigs, getSupportedProviders, };
21
- export const onboardingRouter = Router();
22
- // Debug: log all requests to this router
23
- onboardingRouter.use((req, res, next) => {
24
- console.log(`[onboarding] ${req.method} ${req.path} - body:`, JSON.stringify(req.body));
25
- next();
26
- });
27
- // All routes require authentication
28
- onboardingRouter.use(requireAuth);
29
- const activeSessions = new Map();
30
- // Clean up old sessions periodically
31
- setInterval(() => {
32
- const now = Date.now();
33
- activeSessions.forEach((session, id) => {
34
- // Remove sessions older than 10 minutes
35
- if (now - session.createdAt.getTime() > 10 * 60 * 1000) {
36
- if (session.process) {
37
- try {
38
- session.process.kill();
39
- }
40
- catch {
41
- // Process may already be dead
42
- }
43
- }
44
- activeSessions.delete(id);
45
- }
46
- });
47
- }, 60000);
48
- /**
49
- * POST /api/onboarding/cli/:provider/start
50
- * Start CLI-based auth - forwards to workspace daemon if available
51
- *
52
- * CLI auth requires a running workspace since CLI tools are installed there.
53
- * For onboarding without a workspace, users should use the API key flow.
54
- */
55
- onboardingRouter.post('/cli/:provider/start', async (req, res) => {
56
- console.log('[onboarding] Route handler entered! provider:', req.params.provider);
57
- const provider = req.params.provider;
58
- const userId = req.session.userId;
59
- const { workspaceId, useDeviceFlow: requestedDeviceFlow } = req.body; // Optional: specific workspace, device flow option
60
- // Device flow is only used if explicitly requested by the client
61
- // Standard flow: user runs `codex-auth` CLI locally to capture OAuth callback and forward to cloud
62
- const config = CLI_AUTH_CONFIG[provider];
63
- const useDeviceFlow = requestedDeviceFlow ?? false;
64
- console.log('[onboarding] userId:', userId, 'workspaceId:', workspaceId, 'useDeviceFlow:', useDeviceFlow);
65
- if (!config) {
66
- return res.status(400).json({
67
- error: 'Provider not supported for CLI auth',
68
- supportedProviders: Object.keys(CLI_AUTH_CONFIG),
69
- });
70
- }
71
- try {
72
- // Find a running workspace to use for CLI auth
73
- let workspace;
74
- if (workspaceId) {
75
- workspace = await db.workspaces.findById(workspaceId);
76
- if (!workspace) {
77
- console.log(`[onboarding] Workspace ${workspaceId} not found in database`);
78
- return res.status(404).json({ error: 'Workspace not found' });
79
- }
80
- if (workspace.userId !== userId) {
81
- console.log(`[onboarding] Workspace ${workspaceId} belongs to ${workspace.userId}, not ${userId}`);
82
- return res.status(404).json({ error: 'Workspace not found' });
83
- }
84
- }
85
- else {
86
- // Find any running workspace for this user
87
- const workspaces = await db.workspaces.findByUserId(userId);
88
- workspace = workspaces.find(w => w.status === 'running' && w.publicUrl);
89
- }
90
- if (!workspace || workspace.status !== 'running' || !workspace.publicUrl) {
91
- return res.status(400).json({
92
- error: 'CLI auth requires a running workspace',
93
- code: 'NO_RUNNING_WORKSPACE',
94
- message: 'Please start a workspace first, or use the API key input to connect your provider.',
95
- hint: 'You can create a workspace without providers and connect them afterward using CLI auth.',
96
- });
97
- }
98
- // Forward auth request to workspace daemon
99
- // When running in Docker, localhost refers to the container, not the host
100
- // Use host.docker.internal on Mac/Windows to reach the host machine
101
- // When running on Fly.io, use internal networking (.internal) instead of public DNS
102
- let workspaceUrl = workspace.publicUrl.replace(/\/$/, '');
103
- // Detect Fly.io by checking FLY_APP_NAME env var
104
- const isOnFly = !!process.env.FLY_APP_NAME;
105
- // Detect Docker by checking for /.dockerenv file or RUNNING_IN_DOCKER env var
106
- const isInDocker = process.env.RUNNING_IN_DOCKER === 'true' ||
107
- await import('fs').then(fs => fs.existsSync('/.dockerenv')).catch(() => false);
108
- console.log('[onboarding] isOnFly:', isOnFly, 'isInDocker:', isInDocker);
109
- if (isOnFly && workspaceUrl.includes('.fly.dev')) {
110
- // Use Fly.io internal networking for server-to-server communication
111
- // ar-583f273b.fly.dev -> http://ar-583f273b.internal:3888
112
- // .internal uses IPv6 and works by default for apps in the same org
113
- const appName = workspaceUrl.match(/https?:\/\/([^.]+)\.fly\.dev/)?.[1];
114
- if (appName) {
115
- workspaceUrl = `http://${appName}.internal:3888`;
116
- console.log('[onboarding] Using Fly internal network:', workspaceUrl);
117
- }
118
- }
119
- else if (isInDocker && workspaceUrl.includes('localhost')) {
120
- workspaceUrl = workspaceUrl.replace('localhost', 'host.docker.internal');
121
- console.log('[onboarding] Translated localhost to host.docker.internal');
122
- }
123
- const targetUrl = `${workspaceUrl}/auth/cli/${provider}/start`;
124
- console.log('[onboarding] Forwarding to workspace daemon:', targetUrl);
125
- // Pass userId to enable per-user credential storage in multi-user workspaces
126
- const authResponse = await fetch(targetUrl, {
127
- method: 'POST',
128
- headers: { 'Content-Type': 'application/json' },
129
- body: JSON.stringify({ useDeviceFlow, userId }),
130
- });
131
- console.log('[onboarding] Workspace daemon response:', authResponse.status);
132
- if (!authResponse.ok) {
133
- const errorData = await authResponse.json().catch(() => ({}));
134
- console.log('[onboarding] Workspace daemon error:', errorData);
135
- return res.status(authResponse.status).json({
136
- error: errorData.error || 'Failed to start CLI auth in workspace',
137
- });
138
- }
139
- const workspaceSession = await authResponse.json();
140
- // Create cloud session to track this
141
- const sessionId = crypto.randomUUID();
142
- const session = {
143
- userId,
144
- provider,
145
- status: workspaceSession.status || 'starting',
146
- authUrl: workspaceSession.authUrl,
147
- createdAt: new Date(),
148
- output: '',
149
- // Store workspace info for status polling and auth code forwarding
150
- workspaceId: workspace.id,
151
- workspaceUrl,
152
- workspaceSessionId: workspaceSession.sessionId,
153
- };
154
- activeSessions.set(sessionId, session);
155
- console.log('[onboarding] Session created:', { sessionId, workspaceUrl, workspaceSessionId: workspaceSession.sessionId });
156
- res.json({
157
- sessionId,
158
- status: session.status,
159
- authUrl: session.authUrl,
160
- workspaceId: workspace.id,
161
- useDeviceFlow, // Tell dashboard whether device flow is being used (no CLI helper needed)
162
- message: session.authUrl ? 'Open the auth URL to complete login' : 'Auth session starting, poll for status',
163
- });
164
- }
165
- catch (error) {
166
- console.error(`Error starting CLI auth for ${provider}:`, error);
167
- res.status(500).json({ error: 'Failed to start CLI authentication' });
168
- }
169
- });
170
- /**
171
- * GET /api/onboarding/cli/:provider/status/:sessionId
172
- * Check status of CLI auth session - forwards to workspace daemon
173
- */
174
- onboardingRouter.get('/cli/:provider/status/:sessionId', async (req, res) => {
175
- const provider = req.params.provider;
176
- const sessionId = req.params.sessionId;
177
- const userId = req.session.userId;
178
- const session = activeSessions.get(sessionId);
179
- if (!session) {
180
- return res.status(404).json({ error: 'Session not found or expired' });
181
- }
182
- if (session.userId !== userId) {
183
- return res.status(403).json({ error: 'Unauthorized' });
184
- }
185
- // If we have workspace info, poll the workspace for status
186
- if (session.workspaceUrl && session.workspaceSessionId) {
187
- try {
188
- const statusResponse = await fetch(`${session.workspaceUrl}/auth/cli/${provider}/status/${session.workspaceSessionId}`);
189
- if (statusResponse.ok) {
190
- const workspaceStatus = await statusResponse.json();
191
- // Update local session with workspace status
192
- session.status = workspaceStatus.status || session.status;
193
- session.authUrl = workspaceStatus.authUrl || session.authUrl;
194
- session.error = workspaceStatus.error;
195
- session.errorHint = workspaceStatus.errorHint;
196
- session.recoverable = workspaceStatus.recoverable;
197
- }
198
- }
199
- catch (err) {
200
- console.error('[onboarding] Failed to poll workspace status:', err);
201
- }
202
- }
203
- res.json({
204
- status: session.status,
205
- authUrl: session.authUrl,
206
- error: session.error,
207
- errorHint: session.errorHint,
208
- recoverable: session.recoverable,
209
- });
210
- });
211
- /**
212
- * POST /api/onboarding/cli/:provider/complete/:sessionId
213
- * Mark CLI auth as complete and store credentials
214
- *
215
- * Handles two modes:
216
- * 1. Workspace delegation: Forwards to workspace daemon to complete auth, then fetches credentials
217
- * 2. Direct: Uses token from body or session
218
- */
219
- onboardingRouter.post('/cli/:provider/complete/:sessionId', async (req, res) => {
220
- const provider = req.params.provider;
221
- const sessionId = req.params.sessionId;
222
- const userId = req.session.userId;
223
- const { token, authCode } = req.body; // token for direct mode, authCode for Codex redirect
224
- console.log(`[onboarding] POST /cli/${provider}/complete/${sessionId} - token: ${token ? 'provided' : 'none'}, authCode: ${authCode ? 'provided' : 'none'}`);
225
- const session = activeSessions.get(sessionId);
226
- if (!session) {
227
- return res.status(404).json({ error: 'Session not found or expired' });
228
- }
229
- if (session.userId !== userId) {
230
- return res.status(403).json({ error: 'Unauthorized' });
231
- }
232
- try {
233
- let accessToken = token || session.token;
234
- let refreshToken = session.refreshToken;
235
- let _tokenExpiresAt = session.tokenExpiresAt;
236
- // If using workspace delegation, forward complete request first
237
- if (session.workspaceUrl && session.workspaceSessionId) {
238
- // Forward authCode to workspace if provided (for Codex-style redirects)
239
- if (authCode) {
240
- const backendProviderId = provider === 'anthropic' ? 'anthropic' : provider;
241
- const targetUrl = `${session.workspaceUrl}/auth/cli/${backendProviderId}/complete/${session.workspaceSessionId}`;
242
- console.log('[onboarding] Forwarding complete request to workspace:', targetUrl);
243
- const completeResponse = await fetch(targetUrl, {
244
- method: 'POST',
245
- headers: { 'Content-Type': 'application/json' },
246
- body: JSON.stringify({ authCode }),
247
- });
248
- if (!completeResponse.ok) {
249
- const errorData = await completeResponse.json().catch(() => ({}));
250
- return res.status(completeResponse.status).json({
251
- error: errorData.error || 'Failed to complete authentication in workspace',
252
- });
253
- }
254
- session.status = 'success';
255
- }
256
- // Fetch credentials from workspace with retry
257
- // Credentials may not be immediately available after OAuth completes
258
- if (!accessToken) {
259
- const MAX_CREDS_RETRIES = 5;
260
- const CREDS_RETRY_DELAY = 1000; // 1 second between retries
261
- for (let attempt = 1; attempt <= MAX_CREDS_RETRIES; attempt++) {
262
- try {
263
- console.log(`[onboarding] Fetching credentials from workspace (attempt ${attempt}/${MAX_CREDS_RETRIES})`);
264
- const credsResponse = await fetch(`${session.workspaceUrl}/auth/cli/${provider}/creds/${session.workspaceSessionId}`);
265
- if (credsResponse.ok) {
266
- const creds = await credsResponse.json();
267
- accessToken = creds.token;
268
- refreshToken = creds.refreshToken;
269
- if (creds.tokenExpiresAt) {
270
- _tokenExpiresAt = new Date(creds.tokenExpiresAt);
271
- }
272
- console.log('[onboarding] Fetched credentials from workspace:', {
273
- hasToken: !!accessToken,
274
- hasRefreshToken: !!refreshToken,
275
- attempt,
276
- });
277
- break; // Success, exit retry loop
278
- }
279
- // Check if it's an error state (not just "not ready yet")
280
- const errorBody = await credsResponse.json().catch(() => ({}));
281
- if (errorBody.status === 'error') {
282
- // Auth failed, don't retry
283
- console.error('[onboarding] Auth failed in workspace:', errorBody);
284
- return res.status(400).json({
285
- error: errorBody.error || 'Authentication failed',
286
- errorHint: errorBody.errorHint,
287
- recoverable: errorBody.recoverable,
288
- });
289
- }
290
- // If not ready yet and we have more retries, wait and try again
291
- if (attempt < MAX_CREDS_RETRIES) {
292
- console.log(`[onboarding] Credentials not ready yet, retrying in ${CREDS_RETRY_DELAY}ms...`);
293
- await new Promise(resolve => setTimeout(resolve, CREDS_RETRY_DELAY));
294
- }
295
- }
296
- catch (err) {
297
- console.error(`[onboarding] Failed to get credentials from workspace (attempt ${attempt}):`, err);
298
- if (attempt < MAX_CREDS_RETRIES) {
299
- await new Promise(resolve => setTimeout(resolve, CREDS_RETRY_DELAY));
300
- }
301
- }
302
- }
303
- }
304
- }
305
- if (!accessToken) {
306
- return res.status(400).json({
307
- error: 'No token found. Please complete authentication or paste your token.',
308
- });
309
- }
310
- // Mark provider as connected (tokens are not stored centrally - CLI tools
311
- // authenticate directly on workspace instances)
312
- await db.credentials.upsert({
313
- userId,
314
- workspaceId: session.workspaceId,
315
- provider,
316
- scopes: getProviderScopes(provider),
317
- });
318
- // Clean up session
319
- activeSessions.delete(sessionId);
320
- res.json({
321
- success: true,
322
- message: `${provider} connected successfully`,
323
- });
324
- }
325
- catch (error) {
326
- console.error(`Error completing CLI auth for ${provider}:`, error);
327
- res.status(500).json({ error: 'Failed to complete authentication' });
328
- }
329
- });
330
- /**
331
- * POST /api/onboarding/cli/:provider/code/:sessionId
332
- * Submit auth code to the CLI PTY session
333
- * Used when OAuth returns a code that must be pasted into the CLI
334
- */
335
- onboardingRouter.post('/cli/:provider/code/:sessionId', async (req, res) => {
336
- const provider = req.params.provider;
337
- const sessionId = req.params.sessionId;
338
- const userId = req.session.userId;
339
- const { code, state } = req.body; // state is optional, used for Codex OAuth
340
- console.log('[onboarding] Auth code submission request:', { provider, sessionId, codeLength: code?.length, hasState: !!state });
341
- if (!code || typeof code !== 'string') {
342
- return res.status(400).json({ error: 'Auth code is required' });
343
- }
344
- const session = activeSessions.get(sessionId);
345
- if (!session) {
346
- console.log('[onboarding] Session not found:', { sessionId, activeSessions: Array.from(activeSessions.keys()) });
347
- return res.status(404).json({ error: 'Session not found or expired. Please try connecting again.' });
348
- }
349
- if (session.userId !== userId) {
350
- return res.status(403).json({ error: 'Unauthorized' });
351
- }
352
- console.log('[onboarding] Session found:', {
353
- sessionId,
354
- workspaceUrl: session.workspaceUrl,
355
- workspaceSessionId: session.workspaceSessionId,
356
- status: session.status,
357
- });
358
- // Forward to workspace daemon
359
- if (session.workspaceUrl && session.workspaceSessionId) {
360
- try {
361
- const targetUrl = `${session.workspaceUrl}/auth/cli/${provider}/code/${session.workspaceSessionId}`;
362
- console.log('[onboarding] Forwarding auth code to workspace:', targetUrl);
363
- const codeResponse = await fetch(targetUrl, {
364
- method: 'POST',
365
- headers: { 'Content-Type': 'application/json' },
366
- body: JSON.stringify({ code, state }), // Forward state for Codex CSRF validation
367
- });
368
- console.log('[onboarding] Workspace response:', { status: codeResponse.status });
369
- if (codeResponse.ok) {
370
- return res.json({ success: true, message: 'Auth code submitted' });
371
- }
372
- const errorData = await codeResponse.json().catch(() => ({}));
373
- console.log('[onboarding] Workspace error:', errorData);
374
- // Provide more helpful error message
375
- const needsRestart = errorData.needsRestart;
376
- if (codeResponse.status === 404 || codeResponse.status === 400) {
377
- return res.status(400).json({
378
- error: errorData.error || 'Auth session expired in workspace. The CLI process may have timed out. Please try connecting again.',
379
- needsRestart: needsRestart ?? true,
380
- });
381
- }
382
- return res.status(codeResponse.status).json({
383
- error: errorData.error || 'Failed to submit auth code to workspace',
384
- needsRestart,
385
- });
386
- }
387
- catch (err) {
388
- console.error('[onboarding] Failed to submit auth code to workspace:', err);
389
- return res.status(500).json({
390
- error: 'Failed to reach workspace. Please ensure your workspace is running and try again.',
391
- });
392
- }
393
- }
394
- console.log('[onboarding] No workspace session info available');
395
- return res.status(400).json({
396
- error: 'No workspace session available. This can happen if the workspace was restarted. Please try connecting again.',
397
- });
398
- });
399
- // Note: POST /cli/:provider/complete/:sessionId handler is defined above (lines 269-368)
400
- // It handles both direct token storage and workspace delegation with authCode forwarding
401
- /**
402
- * POST /api/onboarding/cli/:provider/cancel/:sessionId
403
- * Cancel a CLI auth session
404
- */
405
- onboardingRouter.post('/cli/:provider/cancel/:sessionId', async (req, res) => {
406
- const provider = req.params.provider;
407
- const sessionId = req.params.sessionId;
408
- const userId = req.session.userId;
409
- const session = activeSessions.get(sessionId);
410
- if (session?.userId === userId) {
411
- // Cancel on workspace side if applicable
412
- if (session.workspaceUrl && session.workspaceSessionId) {
413
- try {
414
- await fetch(`${session.workspaceUrl}/auth/cli/${provider}/cancel/${session.workspaceSessionId}`, { method: 'POST' });
415
- }
416
- catch {
417
- // Ignore cancel errors
418
- }
419
- }
420
- activeSessions.delete(sessionId);
421
- }
422
- res.json({ success: true });
423
- });
424
- /**
425
- * POST /api/onboarding/mark-connected/:provider
426
- * Mark a provider as connected without storing a token.
427
- * Used by terminal-based setup where the CLI stores credentials locally.
428
- */
429
- onboardingRouter.post('/mark-connected/:provider', async (req, res) => {
430
- const provider = req.params.provider;
431
- const userId = req.session.userId;
432
- const { workspaceId } = req.body;
433
- // Validate provider
434
- const validProviders = ['anthropic', 'openai', 'google', 'github', 'opencode', 'factory', 'cursor'];
435
- if (!validProviders.includes(provider)) {
436
- return res.status(400).json({ error: 'Invalid provider' });
437
- }
438
- try {
439
- // Mark provider as connected (tokens are stored by CLI on workspace)
440
- await db.credentials.upsert({
441
- userId,
442
- workspaceId,
443
- provider,
444
- scopes: getProviderScopes(provider),
445
- });
446
- console.log(`[onboarding] Marked ${provider} as connected for user ${userId} workspace ${workspaceId}`);
447
- res.json({
448
- success: true,
449
- message: `${provider} connected successfully`,
450
- });
451
- }
452
- catch (error) {
453
- console.error(`Error marking ${provider} as connected:`, error);
454
- res.status(500).json({ error: 'Failed to mark provider as connected' });
455
- }
456
- });
457
- /**
458
- * POST /api/onboarding/token/:provider
459
- * Directly store a token (for manual paste flow)
460
- */
461
- onboardingRouter.post('/token/:provider', async (req, res) => {
462
- const provider = req.params.provider;
463
- const userId = req.session.userId;
464
- const { token, email, workspaceId } = req.body;
465
- if (!token) {
466
- return res.status(400).json({ error: 'Token is required' });
467
- }
468
- try {
469
- // Validate token by making a test API call
470
- const isValid = await validateProviderToken(provider, token);
471
- if (!isValid) {
472
- return res.status(400).json({ error: 'Invalid token' });
473
- }
474
- // Mark provider as connected (tokens are not stored centrally - CLI tools
475
- // authenticate directly on workspace instances)
476
- await db.credentials.upsert({
477
- userId,
478
- provider,
479
- scopes: getProviderScopes(provider),
480
- providerAccountEmail: email,
481
- workspaceId,
482
- });
483
- // Set env var and write credential file to workspace
484
- await setProviderApiKeyEnv(userId, provider, token, workspaceId);
485
- res.json({
486
- success: true,
487
- message: `${provider} connected successfully`,
488
- note: 'Token validated. Configure this on your workspace for usage.',
489
- });
490
- }
491
- catch (error) {
492
- console.error(`Error storing provider connection for ${provider}:`, error);
493
- res.status(500).json({ error: 'Failed to store provider connection' });
494
- }
495
- });
496
- /**
497
- * GET /api/onboarding/status
498
- * Get overall onboarding status
499
- */
500
- onboardingRouter.get('/status', async (req, res) => {
501
- const userId = req.session.userId;
502
- try {
503
- const [user, credentials, repositories] = await Promise.all([
504
- db.users.findById(userId),
505
- db.credentials.findByUserId(userId),
506
- db.repositories.findByUserId(userId),
507
- ]);
508
- const connectedProviders = credentials.map(c => c.provider);
509
- const hasAIProvider = connectedProviders.some(p => ['anthropic', 'openai', 'google', 'cursor'].includes(p));
510
- res.json({
511
- steps: {
512
- github: { complete: connectedProviders.includes('github') },
513
- aiProvider: {
514
- complete: hasAIProvider,
515
- connected: connectedProviders.filter(p => p !== 'github'),
516
- },
517
- repository: {
518
- complete: repositories.length > 0,
519
- count: repositories.length,
520
- },
521
- },
522
- onboardingComplete: user?.onboardingCompletedAt != null,
523
- canCreateWorkspace: hasAIProvider && repositories.length > 0,
524
- });
525
- }
526
- catch (error) {
527
- console.error('Error getting onboarding status:', error);
528
- res.status(500).json({ error: 'Failed to get status' });
529
- }
530
- });
531
- /**
532
- * POST /api/onboarding/complete
533
- * Mark onboarding as complete
534
- */
535
- onboardingRouter.post('/complete', async (req, res) => {
536
- const userId = req.session.userId;
537
- try {
538
- await db.users.completeOnboarding(userId);
539
- res.json({ success: true });
540
- }
541
- catch (error) {
542
- console.error('Error completing onboarding:', error);
543
- res.status(500).json({ error: 'Failed to complete onboarding' });
544
- }
545
- });
546
- /**
547
- * Helper: Extract credentials from CLI credential file
548
- * @deprecated Currently unused - kept for potential future use
549
- */
550
- async function _extractCredentials(session, config) {
551
- if (!config.credentialPath)
552
- return;
553
- try {
554
- const fs = await import('fs/promises');
555
- const os = await import('os');
556
- const credPath = config.credentialPath.replace('~', os.homedir());
557
- const content = await fs.readFile(credPath, 'utf8');
558
- const creds = JSON.parse(content);
559
- // Extract token based on provider structure
560
- if (session.provider === 'anthropic') {
561
- // Claude stores OAuth in: { claudeAiOauth: { accessToken: "...", refreshToken: "...", expiresAt: ... } }
562
- if (creds.claudeAiOauth?.accessToken) {
563
- session.token = creds.claudeAiOauth.accessToken;
564
- session.refreshToken = creds.claudeAiOauth.refreshToken;
565
- if (creds.claudeAiOauth.expiresAt) {
566
- session.tokenExpiresAt = new Date(creds.claudeAiOauth.expiresAt);
567
- }
568
- }
569
- else {
570
- // Fallback to legacy formats
571
- session.token = creds.oauth_token || creds.access_token || creds.api_key;
572
- }
573
- }
574
- else if (session.provider === 'openai') {
575
- // Codex stores OAuth in: { tokens: { access_token: "...", refresh_token: "...", ... } }
576
- if (creds.tokens?.access_token) {
577
- session.token = creds.tokens.access_token;
578
- session.refreshToken = creds.tokens.refresh_token;
579
- // Codex doesn't store expiry in the file, but JWTs have exp claim
580
- // We could decode it, but for now just skip
581
- }
582
- else {
583
- // Fallback: API key or legacy formats
584
- session.token = creds.OPENAI_API_KEY || creds.token || creds.access_token || creds.api_key;
585
- }
586
- }
587
- }
588
- catch (error) {
589
- // Credentials file doesn't exist or isn't readable yet
590
- console.log(`Could not read credentials file: ${error}`);
591
- }
592
- }
593
- /**
594
- * Helper: Get default scopes for a provider
595
- */
596
- function getProviderScopes(provider) {
597
- const scopes = {
598
- anthropic: ['claude-code:execute', 'user:read'],
599
- openai: ['codex:execute', 'chat:write'],
600
- google: ['generative-language'],
601
- github: ['read:user', 'user:email', 'repo'],
602
- opencode: ['code:execute'],
603
- factory: ['droid:execute'],
604
- cursor: ['cursor:execute', 'code:write'],
605
- };
606
- return scopes[provider] || [];
607
- }
608
- /**
609
- * Helper: Validate a provider token by making a test API call
610
- *
611
- * Note: OAuth tokens from CLI flows (like `claude` CLI) are different from API keys.
612
- * - API keys: sk-ant-api03-... (can be validated via API)
613
- * - OAuth tokens: Session tokens from OAuth flow (can't be validated the same way)
614
- *
615
- * For OAuth tokens, we accept them if they look valid (non-empty, reasonable length).
616
- * The CLI already validated the OAuth flow, so we trust those tokens.
617
- */
618
- async function validateProviderToken(provider, token) {
619
- // Basic sanity check
620
- if (!token || token.length < 10) {
621
- return false;
622
- }
623
- try {
624
- // Check if this looks like an API key vs OAuth token
625
- const isAnthropicApiKey = token.startsWith('sk-ant-');
626
- const isOpenAIApiKey = token.startsWith('sk-');
627
- // For OAuth tokens (not API keys), accept them without API validation
628
- // The OAuth flow already authenticated the user
629
- if (provider === 'anthropic' && !isAnthropicApiKey) {
630
- console.log('[onboarding] Accepting OAuth token for anthropic (not an API key)');
631
- return true;
632
- }
633
- if (provider === 'openai' && !isOpenAIApiKey) {
634
- console.log('[onboarding] Accepting OAuth token for openai (not an API key)');
635
- return true;
636
- }
637
- // For API keys, validate via API call
638
- const endpoints = {
639
- anthropic: {
640
- url: 'https://api.anthropic.com/v1/messages',
641
- headers: {
642
- 'x-api-key': token,
643
- 'anthropic-version': '2023-06-01',
644
- },
645
- },
646
- openai: {
647
- url: 'https://api.openai.com/v1/models',
648
- headers: {
649
- Authorization: `Bearer ${token}`,
650
- },
651
- },
652
- google: {
653
- url: `https://generativelanguage.googleapis.com/v1/models?key=${encodeURIComponent(token)}`,
654
- headers: {},
655
- },
656
- };
657
- const config = endpoints[provider];
658
- if (!config)
659
- return true; // Unknown provider, assume valid
660
- const response = await fetch(config.url, {
661
- method: provider === 'anthropic' ? 'POST' : 'GET',
662
- headers: config.headers,
663
- ...(provider === 'anthropic' && {
664
- body: JSON.stringify({
665
- model: 'claude-3-haiku-20240307',
666
- max_tokens: 1,
667
- messages: [{ role: 'user', content: 'test' }],
668
- }),
669
- }),
670
- });
671
- // 401/403 means invalid token, anything else (including rate limits) means valid
672
- return response.status !== 401 && response.status !== 403;
673
- }
674
- catch (error) {
675
- console.error(`Error validating ${provider} token:`, error);
676
- return false;
677
- }
678
- }
679
- //# sourceMappingURL=onboarding.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Agent Policy API Routes
3
- *
4
- * Provides endpoints for managing workspace-level agent policies.
5
- * These policies serve as fallbacks when repos don't have .claude/policies/ files.
6
- */
7
- export declare const policyRouter: import("express-serve-static-core").Router;
8
- //# sourceMappingURL=policy.d.ts.map