Pricing model - Replace seat-based pricing with org-flat-fee plans: Free (10k execs/mo, 3 members), Free PAYG (10k included + $0.20/1k overage), Team ($49/mo, 250k incl, unlimited members, $0.20/1k overage). Bumped Free included executions from 5k -> 10k for top-of-funnel. - Mark `seats` feature archived; introduce `members` (non-consumable metered) and `domain-verification` (boolean) features. - Update privacy/terms copy from "seat counts" to "membership" / "organization-level" pricing language. - Refresh /billing and /billing/plans UI: trim per-seat add-ons, render Free/Team/Enterprise cards, fix button alignment under conditional badges. Slack/email contact CTA on pricing page - New SlackService wraps Slack Web API: creates `#shared-<email-slug>` channel (retries with random suffix on `name_taken`), posts a hello message, and calls `conversations.inviteShared` with `external_limited`. - POST /api/contact/slack: public endpoint, validates email, verifies a Cloudflare Turnstile token, gates on a 5/min global ratelimit binding, then calls SlackService. Internal SlackError details are logged server-side; the client only sees a generic message. - Pricing page CTA: dialog with Turnstile widget + email/name/note form, prefilled from useAuth() when signed in. Sibling "Email us" mailto: link to rhys@executor.sh. - Wrangler bindings: ratelimit (5/60s), VITE_PUBLIC_TURNSTILE_SITEKEY vars; .env.op gets dev test keys + SLACK_BOT_TOKEN op:// reference.
Showing the changes to apps/cloud/src/api/error-response.ts (1 of 17 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | import * as Sentry from "@sentry/cloudflare"; |
| 2 | −import { Data, Effect } from "effect"; | |
| 2 | +import { Cause, Data, Effect, Result } from "effect"; | |
| 3 | 3 | import { |
| 4 | 4 | HttpServerRespondable, |
| 5 | 5 | HttpServerResponse, |
| @@ -25,14 +25,28 @@ export class HttpResponseError extends Data.TaggedError("HttpResponseError")<{ · 19 unmodified lines | ||
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | −const toHttpResponseError = (error: unknown): HttpResponseError => | |
| 29 | − error instanceof HttpResponseError | |
| 30 | − ? error | |
| 28 | +const unwrapCause = (error: unknown): unknown => { | |
| 29 | + if (!Cause.isCause(error)) return error; | |
| 30 | + | |
| 31 | + const failure = Cause.findError(error); | |
| 32 | + if (Result.isSuccess(failure)) return failure.success; | |
| 33 | + | |
| 34 | + const defect = Cause.findDefect(error); | |
| 35 | + if (Result.isSuccess(defect)) return defect.success; | |
| 36 | + | |
| 37 | + return error; | |
| 38 | +}; | |
| 39 | + | |
| 40 | +const toHttpResponseError = (error: unknown): HttpResponseError => { | |
| 41 | + const unwrapped = unwrapCause(error); | |
| 42 | + return unwrapped instanceof HttpResponseError | |
| 43 | + ? unwrapped | |
| 31 | 44 | : new HttpResponseError({ |
| 32 | 45 | status: 500, |
| 33 | 46 | code: "internal_server_error", |
| 34 | 47 | message: "Internal server error", |
| 35 | 48 | }); |
| 49 | +}; | |
| 36 | 50 | |
| 37 | 51 | export const isServerError = (error: unknown): boolean => toHttpResponseError(error).status >= 500; |
| 38 | 52 | |
| @@ -45,7 +59,10 @@ export const toErrorResponse = (error: unknown): Response => { · 6 unmodified lines | ||
| 45 | 59 | export const toErrorServerResponse = (error: unknown): HttpServerResponse.HttpServerResponse => { |
| 46 | 60 | const mapped = toHttpResponseError(error); |
| 47 | 61 | if (mapped.status >= 500) { |
| 48 | − console.error("[api] toErrorServerResponse error:", error instanceof Error ? error.stack : error); | |
| 62 | + console.error( | |
| 63 | + "[api] toErrorServerResponse error:", | |
| 64 | + error instanceof Error ? error.stack : error, | |
| 65 | + ); | |
| 49 | 66 | Sentry.captureException(error); |
| 50 | 67 | } |
| 51 | 68 | return HttpServerResponse.jsonUnsafe( |