Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
♻️ Effect 4 pilot: rewrite the webhook dispatcher as Effects (#3332)
Luke Vella12fb24d578cd
diff --git a/CLAUDE.md b/CLAUDE.mdindex 7995a95cb..bc033a0b1 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -172,6 +172,13 @@ Choose the presentation by **why the user lacks the capability**, never ad hoc p- **Composite gates: role wins.** A member of a free space sees neither a disabled control nor a pay wall trigger.- **Never enabled-but-broken.** Any affordance whose action can fail server-side authorization must be gated client-side by the same ability the server checks.+### Effect+- **Version**: `[email protected]`, pinned exact, `apps/web` only. Upgrades are deliberate PRs; never widen the range. No vendored copy of the Effect repo: the npm package ships `src/`, `AGENTS.md` and `ai-docs/`. Before writing Effect code, read `apps/web/node_modules/effect/AGENTS.md` and the `ai-docs/` example it points at; the v4 API differs from v3 and from most online material.+- **Boundary rule**: `mutations.ts` exports Effects, each an `Effect.fn("<feature>.<name>")` with its requirements visible in the type. `data.ts` stays Promise based and is lifted with `fromPrisma` from `lib/effect/db.ts`, which fails with `DatabaseError`. Non-Effect code (route handlers, cron) runs an Effect through the one `ManagedRuntime` in `lib/effect/runtime.ts` and provides feature layers at the call site with `Effect.provide(<Service>.layer)`. The runtime is built from infrastructure layers only, so `lib` never imports a feature. `actions.ts` and the safe-action boundary are not yet covered; keep management mutations Promise based until that design lands.+- **Vocabulary mapping**: no new feature file names. A `Context.Service` with its `static layer` lives in `service.ts`; a `Context.Reference` for configuration lives next to the service that reads it; a tagged error lives next to the code that produces it. Errors are `Data.TaggedError` by default; `Schema.TaggedError` only when the error is decoded from or encoded to a wire (RPC, `HttpApi`), because it pulls the whole `Schema` module into every chunk that imports the error. Reference shape: `features/webhook/service.ts` (`WebhookSender`, `WebhookSendError`, `AllowPrivateTargets`) and `features/webhook/mutations.ts` (`deliverWebhooks`).+- **Errors as data stay data**: typed errors are for control flow inside a mutation. An outcome the database persists (a delivery attempt's `{ ok, status, error }`) is folded back into a value with a trailing `Effect.catchTags` on the `Effect.fn`, so the mutation's error channel says exactly what can escape. A `never` error channel on a function that must not strand a row is the point: the compiler, not review, holds the convention.+- **Testing**: stub layers replace one typed dependency and are allowed (`Effect.provide(Layer.succeed(Service, stub))`, `Effect.provideService(Reference, value)`). This amends the no-mock-heavy-tests rule: a layer replaces one dependency, `vi.mock` replaces the world. Tests never mutate `process.env` to reach a code path a `Context.Reference` already controls.+### State Management- tRPC with TanStack Query for server state- React Context for client state (auth, preferences, etc.)diff --git a/apps/web/package.json b/apps/web/package.jsonindex 57cbd23ac..cf3810747 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -65,6 +65,7 @@"color-hash": "^2.0.2","cookie": "^0.7.0","dayjs": "^1.11.13",+ "effect": "4.0.0-rc.116","es-toolkit": "^1.39.9","googleapis": "^169.0.0","hono": "^4.13.5",diff --git a/apps/web/src/app/api/house-keeping/[...method]/route.ts b/apps/web/src/app/api/house-keeping/[...method]/route.tsindex 6a68e6822..ec75081dd 100644--- a/apps/web/src/app/api/house-keeping/[...method]/route.ts+++ b/apps/web/src/app/api/house-keeping/[...method]/route.ts@@ -1,4 +1,5 @@import { createLogger } from "@rallly/logger";+import { Effect } from "effect";import { Hono } from "hono";import { bearerAuth } from "hono/bearer-auth";import { handle } from "hono/vercel";@@ -18,6 +19,8 @@ import {hardDeleteUser,} from "@/features/user/mutations";import { deliverWebhooks } from "@/features/webhook/mutations";+import { WebhookSender } from "@/features/webhook/service";+import { runtime } from "@/lib/effect/runtime";import {deletePostHogPerson,flushPostHog,@@ -206,7 +209,13 @@ app.get("/delete-orphaned-anonymous-users", async (c) => {});app.get("/deliver-webhooks", async (c) => {- const summary = await deliverWebhooks();+ // A DatabaseError rejects here and Hono answers 500, as an uncaught throw+ // did before.+ const summary = await runtime.runPromise(+ deliverWebhooks({ now: new Date() }).pipe(+ Effect.provide(WebhookSender.layer),+ ),+ );// Runs every minute and most runs find nothing; log only when there was// work so the signal isn't buried in 1,440 no-op lines a day.diff --git a/apps/web/src/features/webhook/mutations.test.ts b/apps/web/src/features/webhook/mutations.test.tsnew file mode 100644index 000000000..26901ec4e--- /dev/null+++ b/apps/web/src/features/webhook/mutations.test.ts@@ -0,0 +1,85 @@+import { encrypt } from "@rallly/utils/encryption";+import { Effect, Layer } from "effect";+import { describe, expect, it, vi } from "vitest";++// `@/env` validates at import and refuses to run under jsdom. One config+// module stubbed with the single value the mutation reads; the sender, the+// dependency under test, is a real layer.+vi.mock("@/env", () => ({+ env: { SECRET_PASSWORD: "0123456789abcdef0123456789abcdef" },+}));++import { env } from "@/env";+import { attemptDelivery } from "./mutations";+import { WebhookSendError, WebhookSender } from "./service";++/** A sender whose every send has the given outcome. */+function senderThat(+ outcome: Effect.Effect<{ status: number }, WebhookSendError>,+) {+ return Layer.succeed(+ WebhookSender,+ WebhookSender.of({ send: () => outcome }),+ );+}++function delivery(secret: string) {+ return {+ id: "d_1",+ eventType: "poll.closed",+ payload: { version: "2026-09-20", event: "poll.closed" },+ webhook: { url: "https://example.com/hook", secret },+ };+}++describe("attemptDelivery", () => {+ const encrypted = encrypt("whsec_test", env.SECRET_PASSWORD);++ it("records a 2xx as a successful attempt", async () => {+ const result = await Effect.runPromise(+ attemptDelivery(delivery(encrypted)).pipe(+ Effect.provide(senderThat(Effect.succeed({ status: 204 }))),+ ),+ );+ expect(result).toEqual({ ok: true, status: 204 });+ });++ it("folds a send error into a failed attempt carrying its status and message", async () => {+ const result = await Effect.runPromise(+ attemptDelivery(delivery(encrypted)).pipe(+ Effect.provide(+ senderThat(+ new WebhookSendError({+ reason: "http_status",+ status: 503,+ message: "HTTP 503",+ }),+ ),+ ),+ ),+ );+ expect(result).toEqual({ ok: false, status: 503, error: "HTTP 503" });+ });++ it("fails the attempt without sending when the secret cannot be decrypted", async () => {+ let sends = 0;+ const result = await Effect.runPromise(+ attemptDelivery(delivery("not-a-ciphertext")).pipe(+ Effect.provide(+ senderThat(+ Effect.sync(() => {+ sends++;+ return { status: 200 };+ }),+ ),+ ),+ ),+ );+ expect(result).toEqual({+ ok: false,+ status: null,+ error: "Could not decrypt the endpoint secret",+ });+ expect(sends).toBe(0);+ });+});diff --git a/apps/web/src/features/webhook/mutations.ts b/apps/web/src/features/webhook/mutations.tsindex e354e7567..9d6551c0c 100644--- a/apps/web/src/features/webhook/mutations.ts+++ b/apps/web/src/features/webhook/mutations.ts@@ -5,7 +5,10 @@ import { subject } from "@casl/ability";import type { Prisma } from "@rallly/database";import { prisma } from "@rallly/database";import { decrypt, encrypt } from "@rallly/utils/encryption";+import { Clock, Data, Effect } from "effect";import { env } from "@/env";+import type { DatabaseError } from "@/lib/effect/db";+import { fromPrisma } from "@/lib/effect/db";import { AppError } from "@/lib/errors/app-error";import { defineAbilityForWebhooks } from "./ability";import {@@ -25,8 +28,7 @@ import {} from "./data";import type { WebhookEventType } from "./schema";import { MAX_WEBHOOKS_PER_SPACE } from "./schema";-import type { WebhookSendResult } from "./service";-import { sendWebhook } from "./service";+import { WebhookSender } from "./service";import {buildWebhookPayload,getRetryDelayMs,@@ -44,99 +46,116 @@ import {* with its cursor, so a crash resumes from the last page, not the start.* Returns the number of deliveries created.*/-export async function fanOutWebhookEvents({ now }: { now: Date }) {- const until = new Date(now.getTime() - FAN_OUT_LAG_MS);- let created = 0;-- for (const webhook of await listEnabledWebhooks()) {- if (webhook.cursor >= until) {- continue;- }-- let after: { createdAt: Date; id?: string } = {- createdAt: new Date(webhook.cursor.getTime() - FAN_OUT_OVERLAP_MS),- };+export const fanOutWebhookEvents = Effect.fn("webhook.fanOutWebhookEvents")(+ function* ({ now }: { now: Date }) {+ const until = new Date(now.getTime() - FAN_OUT_LAG_MS);+ let created = 0;++ for (const webhook of yield* fromPrisma(listEnabledWebhooks)) {+ if (webhook.cursor >= until) {+ continue;+ }- for (;;) {- const activities = await listWebhookActivities({- spaceId: webhook.spaceId,- after,- until,- limit: FAN_OUT_BATCH_SIZE,- });+ let after: { createdAt: Date; id?: string } = {+ createdAt: new Date(webhook.cursor.getTime() - FAN_OUT_OVERLAP_MS),+ };++ for (;;) {+ const activities = yield* fromPrisma(() =>+ listWebhookActivities({+ spaceId: webhook.spaceId,+ after,+ until,+ limit: FAN_OUT_BATCH_SIZE,+ }),+ );++ const deliveries = activities.flatMap((activity) => {+ const eventType = toWebhookEventType(activity.type);+ if (!eventType || !webhook.events.includes(eventType)) {+ return [];+ }+ const payload = buildWebhookPayload({+ activity,+ poll: activity.poll,+ });+ return payload+ ? [+ {+ webhookId: webhook.id,+ activityId: activity.id,+ eventType,+ payload: payload as unknown as Prisma.InputJsonObject,+ // The run's own clock, not the database default: the claim+ // that follows in the same run compares against this+ // instant.+ nextAttemptAt: now,+ },+ ]+ : [];+ });- const deliveries = activities.flatMap((activity) => {- const eventType = toWebhookEventType(activity.type);- if (!eventType || !webhook.events.includes(eventType)) {- return [];+ const last = activities.at(-1);+ const drained = activities.length < FAN_OUT_BATCH_SIZE || !last;+ // A partial page means the boundary was reached; a full one stops at+ // its last row, and the overlap covers anything that lands behind it.+ const cursor = drained ? until : last.createdAt;++ const [result] = yield* fromPrisma(() =>+ prisma.$transaction([+ prisma.webhookDelivery.createMany({+ data: deliveries,+ skipDuplicates: true,+ }),+ prisma.spaceWebhook.update({+ where: { id: webhook.id },+ data: { cursor },+ }),+ ]),+ );+ created += result.count;++ if (drained) {+ break;}- const payload = buildWebhookPayload({ activity, poll: activity.poll });- return payload- ? [- {- webhookId: webhook.id,- activityId: activity.id,- eventType,- payload: payload as unknown as Prisma.InputJsonObject,- // The run's own clock, not the database default: the claim- // that follows in the same run compares against this instant.- nextAttemptAt: now,- },- ]- : [];- });-- const last = activities.at(-1);- const drained = activities.length < FAN_OUT_BATCH_SIZE || !last;- // A partial page means the boundary was reached; a full one stops at- // its last row, and the overlap covers anything that lands behind it.- const cursor = drained ? until : last.createdAt;-- const [result] = await prisma.$transaction([- prisma.webhookDelivery.createMany({- data: deliveries,- skipDuplicates: true,- }),- prisma.spaceWebhook.update({- where: { id: webhook.id },- data: { cursor },- }),- ]);- created += result.count;-- if (drained) {- break;+ after = { createdAt: last.createdAt, id: last.id };}- after = { createdAt: last.createdAt, id: last.id };}- }- return created;-}+ return created;+ },+);/*** Returns in-flight deliveries abandoned by a run that died mid-send to the* queue. The attempt was already counted at claim time, so a delivery that* keeps dying still exhausts instead of looping forever.*/-export async function reclaimStaleDeliveries({ now }: { now: Date }) {+export const reclaimStaleDeliveries = Effect.fn(+ "webhook.reclaimStaleDeliveries",+)(function* ({ now }: { now: Date }) {const staleBefore = new Date(now.getTime() - IN_FLIGHT_TIMEOUT_MS);- const [exhausted, reclaimed] = await prisma.$transaction([- prisma.webhookDelivery.updateMany({- where: {- status: "in_flight",- updatedAt: { lt: staleBefore },- attempts: { gte: MAX_DELIVERY_ATTEMPTS },- },- data: { status: "exhausted", lastError: "Delivery run did not finish" },- }),- prisma.webhookDelivery.updateMany({- where: { status: "in_flight", updatedAt: { lt: staleBefore } },- data: { status: "pending" },- }),- ]);+ const [exhausted, reclaimed] = yield* fromPrisma(() =>+ prisma.$transaction([+ prisma.webhookDelivery.updateMany({+ where: {+ status: "in_flight",+ updatedAt: { lt: staleBefore },+ attempts: { gte: MAX_DELIVERY_ATTEMPTS },+ },+ data: {+ status: "exhausted",+ lastError: "Delivery run did not finish",+ },+ }),+ prisma.webhookDelivery.updateMany({+ where: { status: "in_flight", updatedAt: { lt: staleBefore } },+ data: { status: "pending" },+ }),+ ]),+ );return exhausted.count + reclaimed.count;-}+});/*** Claims due deliveries for this run. Each claim is a conditional update on@@ -144,165 +163,197 @@ export async function reclaimStaleDeliveries({ now }: { now: Date }) {* flips it to in_flight owns it. Counting the attempt here rather than on* completion means a run that dies after sending still used an attempt.*/-export async function claimDueDeliveries({- now,- limit,-}: {- now: Date;- limit: number;-}) {- const claimed: string[] = [];- for (const id of await listDueDeliveryIds({ now, limit })) {- const { count } = await prisma.webhookDelivery.updateMany({- where: {- id,- status: { in: ["pending", "failed"] },- nextAttemptAt: { lte: now },- // Re-checked here, not only when listing candidates: another run- // may have disabled the endpoint in between.- webhook: { enabled: true },- },- data: { status: "in_flight", attempts: { increment: 1 } },- });- if (count === 1) {- claimed.push(id);+export const claimDueDeliveries = Effect.fn("webhook.claimDueDeliveries")(+ function* ({ now, limit }: { now: Date; limit: number }) {+ const claimed: string[] = [];+ for (const id of yield* fromPrisma(() =>+ listDueDeliveryIds({ now, limit }),+ )) {+ const { count } = yield* fromPrisma(() =>+ prisma.webhookDelivery.updateMany({+ where: {+ id,+ status: { in: ["pending", "failed"] },+ nextAttemptAt: { lte: now },+ // Re-checked here, not only when listing candidates: another run+ // may have disabled the endpoint in between.+ webhook: { enabled: true },+ },+ data: { status: "in_flight", attempts: { increment: 1 } },+ }),+ );+ if (count === 1) {+ claimed.push(id);+ }}- }- return prisma.webhookDelivery.findMany({- where: { id: { in: claimed } },- select: {- id: true,- eventType: true,- payload: true,- attempts: true,- webhook: { select: { id: true, url: true, secret: true } },- },- });-}+ return yield* fromPrisma(() =>+ prisma.webhookDelivery.findMany({+ where: { id: { in: claimed } },+ select: {+ id: true,+ eventType: true,+ payload: true,+ attempts: true,+ webhook: { select: { id: true, url: true, secret: true } },+ },+ }),+ );+ },+);export type DeliveryOutcome = "succeeded" | "failed" | "exhausted" | "disabled";+/**+ * What one attempt came to. Persisted on the delivery row, so a failure is+ * data here, not an error: the send's typed error is folded into this shape+ * before anything is recorded.+ */+type DeliveryAttempt =+ | { ok: true; status: number }+ | { ok: false; status: number | null; error: string };+/*** Records an attempt's outcome on the delivery and its endpoint. A failure* with schedule left is re-queued with backoff; past the schedule it is* exhausted and counts against the endpoint, which is disabled once too* many exhaust in a row. Any success resets that count.*/-export async function recordDeliveryResult({- deliveryId,- webhookId,- attempts,- result,- now,-}: {- deliveryId: string;- webhookId: string;- attempts: number;- result: WebhookSendResult;- now: Date;-}): Promise<DeliveryOutcome> {- return prisma.$transaction(async (tx) => {- if (result.ok) {- await tx.webhookDelivery.update({- where: { id: deliveryId },- data: {- status: "succeeded",- lastResponseStatus: result.status,- lastError: null,- },- });- await tx.spaceWebhook.update({- where: { id: webhookId },- data: { lastDeliveredAt: now, consecutiveFailures: 0 },- });- return "succeeded";- }+export const recordDeliveryResult = Effect.fn("webhook.recordDeliveryResult")(+ function* ({+ deliveryId,+ webhookId,+ attempts,+ result,+ now,+ }: {+ deliveryId: string;+ webhookId: string;+ attempts: number;+ result: DeliveryAttempt;+ now: Date;+ }) {+ return yield* fromPrisma(() =>+ prisma.$transaction(async (tx): Promise<DeliveryOutcome> => {+ if (result.ok) {+ await tx.webhookDelivery.update({+ where: { id: deliveryId },+ data: {+ status: "succeeded",+ lastResponseStatus: result.status,+ lastError: null,+ },+ });+ await tx.spaceWebhook.update({+ where: { id: webhookId },+ data: { lastDeliveredAt: now, consecutiveFailures: 0 },+ });+ return "succeeded";+ }- const delay = getRetryDelayMs(attempts);- if (delay !== null) {- await tx.webhookDelivery.update({- where: { id: deliveryId },- data: {- status: "failed",- nextAttemptAt: new Date(now.getTime() + delay),- lastResponseStatus: result.status,- lastError: result.error,- },- });- await tx.spaceWebhook.update({- where: { id: webhookId },- data: { lastFailedAt: now },- });- return "failed";- }+ const delay = getRetryDelayMs(attempts);+ if (delay !== null) {+ await tx.webhookDelivery.update({+ where: { id: deliveryId },+ data: {+ status: "failed",+ nextAttemptAt: new Date(now.getTime() + delay),+ lastResponseStatus: result.status,+ lastError: result.error,+ },+ });+ await tx.spaceWebhook.update({+ where: { id: webhookId },+ data: { lastFailedAt: now },+ });+ return "failed";+ }- await tx.webhookDelivery.update({- where: { id: deliveryId },- data: {- status: "exhausted",- lastResponseStatus: result.status,- lastError: result.error,- },- });- const webhook = await tx.spaceWebhook.update({- where: { id: webhookId },- data: { lastFailedAt: now, consecutiveFailures: { increment: 1 } },- select: { enabled: true, consecutiveFailures: true },- });- if (- webhook.enabled &&- webhook.consecutiveFailures >= MAX_CONSECUTIVE_FAILURES- ) {- await tx.spaceWebhook.update({- where: { id: webhookId },- data: { enabled: false },- });- return "disabled";- }- return "exhausted";- });-}+ await tx.webhookDelivery.update({+ where: { id: deliveryId },+ data: {+ status: "exhausted",+ lastResponseStatus: result.status,+ lastError: result.error,+ },+ });+ const webhook = await tx.spaceWebhook.update({+ where: { id: webhookId },+ data: { lastFailedAt: now, consecutiveFailures: { increment: 1 } },+ select: { enabled: true, consecutiveFailures: true },+ });+ if (+ webhook.enabled &&+ webhook.consecutiveFailures >= MAX_CONSECUTIVE_FAILURES+ ) {+ await tx.spaceWebhook.update({+ where: { id: webhookId },+ data: { enabled: false },+ });+ return "disabled";+ }+ return "exhausted";+ }),+ );+ },+);++class DecryptError extends Data.TaggedError("DecryptError") {}/**- * Every failure mode ends in a result: a delivery is already in flight by- * now, and a throw here would leave it stranded until stale reclamation.+ * Every failure mode ends in a `DeliveryAttempt`: a delivery is already in+ * flight by now, and an error escaping here would leave it stranded until+ * stale reclamation. The trailing catch is what makes that a type, not a+ * convention: the error channel is `never`.*/-async function attemptDelivery(delivery: {- id: string;- eventType: string;- payload: Prisma.JsonValue;- webhook: { url: string; secret: string };-}): Promise<WebhookSendResult> {- let secret: string;- try {- secret = decrypt(delivery.webhook.secret, env.SECRET_PASSWORD);- } catch {- return {- ok: false,- status: null,- error: "Could not decrypt the endpoint secret",- };- }- // From the stored payload, not the current constant: the body is frozen at- // fan-out, so the header has to describe the shape actually being sent.- const version =- delivery.payload &&- typeof delivery.payload === "object" &&- !Array.isArray(delivery.payload) &&- typeof delivery.payload.version === "string"- ? delivery.payload.version- : null;-- return sendWebhook({- url: delivery.webhook.url,- secret,- deliveryId: delivery.id,- eventType: delivery.eventType as WebhookEventType,- version,- body: JSON.stringify(delivery.payload),- });-}+export const attemptDelivery = Effect.fn("webhook.attemptDelivery")(+ function* (delivery: {+ id: string;+ eventType: string;+ payload: Prisma.JsonValue;+ webhook: { url: string; secret: string };+ }) {+ const secret = yield* Effect.try({+ try: () => decrypt(delivery.webhook.secret, env.SECRET_PASSWORD),+ catch: () => new DecryptError(),+ });+ // From the stored payload, not the current constant: the body is frozen+ // at fan-out, so the header has to describe the shape actually being+ // sent.+ const version =+ delivery.payload &&+ typeof delivery.payload === "object" &&+ !Array.isArray(delivery.payload) &&+ typeof delivery.payload.version === "string"+ ? delivery.payload.version+ : null;++ const sender = yield* WebhookSender;+ const { status } = yield* sender.send({+ url: delivery.webhook.url,+ secret,+ deliveryId: delivery.id,+ eventType: delivery.eventType as WebhookEventType,+ version,+ body: JSON.stringify(delivery.payload),+ });+ return { ok: true, status } satisfies DeliveryAttempt as DeliveryAttempt;+ },+ Effect.catchTags({+ DecryptError: () =>+ Effect.succeed<DeliveryAttempt>({+ ok: false,+ status: null,+ error: "Could not decrypt the endpoint secret",+ }),+ WebhookSendError: (error) =>+ Effect.succeed<DeliveryAttempt>({+ ok: false,+ status: error.status,+ error: error.message,+ }),+ }),+);export type DeliverWebhooksSummary = {reclaimed: number;@@ -319,53 +370,51 @@ export type DeliverWebhooksSummary = {* is due. Sends run a few at a time so a slow endpoint cannot hold the whole* batch to its timeout, and every outcome is recorded before the run ends.*/-export async function deliverWebhooks({- now = new Date(),+export const deliverWebhooks = Effect.fn("webhook.deliverWebhooks")(function* ({+ now,}: {- now?: Date;-} = {}): Promise<DeliverWebhooksSummary> {+ now: Date;+}): Effect.fn.Return<DeliverWebhooksSummary, DatabaseError, WebhookSender> {+ const reclaimed = yield* reclaimStaleDeliveries({ now });+ const fannedOut = yield* fanOutWebhookEvents({ now });+ const deliveries = yield* claimDueDeliveries({+ now,+ limit: DELIVERY_CLAIM_BATCH_SIZE,+ });++ const outcomes = yield* Effect.forEach(+ deliveries,+ Effect.fn("webhook.deliverOne")(function* (delivery) {+ const result = yield* attemptDelivery(delivery);+ const recordedAt = new Date(yield* Clock.currentTimeMillis);+ return yield* recordDeliveryResult({+ deliveryId: delivery.id,+ webhookId: delivery.webhook.id,+ attempts: delivery.attempts,+ result,+ now: recordedAt,+ });+ }),+ { concurrency: DELIVERY_CONCURRENCY },+ );+const summary: DeliverWebhooksSummary = {- reclaimed: 0,- fannedOut: 0,- attempted: 0,+ reclaimed,+ fannedOut,+ attempted: deliveries.length,succeeded: 0,failed: 0,exhausted: 0,disabled: 0,};-- summary.reclaimed = await reclaimStaleDeliveries({ now });- summary.fannedOut = await fanOutWebhookEvents({ now });-- const deliveries = await claimDueDeliveries({- now,- limit: DELIVERY_CLAIM_BATCH_SIZE,- });- summary.attempted = deliveries.length;-- for (let i = 0; i < deliveries.length; i += DELIVERY_CONCURRENCY) {- const outcomes = await Promise.all(- deliveries.slice(i, i + DELIVERY_CONCURRENCY).map(async (delivery) => {- const result = await attemptDelivery(delivery);- return recordDeliveryResult({- deliveryId: delivery.id,- webhookId: delivery.webhook.id,- attempts: delivery.attempts,- result,- now: new Date(),- });- }),- );- for (const outcome of outcomes) {- if (outcome === "disabled") {- summary.exhausted++;- }- summary[outcome]++;+ for (const outcome of outcomes) {+ if (outcome === "disabled") {+ summary.exhausted++;}+ summary[outcome]++;}-return summary;-}+});/*** Endpoint management for the settings page. Scope is proven by the caller'sdiff --git a/apps/web/src/features/webhook/service.test.ts b/apps/web/src/features/webhook/service.test.tsindex faa7c88b5..215f88b2e 100644--- a/apps/web/src/features/webhook/service.test.ts+++ b/apps/web/src/features/webhook/service.test.ts@@ -1,5 +1,12 @@+import { Effect } from "effect";import { afterEach, beforeEach, describe, expect, it } from "vitest";-import { guardedLookup, PrivateAddressError, sendWebhook } from "./service";+import {+ AllowPrivateTargets,+ guardedLookup,+ PrivateAddressError,+ WebhookSendError,+ WebhookSender,+} from "./service";function lookupResult(hostname: string, all: boolean) {return new Promise<{ err: Error | null; address: unknown }>((resolve) => {@@ -31,21 +38,17 @@ describe("guardedLookup", () => {});});-describe("sendWebhook", () => {+describe("WebhookSender", () => {const PROXY_VARS = ["HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"];let originalEnv: Record<string, string | undefined>;beforeEach(() => {originalEnv = Object.fromEntries(- [...PROXY_VARS, "WEBHOOK_ALLOW_PRIVATE_URLS"].map((name) => [- name,- process.env[name],- ]),+ PROXY_VARS.map((name) => [name, process.env[name]]),);for (const name of PROXY_VARS) {delete process.env[name];}- delete process.env.WEBHOOK_ALLOW_PRIVATE_URLS;});afterEach(() => {@@ -58,6 +61,53 @@ describe("sendWebhook", () => {}});+ function sendFailure(url: string) {+ return Effect.runPromise(+ WebhookSender.use((sender) =>+ sender.send({+ url,+ secret: "whsec_test",+ deliveryId: "d_1",+ eventType: "poll.closed",+ version: "2026-09-20",+ body: "{}",+ }),+ ).pipe(+ Effect.flip,+ Effect.provide(WebhookSender.layer),+ Effect.provideService(AllowPrivateTargets, false),+ ),+ );+ }++ it("refuses a malformed URL", async () => {+ const error = await sendFailure("not a url");+ expect(error).toBeInstanceOf(WebhookSendError);+ expect(error).toMatchObject({+ reason: "invalid_url",+ status: null,+ message: "Invalid webhook URL",+ });+ });++ it("refuses a plain http target", async () => {+ const error = await sendFailure("http://example.com/hook");+ expect(error).toMatchObject({+ reason: "insecure_target",+ status: null,+ message: "Webhook URL must use https",+ });+ });++ it("refuses a private IP literal before connecting", async () => {+ const error = await sendFailure("https://10.0.0.1/hook");+ expect(error).toMatchObject({+ reason: "private_address",+ status: null,+ message: "Webhook host is a private address",+ });+ });+// Loopback is always exempt from the proxy, so with a proxy configured// this request takes the direct path — the one that must carry the// guarded lookup. Resolution fails before any socket opens, so the test@@ -65,19 +115,11 @@ describe("sendWebhook", () => {it("refuses a hostname that resolves to a private address on the direct path behind a proxy", async () => {process.env.HTTPS_PROXY = "http://proxy.invalid:3128";- const result = await sendWebhook({- url: "https://localhost/hook",- secret: "whsec_test",- deliveryId: "d_1",- eventType: "poll.closed",- version: "2026-09-20",- body: "{}",- });-- expect(result).toEqual({- ok: false,+ const error = await sendFailure("https://localhost/hook");+ expect(error).toMatchObject({+ reason: "private_address",status: null,- error: "Webhook host resolves to a private address",+ message: "Webhook host resolves to a private address",});});});diff --git a/apps/web/src/features/webhook/service.ts b/apps/web/src/features/webhook/service.tsindex 115d6394f..a73852b4b 100644--- a/apps/web/src/features/webhook/service.ts+++ b/apps/web/src/features/webhook/service.ts@@ -3,23 +3,38 @@ import "server-only";import type { LookupAddress, LookupOptions } from "node:dns";import { lookup } from "node:dns";import { isIP } from "node:net";+import { Clock, Context, Data, Effect, Layer } from "effect";import type { Dispatcher } from "undici";import { getGlobalDispatcher } from "undici";import { createOutboundDispatcher } from "@/lib/outbound-proxy";import { DELIVERY_TIMEOUT_MS } from "./constants";import { isPrivateAddress, signWebhookBody } from "./utils";-export type WebhookSendResult =- | { ok: true; status: number }- | { ok: false; status: number | null; error: string };+/**+ * Why one delivery attempt did not get a 2xx. `message` is what the+ * delivery row stores in `lastError`.+ */+export class WebhookSendError extends Data.TaggedError("WebhookSendError")<{+ reason:+ | "invalid_url"+ | "insecure_target"+ | "private_address"+ | "timeout"+ | "http_status"+ | "network";+ status: number | null;+ message: string;+}> {}/*** Local development and the integration suite point endpoints at loopback,- * which the sender otherwise refuses. Never set in production.+ * which the sender otherwise refuses. Never set in production. Tests+ * provide a value instead of mutating the environment.*/-function allowsPrivateTargets() {- return process.env.WEBHOOK_ALLOW_PRIVATE_URLS === "true";-}+export const AllowPrivateTargets = Context.Reference<boolean>(+ "rallly/webhook/AllowPrivateTargets",+ { defaultValue: () => process.env.WEBHOOK_ALLOW_PRIVATE_URLS === "true" },+);export class PrivateAddressError extends Error {constructor() {@@ -66,6 +81,78 @@ export function guardedLookup(});}+/**+ * Cheap rejections before any connection is made. IP literals never go+ * through a lookup, so they are the one case that must be judged here.+ */+function parseTarget({+ url,+ allowPrivateTargets,+}: {+ url: string;+ allowPrivateTargets: boolean;+}) {+ return Effect.try({+ try: () => new URL(url),+ catch: () =>+ new WebhookSendError({+ reason: "invalid_url",+ status: null,+ message: "Invalid webhook URL",+ }),+ }).pipe(+ Effect.flatMap((target) => {+ if (allowPrivateTargets) {+ return Effect.succeed(target);+ }+ if (target.protocol !== "https:") {+ return new WebhookSendError({+ reason: "insecure_target",+ status: null,+ message: "Webhook URL must use https",+ });+ }+ const hostname = target.hostname.replace(/^\[|\]$/g, "");+ if (isIP(hostname) && isPrivateAddress(hostname)) {+ return new WebhookSendError({+ reason: "private_address",+ status: null,+ message: "Webhook host is a private address",+ });+ }+ return Effect.succeed(target);+ }),+ );+}++/**+ * A rejected fetch. The guarded lookup surfaces as the cause of a TypeError,+ * so it is recognised here and reported as the private address it is.+ */+function toRequestError(error: unknown) {+ if (error instanceof Error && error.cause instanceof PrivateAddressError) {+ return new WebhookSendError({+ reason: "private_address",+ status: null,+ message: error.cause.message,+ });+ }+ const message =+ error instanceof Error+ ? (error.cause instanceof Error ? error.cause.message : null) ||+ error.message+ : "Request failed";+ return new WebhookSendError({+ reason: "network",+ status: null,+ message: message.slice(0, 500),+ });+}++/**+ * Memoized at module level, not in the layer: the layer is provided per+ * dispatcher run, and the connection pool should outlive a run.+ */let guardedDispatcher: Dispatcher | null = null;/**@@ -74,8 +161,8 @@ let guardedDispatcher: Dispatcher | null = null;* which resolves the hostname itself, so pinning is not possible there; the* proxy operator controls what it can reach.*/-function getDispatcher() {- if (allowsPrivateTargets()) {+function getDispatcher(allowPrivateTargets: boolean) {+ if (allowPrivateTargets) {return getGlobalDispatcher();}guardedDispatcher ??= createOutboundDispatcher({@@ -84,103 +171,107 @@ function getDispatcher() {return guardedDispatcher;}-/**- * Cheap rejections before any connection is made. IP literals never go- * through a lookup, so they are the one case that must be judged here.- */-function getTargetRejection(url: URL) {- if (allowsPrivateTargets()) {- return null;- }- if (url.protocol !== "https:") {- return "Webhook URL must use https";- }- const hostname = url.hostname.replace(/^\[|\]$/g, "");- if (isIP(hostname) && isPrivateAddress(hostname)) {- return "Webhook host is a private address";- }- return null;-}+const timeoutError = new WebhookSendError({+ reason: "timeout",+ status: null,+ message: `Timed out after ${DELIVERY_TIMEOUT_MS / 1000}s`,+});/**- * POSTs one signed event to an endpoint. A 2xx response is a success;- * anything else — including redirects, which are never followed because- * the redirect target was not checked — is a failure the caller schedules a- * retry for. Never throws: the outcome is the return value.+ * POSTs one signed event to an endpoint. A 2xx response succeeds with its+ * status; anything else, including redirects, which are never followed+ * because the redirect target was not checked, fails with a+ * `WebhookSendError` the caller folds into the delivery row and schedules a+ * retry for.*/-export async function sendWebhook({- url,- secret,- deliveryId,- eventType,- version,- body,-}: {- url: string;- secret: string;- deliveryId: string;- eventType: string;- /**- * The version the body was built against, read from the stored payload- * rather than the current constant: payloads are frozen at fan-out, so a- * delivery retried after a version change must keep advertising the- * contract its body actually follows. Absent on deliveries fanned out- * before the version existed, which are sent without the header.- */- version: string | null;- body: string;-}): Promise<WebhookSendResult> {- let target: URL;- try {- target = new URL(url);- } catch {- return { ok: false, status: null, error: "Invalid webhook URL" };+export class WebhookSender extends Context.Service<+ WebhookSender,+ {+ send(input: {+ url: string;+ secret: string;+ deliveryId: string;+ eventType: string;+ /**+ * The version the body was built against, read from the stored+ * payload rather than the current constant: payloads are frozen at+ * fan-out, so a delivery retried after a version change must keep+ * advertising the contract its body actually follows. Absent on+ * deliveries fanned out before the version existed, which are sent+ * without the header.+ */+ version: string | null;+ body: string;+ }): Effect.Effect<{ status: number }, WebhookSendError>;}+>()("rallly/webhook/WebhookSender") {+ static readonly layer = Layer.sync(WebhookSender, () => {+ const send = Effect.fn("WebhookSender.send")(function* ({+ url,+ secret,+ deliveryId,+ eventType,+ version,+ body,+ }: {+ url: string;+ secret: string;+ deliveryId: string;+ eventType: string;+ version: string | null;+ body: string;+ }) {+ const allowPrivateTargets = yield* AllowPrivateTargets;+ const target = yield* parseTarget({ url, allowPrivateTargets });+ const timestamp = Math.floor((yield* Clock.currentTimeMillis) / 1000);+ const signature = yield* Effect.tryPromise({+ try: () => signWebhookBody({ secret, body, timestamp }),+ catch: toRequestError,+ });- const rejection = getTargetRejection(target);- if (rejection) {- return { ok: false, status: null, error: rejection };- }+ // The fiber's signal reaches the socket, so a timeout cancels the+ // request instead of leaving it to finish in the background.+ const response = yield* Effect.tryPromise({+ try: (signal) =>+ fetch(target, {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ "User-Agent": "Rallly-Webhooks/1.0",+ "X-Rallly-Event": eventType,+ ...(version ? { "X-Rallly-Webhook-Version": version } : {}),+ "X-Rallly-Delivery": deliveryId,+ "X-Rallly-Signature": signature,+ },+ body,+ redirect: "manual",+ signal,+ // Node extension, absent from the DOM RequestInit type.+ ...({ dispatcher: getDispatcher(allowPrivateTargets) } as object),+ }),+ catch: toRequestError,+ }).pipe(+ Effect.timeout(DELIVERY_TIMEOUT_MS),+ Effect.catchTag("TimeoutError", () => timeoutError),+ );- try {- const timestamp = Math.floor(Date.now() / 1000);- const signature = await signWebhookBody({ secret, body, timestamp });- const response = await fetch(target, {- method: "POST",- headers: {- "Content-Type": "application/json",- "User-Agent": "Rallly-Webhooks/1.0",- "X-Rallly-Event": eventType,- ...(version ? { "X-Rallly-Webhook-Version": version } : {}),- "X-Rallly-Delivery": deliveryId,- "X-Rallly-Signature": signature,- },- body,- redirect: "manual",- signal: AbortSignal.timeout(DELIVERY_TIMEOUT_MS),- // Node extension, absent from the DOM RequestInit type.- ...({ dispatcher: getDispatcher() } as object),+ // The body is irrelevant and untrusted: release the socket without+ // buffering it.+ yield* Effect.promise(+ () =>+ response.body?.cancel().catch(() => undefined) ?? Promise.resolve(),+ );++ if (response.ok) {+ return { status: response.status };+ }+ return yield* new WebhookSendError({+ reason: "http_status",+ status: response.status,+ message: `HTTP ${response.status}`,+ });});- // The body is irrelevant and untrusted: release the socket without- // buffering it.- await response.body?.cancel().catch(() => undefined);- if (response.ok) {- return { ok: true, status: response.status };- }- return {- ok: false,- status: response.status,- error: `HTTP ${response.status}`,- };- } catch (error) {- const message =- error instanceof Error- ? error.name === "TimeoutError"- ? `Timed out after ${DELIVERY_TIMEOUT_MS / 1000}s`- : (error.cause instanceof Error ? error.cause.message : null) ||- error.message- : "Request failed";- return { ok: false, status: null, error: message.slice(0, 500) };- }+ return WebhookSender.of({ send });+ });}diff --git a/apps/web/src/lib/effect/db.test.ts b/apps/web/src/lib/effect/db.test.tsnew file mode 100644index 000000000..5c449a79b--- /dev/null+++ b/apps/web/src/lib/effect/db.test.ts@@ -0,0 +1,33 @@+import { Effect } from "effect";+import { describe, expect, it } from "vitest";+import { DatabaseError, fromPrisma } from "./db";++describe("fromPrisma", () => {+ it("resolves to the thunk's value", async () => {+ const value = await Effect.runPromise(+ fromPrisma(() => Promise.resolve({ count: 3 })),+ );+ expect(value).toEqual({ count: 3 });+ });++ it("fails with DatabaseError carrying the rejection as cause", async () => {+ const rejection = new Error("connection refused");+ const error = await Effect.runPromise(+ Effect.flip(fromPrisma(() => Promise.reject(rejection))),+ );+ expect(error).toBeInstanceOf(DatabaseError);+ expect(error.cause).toBe(rejection);+ });++ it("defers the call until the effect runs", async () => {+ let calls = 0;+ const effect = fromPrisma(() => {+ calls++;+ return Promise.resolve(calls);+ });+ expect(calls).toBe(0);+ await Effect.runPromise(effect);+ await Effect.runPromise(effect);+ expect(calls).toBe(2);+ });+});diff --git a/apps/web/src/lib/effect/db.ts b/apps/web/src/lib/effect/db.tsnew file mode 100644index 000000000..4e1b9eab4--- /dev/null+++ b/apps/web/src/lib/effect/db.ts@@ -0,0 +1,22 @@+import { Data, Effect } from "effect";++/**+ * A Prisma call that rejected. The cause is the driver's error, kept as a+ * defect: callers do not branch on it, they let it reach the boundary where+ * an uncaught throw would have gone before.+ */+export class DatabaseError extends Data.TaggedError("DatabaseError")<{+ cause: unknown;+}> {}++/**+ * Lifts a Promise based `data.ts` read or a raw Prisma call into an Effect.+ * Takes a thunk so this module never imports `@rallly/database`; a Prisma+ * `Context.Service` replaces it when `data.ts` migrates.+ */+export function fromPrisma<A>(thunk: () => PromiseLike<A>) {+ return Effect.tryPromise({+ try: thunk,+ catch: (cause) => new DatabaseError({ cause }),+ });+}diff --git a/apps/web/src/lib/effect/runtime.ts b/apps/web/src/lib/effect/runtime.tsnew file mode 100644index 000000000..f75b6f1a8--- /dev/null+++ b/apps/web/src/lib/effect/runtime.ts@@ -0,0 +1,13 @@+import "server-only";++import { Layer, ManagedRuntime } from "effect";++/**+ * The one runtime non-Effect code runs Effects through. Built from+ * infrastructure layers only; feature layers are provided at the call site+ * with `Effect.provide`, so `lib` never imports a feature. The memo map is+ * module level so layers memoize across any future runtimes in the process.+ */+const memoMap = Layer.makeMemoMapUnsafe();++export const runtime = ManagedRuntime.make(Layer.empty, { memoMap });diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 150e7ba19..29951ab2f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -97,7 +97,7 @@ importers:version: 8.1.0([email protected])'@vercel/analytics':specifier: ^1.5.0- version: 1.6.1([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected])+ version: 1.6.1([email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected])dayjs:specifier: ^1.11.13version: 1.11.19@@ -139,7 +139,7 @@ importers:version: 6.0.0(@types/[email protected])([email protected])next-seo:specifier: ^6.1.0- version: 6.8.0([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ version: 6.8.0([email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])pg:specifier: ^8.17.1version: 8.18.0@@ -330,6 +330,9 @@ importers:dayjs:specifier: ^1.11.13version: 1.11.19+ effect:+ specifier: 4.0.0-rc.116+ version: 4.0.0-rc.116es-toolkit:specifier: ^1.39.9version: 1.44.0@@ -341,7 +344,7 @@ importers:version: 4.13.7hono-openapi:specifier: ^1.1.2- version: 1.2.0(@hono/[email protected](@standard-schema/[email protected])([email protected]))(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])+ version: 1.2.0(@hono/[email protected](@standard-schema/[email protected])([email protected]))(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])hono-rate-limiter:specifier: ^0.2.1version: 0.2.3([email protected])@@ -627,7 +630,7 @@ importers:version: link:../tsconfig'@react-email/ui':specifier: ^6.9.3- version: 6.9.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ version: 6.9.3(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])'@types/react':specifier: 19.2.13version: 19.2.13@@ -8066,6 +8069,9 @@ packages:resolution: {integrity: sha512-qMLfDJscrNG8p/aw+IkT9W7fgj50Z4wG5bLBy0Txsxz8iUHjDIkOgO3SV0WZfnQbNG2VJYb0b+rDLMrhM4+Krw==}+ resolution: {integrity: sha512-nawqJHSjHV8XIBRZNZ+D7cLZpN3kkSjzy6aiT9ofKENsl7xAMFKEoDa0itN5JFl3GUQ1PIN1T1HNlva5+xyO/A==}+resolution: {integrity: sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==}@@ -17479,10 +17485,10 @@ snapshots:dependencies:react: 19.2.6- '@react-email/[email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':+ '@react-email/[email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])':dependencies:esbuild: 0.28.1- next: 16.3.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ next: 16.3.3(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])transitivePeerDependencies:- '@babel/core'- '@opentelemetry/api'@@ -18749,26 +18755,26 @@ snapshots:'@stablelib/[email protected]':optional: true- '@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])':+ '@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])':dependencies:'@standard-schema/spec': 1.1.0'@types/json-schema': 7.0.15quansync: 0.2.11optionalDependencies:arktype: 2.1.27- effect: 3.20.0+ effect: 4.0.0-rc.116valibot: 1.2.0([email protected])zod: 4.3.6zod-to-json-schema: 3.25.2([email protected])- '@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':+ '@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])':dependencies:- '@standard-community/standard-json': 0.3.5(@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])+ '@standard-community/standard-json': 0.3.5(@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])'@standard-schema/spec': 1.1.0openapi-types: 12.1.3optionalDependencies:arktype: 2.1.27- effect: 3.20.0+ effect: 4.0.0-rc.116valibot: 1.2.0([email protected])zod: 4.3.6@@ -19789,9 +19795,9 @@ snapshots:dependencies:uncrypto: 0.1.3- '@vercel/[email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected])':+ '@vercel/[email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected])':optionalDependencies:- next: 16.3.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ next: 16.3.3(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])react: 19.2.6'@vercel/[email protected](@aws-sdk/[email protected])':@@ -21061,6 +21067,8 @@ snapshots:'@standard-schema/spec': 1.1.0fast-check: 3.23.2+ [email protected]: {}+@@ -22280,10 +22288,10 @@ snapshots:- [email protected](@hono/[email protected](@standard-schema/[email protected])([email protected]))(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected]):+ [email protected](@hono/[email protected](@standard-schema/[email protected])([email protected]))(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-community/[email protected](@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected]):dependencies:- '@standard-community/standard-json': 0.3.5(@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])- '@standard-community/standard-openapi': 0.2.9(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])+ '@standard-community/standard-json': 0.3.5(@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected])+ '@standard-community/standard-openapi': 0.2.9(@standard-community/[email protected](@standard-schema/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected]([email protected]))([email protected]))(@standard-schema/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])'@types/json-schema': 7.0.15openapi-types: 12.1.3optionalDependencies:@@ -23888,9 +23896,9 @@ snapshots:react: 19.2.6react-dom: 19.2.6([email protected])- [email protected]([email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ [email protected]([email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):dependencies:- next: 16.3.3(@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])+ next: 16.3.3(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])react: 19.2.6react-dom: 19.2.6([email protected])@@ -23926,7 +23934,34 @@ snapshots:- '@types/node'- babel-plugin-macros- [email protected](@babel/[email protected])(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]):+ [email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]):+ dependencies:+ '@next/env': 16.3.3+ '@swc/helpers': 0.5.23+ baseline-browser-mapping: 2.11.19+ caniuse-lite: 1.0.30001810+ postcss: 8.5.23+ react: 19.2.6+ react-dom: 19.2.6([email protected])+ styled-jsx: 5.1.6(@babel/[email protected])([email protected])+ optionalDependencies:+ '@next/swc-darwin-arm64': 16.3.3+ '@next/swc-darwin-x64': 16.3.3+ '@next/swc-linux-arm64-gnu': 16.3.3+ '@next/swc-linux-arm64-musl': 16.3.3+ '@next/swc-linux-x64-gnu': 16.3.3+ '@next/swc-linux-x64-musl': 16.3.3+ '@next/swc-win32-arm64-msvc': 16.3.3+ '@next/swc-win32-x64-msvc': 16.3.3+ '@opentelemetry/api': 1.9.0+ '@playwright/test': 1.58.1+ sharp: 0.35.3(@types/[email protected])+ transitivePeerDependencies:+ - '@babel/core'+ - '@types/node'+ - babel-plugin-macros++ [email protected](@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected]):dependencies:'@next/env': 16.3.3'@swc/helpers': 0.5.23