Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

Harden preview ownership and option-based secret handling (#3172)

Julius Marminge753bc4672ded
diff --git a/apps/server/src/mcp/McpHttpServer.test.ts b/apps/server/src/mcp/McpHttpServer.test.ts
index 25509dc59..210bb7e5a 100644
--- a/apps/server/src/mcp/McpHttpServer.test.ts
+++ b/apps/server/src/mcp/McpHttpServer.test.ts
@@ -107,7 +107,15 @@ it.effect("registers annotated tools and preserves authenticated request context
Effect.gen(function* () {
const server = yield* McpServer.McpServer;
const broker = yield* PreviewAutomationBroker.PreviewAutomationBroker;
- const requests = yield* broker.connect("mcp-test-client");
+ const requests = yield* broker.connect({
+ clientId: "mcp-test-client",
+ environmentId,
+ threadId,
+ tabId,
+ visible: true,
+ supportsAutomation: true,
+ focusedAt: "2026-06-11T00:00:00.000Z",
+ });
yield* Stream.runForEach(requests, (request) =>
broker.respond({
requestId: request.requestId,
diff --git a/apps/server/src/mcp/PreviewAutomationBroker.test.ts b/apps/server/src/mcp/PreviewAutomationBroker.test.ts
index 353353aae..06b182598 100644
--- a/apps/server/src/mcp/PreviewAutomationBroker.test.ts
+++ b/apps/server/src/mcp/PreviewAutomationBroker.test.ts
@@ -2,10 +2,13 @@ import { expect, it } from "@effect/vitest";
import {
EnvironmentId,
PreviewAutomationNoFocusedOwnerError,
+ PreviewAutomationUnavailableError,
ProviderInstanceId,
ThreadId,
+ type PreviewAutomationOwner,
} from "@t3tools/contracts";
import * as Effect from "effect/Effect";
+import * as Fiber from "effect/Fiber";
import * as Stream from "effect/Stream";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
@@ -20,11 +23,22 @@ const scope = {
expiresAt: 2,
};
-it.effect("routes a request to the focused owner and correlates its response", () =>
+const makeOwner = (overrides: Partial<PreviewAutomationOwner> = {}): PreviewAutomationOwner => ({
+ clientId: "client-1",
+ environmentId: scope.environmentId,
+ threadId: scope.threadId,
+ tabId: null,
+ visible: false,
+ supportsAutomation: true,
+ focusedAt: "2026-06-11T00:00:00.000Z",
+ ...overrides,
+});
+
+it.effect("atomically registers a connected owner and correlates its response", () =>
Effect.scoped(
Effect.gen(function* () {
const broker = yield* PreviewAutomationBroker.__testing.make;
- const requests = yield* broker.connect("client-1");
+ const requests = yield* broker.connect(makeOwner());
yield* Stream.runForEach(requests, (request) =>
broker.respond({
requestId: request.requestId,
@@ -33,15 +47,6 @@ it.effect("routes a request to the focused owner and correlates its response", (
}),
).pipe(Effect.forkScoped);
yield* Effect.yieldNow;
- yield* broker.reportOwner({
- clientId: "client-1",
- environmentId: scope.environmentId,
- threadId: scope.threadId,
- tabId: null,
- visible: false,
- supportsAutomation: true,
- focusedAt: "2026-06-11T00:00:00.000Z",
- });
const result = yield* broker.invoke<{ available: boolean }>({
scope,
@@ -68,22 +73,119 @@ it.effect("routes interactive commands to a hidden durable browser host", () =>
Effect.scoped(
Effect.gen(function* () {
const broker = yield* PreviewAutomationBroker.__testing.make;
- const requests = yield* broker.connect("client-hidden");
+ const requests = yield* broker.connect(
+ makeOwner({ clientId: "client-hidden", tabId: "tab-hidden" }),
+ );
+ yield* Stream.runForEach(requests, (request) =>
+ broker.respond({ requestId: request.requestId, ok: true }),
+ ).pipe(Effect.forkScoped);
+ yield* Effect.yieldNow;
+
+ yield* broker.invoke<void>({ scope, operation: "click", input: { x: 10, y: 10 } });
+ }),
+ ),
+);
+
+it.effect("lets the browser host resolve an active tab that has not been reported yet", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* PreviewAutomationBroker.__testing.make;
+ const requests = yield* broker.connect(makeOwner({ tabId: null }));
+ let routedTabId: string | undefined;
+ yield* Stream.runForEach(requests, (request) => {
+ routedTabId = request.tabId;
+ return broker.respond({ requestId: request.requestId, ok: true });
+ }).pipe(Effect.forkScoped);
+ yield* Effect.yieldNow;
+
+ yield* broker.invoke<void>({ scope, operation: "click", input: { x: 10, y: 10 } });
+
+ expect(routedTabId).toBeUndefined();
+ }),
+ ),
+);
+
+it.effect("preserves current owner metadata when its request stream reconnects", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* PreviewAutomationBroker.__testing.make;
+ const firstRequests = yield* broker.connect(makeOwner());
+ yield* Stream.runDrain(firstRequests).pipe(Effect.forkScoped);
+ yield* broker.reportOwner(makeOwner({ tabId: "tab-current", visible: true }));
+
+ const reconnectedRequests = yield* broker.connect(makeOwner());
+ let routedTabId: string | undefined;
+ yield* Stream.runForEach(reconnectedRequests, (request) => {
+ routedTabId = request.tabId;
+ return broker.respond({ requestId: request.requestId, ok: true });
+ }).pipe(Effect.forkScoped);
+ yield* Effect.yieldNow;
+
+ yield* broker.invoke<void>({ scope, operation: "click", input: { x: 10, y: 10 } });
+
+ expect(routedTabId).toBe("tab-current");
+ }),
+ ),
+);
+
+it.effect("ignores stale owner cleanup after the client moves to another thread", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* PreviewAutomationBroker.__testing.make;
+ const requests = yield* broker.connect(makeOwner());
yield* Stream.runForEach(requests, (request) =>
broker.respond({ requestId: request.requestId, ok: true }),
).pipe(Effect.forkScoped);
yield* Effect.yieldNow;
- yield* broker.reportOwner({
- clientId: "client-hidden",
+
+ yield* broker.clearOwner({
+ clientId: "client-1",
environmentId: scope.environmentId,
- threadId: scope.threadId,
- tabId: "tab-hidden",
- visible: false,
- supportsAutomation: true,
- focusedAt: "2026-06-11T00:00:00.000Z",
+ threadId: ThreadId.make("thread-stale"),
});
- yield* broker.invoke<void>({ scope, operation: "click", input: { x: 10, y: 10 } });
+ yield* broker.invoke<void>({ scope, operation: "status", input: {} });
+ }),
+ ),
+);
+
+it.effect("fails requests assigned to a browser stream when that stream reconnects", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* PreviewAutomationBroker.__testing.make;
+ const _requests = yield* broker.connect(makeOwner());
+ const pending = yield* broker
+ .invoke<void>({ scope, operation: "status", input: {} })
+ .pipe(Effect.flip, Effect.forkScoped);
+ yield* Effect.yieldNow;
+
+ const _replacementRequests = yield* broker.connect(makeOwner());
+
+ const error = yield* Fiber.join(pending);
+ expect(error).toBeInstanceOf(PreviewAutomationUnavailableError);
+ }),
+ ),
+);
+
+it.effect("falls back to an older connected owner when a newer report is not connected", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const broker = yield* PreviewAutomationBroker.__testing.make;
+ const requests = yield* broker.connect(makeOwner({ clientId: "client-connected" }));
+ yield* Stream.runForEach(requests, (request) =>
+ broker.respond({ requestId: request.requestId, ok: true, result: "connected" }),
+ ).pipe(Effect.forkScoped);
+ yield* Effect.yieldNow;
+ yield* broker.reportOwner(
+ makeOwner({
+ clientId: "client-report-only",
+ focusedAt: "2026-06-11T00:00:01.000Z",
+ }),
+ );
+
+ const result = yield* broker.invoke<string>({ scope, operation: "status", input: {} });
+
+ expect(result).toBe("connected");
}),
),
);
diff --git a/apps/server/src/mcp/PreviewAutomationBroker.ts b/apps/server/src/mcp/PreviewAutomationBroker.ts
index e0a7b0c92..3cd7563bd 100644
--- a/apps/server/src/mcp/PreviewAutomationBroker.ts
+++ b/apps/server/src/mcp/PreviewAutomationBroker.ts
@@ -11,6 +11,7 @@ import {
type PreviewAutomationError,
type PreviewAutomationOperation,
type PreviewAutomationOwner,
+ type PreviewAutomationOwnerIdentity,
type PreviewAutomationRequest,
type PreviewAutomationResponse,
type PreviewTabId,
@@ -35,11 +36,13 @@ export interface PreviewAutomationInvokeInput {
}
export interface PreviewAutomationBrokerShape {
- readonly connect: (clientId: string) => Effect.Effect<Stream.Stream<PreviewAutomationRequest>>;
+ readonly connect: (
+ owner: PreviewAutomationOwner,
+ ) => Effect.Effect<Stream.Stream<PreviewAutomationRequest>>;
readonly reportOwner: (
owner: PreviewAutomationOwner,
) => Effect.Effect<void, PreviewAutomationError>;
- readonly clearOwner: (clientId: string) => Effect.Effect<void>;
+ readonly clearOwner: (owner: PreviewAutomationOwnerIdentity) => Effect.Effect<void>;
readonly respond: (
response: PreviewAutomationResponse,
) => Effect.Effect<void, PreviewAutomationError>;
@@ -63,7 +66,7 @@ interface ClientConnection {
}
interface PendingRequest {
- readonly clientId: string;
+ readonly queue: ClientConnection["queue"];
readonly deferred: Deferred.Deferred<unknown, PreviewAutomationError>;
}
@@ -133,17 +136,16 @@ const make = Effect.gen(function* PreviewAutomationBrokerMake() {
queue: ClientConnection["queue"],
) {
const toFail = yield* SynchronizedRef.modify(state, (current) => {
- if (current.clients.get(clientId)?.queue !== queue) {
- return [[] as ReadonlyArray<PendingRequest>, current] as const;
- }
const clients = new Map(current.clients);
const owners = new Map(current.owners);
const pending = new Map(current.pending);
const disconnected: PendingRequest[] = [];
- clients.delete(clientId);
- owners.delete(clientId);
+ if (current.clients.get(clientId)?.queue === queue) {
+ clients.delete(clientId);
+ owners.delete(clientId);
+ }
for (const [requestId, entry] of pending) {
- if (entry.clientId === clientId) {
+ if (entry.queue === queue) {
pending.delete(requestId);
disconnected.push(entry);
}
@@ -166,12 +168,22 @@ const make = Effect.gen(function* PreviewAutomationBrokerMake() {
const connect: PreviewAutomationBrokerShape["connect"] = Effect.fn(
"PreviewAutomationBroker.connect",
- )(function* (clientId) {
+ )(function* (owner) {
+ const clientId = owner.clientId;
const queue = yield* Queue.unbounded<import("@t3tools/contracts").PreviewAutomationRequest>();
const previous = yield* SynchronizedRef.modify(state, (current) => {
const clients = new Map(current.clients);
+ const owners = new Map(current.owners);
+ const existingOwner = current.owners.get(clientId);
clients.set(clientId, { clientId, queue });
- return [current.clients.get(clientId), { ...current, clients }] as const;
+ owners.set(
+ clientId,
+ existingOwner?.environmentId === owner.environmentId &&
+ existingOwner.threadId === owner.threadId
+ ? { ...existingOwner, supportsAutomation: owner.supportsAutomation }
+ : owner,
+ );
+ return [current.clients.get(clientId), { ...current, clients, owners }] as const;
});
if (previous) yield* disconnect(clientId, previous.queue);
return Stream.fromQueue(queue).pipe(Stream.ensuring(disconnect(clientId, queue)));
@@ -189,10 +201,18 @@ const make = Effect.gen(function* PreviewAutomationBrokerMake() {
const clearOwner: PreviewAutomationBrokerShape["clearOwner"] = Effect.fn(
"PreviewAutomationBroker.clearOwner",
- )(function* (clientId) {
+ )(function* (owner) {
yield* SynchronizedRef.update(state, (current) => {
+ const currentOwner = current.owners.get(owner.clientId);
+ if (
+ !currentOwner ||
+ currentOwner.environmentId !== owner.environmentId ||
+ currentOwner.threadId !== owner.threadId
+ ) {
+ return current;
+ }
const owners = new Map(current.owners);
- owners.delete(clientId);
+ owners.delete(owner.clientId);
return { ...current, owners };
});
});
@@ -234,8 +254,13 @@ const make = Effect.gen(function* PreviewAutomationBrokerMake() {
owner.supportsAutomation,
)
.sort((left, right) => right.focusedAt.localeCompare(left.focusedAt));
- const owner = candidates[0];
+ const owner = candidates.find((candidate) => current.clients.has(candidate.clientId));
if (!owner) {
+ if (candidates.length > 0) {
+ return yield* new PreviewAutomationUnavailableError({
+ message: "The browser host is not connected.",
+ });
+ }
return yield* new PreviewAutomationNoFocusedOwnerError({
message: "No desktop browser host is available for this thread.",
});
@@ -246,22 +271,12 @@ const make = Effect.gen(function* PreviewAutomationBrokerMake() {
message: "The browser host is not connected.",
});
}
- if (
- input.operation !== "open" &&
- input.operation !== "status" &&
- !owner.tabId &&
- !input.tabId
- ) {
- return yield* new PreviewAutomationTabNotFoundError({
- message: "The browser host does not have an active tab.",
- });
- }
const timeoutMs = input.timeoutMs ?? 15_000;
const deferred = yield* Deferred.make<unknown, PreviewAutomationError>();
const requestId = yield* SynchronizedRef.modify(state, (next) => {
const requestId = `preview-${next.requestSequence}`;
const pending = new Map(next.pending);
- pending.set(requestId, { clientId: owner.clientId, deferred });
+ pending.set(requestId, { queue: connection.queue, deferred });
return [requestId, { ...next, pending, requestSequence: next.requestSequence + 1 }] as const;
});
const removePending = SynchronizedRef.update(state, (next) => {
diff --git a/apps/server/src/ws.ts b/apps/server/src/ws.ts
index 1ad37e7c4..29ade95d3 100644
--- a/apps/server/src/ws.ts
+++ b/apps/server/src/ws.ts
@@ -1489,7 +1489,7 @@ const makeWsRpcLayer = (currentSession: AuthenticatedSession) =>
[WS_METHODS.previewAutomationConnect]: (input) =>
observeRpcStreamEffect(
WS_METHODS.previewAutomationConnect,
- previewAutomationBroker.connect(input.clientId),
+ previewAutomationBroker.connect(input),
{ "rpc.aggregate": "preview-automation" },
),
[WS_METHODS.previewAutomationRespond]: (input) =>
@@ -1507,7 +1507,7 @@ const makeWsRpcLayer = (currentSession: AuthenticatedSession) =>
[WS_METHODS.previewAutomationClearOwner]: (input) =>
observeRpcEffect(
WS_METHODS.previewAutomationClearOwner,
- previewAutomationBroker.clearOwner(input.clientId),
+ previewAutomationBroker.clearOwner(input),
{ "rpc.aggregate": "preview-automation" },
),
[WS_METHODS.subscribePreviewEvents]: (_input) =>
diff --git a/apps/web/src/components/preview/PreviewAutomationOwner.test.ts b/apps/web/src/components/preview/PreviewAutomationOwner.test.ts
index df5d99447..fe11ea75a 100644
--- a/apps/web/src/components/preview/PreviewAutomationOwner.test.ts
+++ b/apps/web/src/components/preview/PreviewAutomationOwner.test.ts
@@ -3,11 +3,11 @@ import { describe, expect, it } from "vite-plus/test";
import { observeAutomationOwnerConnectedGeneration } from "./PreviewAutomationOwner";
describe("observeAutomationOwnerConnectedGeneration", () => {
- it("re-reports ownership only after a later transport generation connects", () => {
+ it("reports ownership when the initial transport generation connects", () => {
const initial = observeAutomationOwnerConnectedGeneration(null, 1);
expect(initial).toEqual({
nextGeneration: 1,
- shouldReport: false,
+ shouldReport: true,
});
const disconnected = observeAutomationOwnerConnectedGeneration(initial.nextGeneration, null);
diff --git a/apps/web/src/components/preview/PreviewAutomationOwner.tsx b/apps/web/src/components/preview/PreviewAutomationOwner.tsx
index a1b24cd55..0264cf7a0 100644
--- a/apps/web/src/components/preview/PreviewAutomationOwner.tsx
+++ b/apps/web/src/components/preview/PreviewAutomationOwner.tsx
@@ -1,15 +1,16 @@
"use client";
+import { useAtomValue } from "@effect/atom-react";
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
import type {
PreviewAutomationNavigateInput,
PreviewAutomationOpenInput,
PreviewAutomationRequest,
- PreviewAutomationResponse,
+ PreviewAutomationOwner as PreviewAutomationOwnerState,
PreviewAutomationStatus,
ScopedThreadRef,
} from "@t3tools/contracts";
-import { useCallback, useEffect, useId, useRef } from "react";
+import { useCallback, useEffect, useEffectEvent, useId, useMemo, useRef, useState } from "react";
import {
applyPreviewServerSnapshot,
@@ -20,11 +21,14 @@ import { useRightPanelStore } from "~/rightPanelStore";
import { resolveBrowserNavigationTarget } from "~/browser/browserTargetResolver";
import { startBrowserRecording, stopBrowserRecording } from "~/browser/browserRecording";
import { previewEnvironment } from "~/state/preview";
-import { useEnvironmentQuery } from "~/state/query";
import { useEnvironmentConnectionState } from "~/state/environments";
import { useAtomCommand } from "~/state/use-atom-command";
import { previewBridge } from "./previewBridge";
+import {
+ createLatestPreviewAutomationRequestHandler,
+ createPreviewAutomationRequestConsumerAtom,
+} from "./previewAutomationRequestConsumer";
export function observeAutomationOwnerConnectedGeneration(
previousGeneration: number | null,
@@ -41,7 +45,7 @@ export function observeAutomationOwnerConnectedGeneration(
}
return {
nextGeneration: connectedGeneration,
- shouldReport: previousGeneration !== null && previousGeneration !== connectedGeneration,
+ shouldReport: previousGeneration !== connectedGeneration,
};
}
@@ -109,24 +113,10 @@ const currentStatus = async (
};
};
-const serializeError = (error: unknown): NonNullable<PreviewAutomationResponse["error"]> => {
- if (error instanceof Error) {
- const detail =
- "detail" in error && (error as { detail?: unknown }).detail !== undefined
- ? (error as { detail?: unknown }).detail
- : undefined;
- return {
- _tag: error.name.startsWith("PreviewAutomation")
- ? error.name
- : "PreviewAutomationExecutionError",
- message: error.message,
- ...(detail === undefined ? {} : { detail }),
- };
- }
- return {
- _tag: "PreviewAutomationExecutionError",
- message: String(error),
- };
+const previewTabNotFoundError = (): Error => {
+ const error = new Error("Preview tab is not initialized.");
+ error.name = "PreviewAutomationTabNotFoundError";
+ return error;
};
export function PreviewAutomationOwner(props: {
@@ -135,12 +125,22 @@ export function PreviewAutomationOwner(props: {
}) {
const { threadRef, visible } = props;
const automationClientId = useId();
- const automationRequests = useEnvironmentQuery(
- previewEnvironment.automationRequests({
+ const initialAutomationOwner = useMemo<PreviewAutomationOwnerState>(
+ () => ({
+ clientId: automationClientId,
environmentId: threadRef.environmentId,
- input: { clientId: automationClientId },
+ threadId: threadRef.threadId,
+ tabId: null,
+ visible: false,
+ supportsAutomation: Boolean(previewBridge?.automation),
+ focusedAt: new Date().toISOString(),
}),
+ [automationClientId, threadRef.environmentId, threadRef.threadId],
);
+ const automationRequestsAtom = previewEnvironment.automationRequests({
+ environmentId: threadRef.environmentId,
+ input: initialAutomationOwner,
+ });
const connectionState = useEnvironmentConnectionState(threadRef.environmentId).data;
const connectedGeneration =
connectionState?.phase === "connected" ? connectionState.generation : null;
@@ -159,13 +159,24 @@ export function PreviewAutomationOwner(props: {
previewEnvironment.clearAutomationOwner,
"preview automation owner clear",
);
- const ownerStateRef = useRef({ threadRef, visible });
const connectedGenerationRef = useRef<number | null>(null);
- const handlerRef = useRef<(request: PreviewAutomationRequest) => Promise<unknown>>(
- async () => undefined,
- );
+ const reportCurrentAutomationOwner = useEffectEvent(() => {
+ const state = readThreadPreviewState(threadRef);
+ return reportAutomationOwner({
+ environmentId: threadRef.environmentId,
+ input: {
+ clientId: automationClientId,
+ environmentId: threadRef.environmentId,
+ threadId: threadRef.threadId,
+ tabId: state.snapshot?.tabId ?? null,
+ visible,
+ supportsAutomation: Boolean(previewBridge?.automation),
+ focusedAt: new Date().toISOString(),
+ },
+ });
+ });
useEffect(() => {
- ownerStateRef.current = { threadRef, visible };
+ void reportCurrentAutomationOwner();
}, [threadRef, visible]);
const handleRequest = useCallback(
@@ -208,7 +219,7 @@ export function PreviewAutomationOwner(props: {
return currentStatus(threadRef, input.show ?? true);
}
case "navigate": {
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
const input = request.input as PreviewAutomationNavigateInput;
const resolution = resolveBrowserNavigationTarget(
threadRef.environmentId,
@@ -223,46 +234,46 @@ export function PreviewAutomationOwner(props: {
return currentStatus(threadRef, visible);
}
case "snapshot":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.snapshot(tabId);
case "click":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.click(
tabId,
request.input as Parameters<typeof previewBridge.automation.click>[1],
);
case "type":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.type(
tabId,
request.input as Parameters<typeof previewBridge.automation.type>[1],
);
case "press":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.press(
tabId,
request.input as Parameters<typeof previewBridge.automation.press>[1],
);
case "scroll":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.scroll(
tabId,
request.input as Parameters<typeof previewBridge.automation.scroll>[1],
);
case "evaluate":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.evaluate(
tabId,
request.input as Parameters<typeof previewBridge.automation.evaluate>[1],
);
case "waitFor":
- if (!previewBridge || !tabId) throw new Error("Preview tab is not initialized.");
+ if (!previewBridge || !tabId) throw previewTabNotFoundError();
return previewBridge.automation.waitFor(
tabId,
request.input as Parameters<typeof previewBridge.automation.waitFor>[1],
);
case "recordingStart": {
- if (!tabId) throw new Error("Preview tab is not initialized.");
+ if (!tabId) throw previewTabNotFoundError();
const startedAt = await startBrowserRecording(tabId);
return {
tabId,
@@ -271,7 +282,7 @@ export function PreviewAutomationOwner(props: {
};
}
case "recordingStop": {
- if (!tabId) throw new Error("Preview tab is not initialized.");
+ if (!tabId) throw previewTabNotFoundError();
const artifact = await stopBrowserRecording(tabId);
if (!artifact) throw new Error("No active recording exists for this preview tab.");
return artifact;
@@ -280,34 +291,34 @@ export function PreviewAutomationOwner(props: {
},
[open, threadRef, visible],
);
+ const [requestHandler] = useState(() =>
+ createLatestPreviewAutomationRequestHandler(handleRequest),
+ );
useEffect(() => {
- handlerRef.current = handleRequest;
- }, [handleRequest]);
+ requestHandler.set(handleRequest);
+ }, [handleRequest, requestHandler]);
- useEffect(() => {
- const request = automationRequests.data;
- if (!request) return;
- void handlerRef.current(request).then(
- (result) =>
- respondToAutomation({
- environmentId: threadRef.environmentId,
- input: {
- requestId: request.requestId,
- ok: true,
- ...(result === undefined ? {} : { result }),
- },
- }),
- (error) =>
- respondToAutomation({
- environmentId: threadRef.environmentId,
- input: {
- requestId: request.requestId,
- ok: false,
- error: serializeError(error),
- },
- }),
- );
- }, [automationRequests.data, respondToAutomation, threadRef.environmentId]);
+ const automationRequestConsumerAtom = useMemo(
+ () =>
+ createPreviewAutomationRequestConsumerAtom({
+ requestsAtom: automationRequestsAtom,
+ handleRequest: requestHandler.handle,
+ respond: (response) =>
+ respondToAutomation({
+ environmentId: threadRef.environmentId,
+ input: response,
+ }),
+ label: `preview:automation-request-consumer:${automationClientId}`,
+ }),
+ [
+ automationClientId,
+ automationRequestsAtom,
+ requestHandler,
+ respondToAutomation,
+ threadRef.environmentId,
+ ],
+ );
+ useAtomValue(automationRequestConsumerAtom);
useEffect(() => {
const observation = observeAutomationOwnerConnectedGeneration(
@@ -317,39 +328,11 @@ export function PreviewAutomationOwner(props: {
connectedGenerationRef.current = observation.nextGeneration;
if (!observation.shouldReport) return;
- const ownerState = ownerStateRef.current;
- const state = readThreadPreviewState(ownerState.threadRef);
- void reportAutomationOwner({
- environmentId: ownerState.threadRef.environmentId,
- input: {
- clientId: automationClientId,
- environmentId: ownerState.threadRef.environmentId,
- threadId: ownerState.threadRef.threadId,
- tabId: state.snapshot?.tabId ?? null,
- visible: ownerState.visible,
- supportsAutomation: Boolean(previewBridge?.automation),
- focusedAt: new Date().toISOString(),
- },
- });
- }, [automationClientId, connectedGeneration, reportAutomationOwner]);
+ void reportCurrentAutomationOwner();
+ }, [connectedGeneration]);
useEffect(() => {
- const report = () => {
- const state = readThreadPreviewState(threadRef);
- void reportAutomationOwner({
- environmentId: threadRef.environmentId,
- input: {
- clientId: automationClientId,
- environmentId: threadRef.environmentId,
- threadId: threadRef.threadId,
- tabId: state.snapshot?.tabId ?? null,
- visible,
- supportsAutomation: Boolean(previewBridge?.automation),
- focusedAt: new Date().toISOString(),
- },
- });
- };
- report();
+ const report = () => void reportCurrentAutomationOwner();
window.addEventListener("focus", report);
const unsubscribe = subscribeThreadPreviewState(threadRef, (state, previous) => {
if (state.snapshot?.tabId !== previous.snapshot?.tabId) {
@@ -361,10 +344,14 @@ export function PreviewAutomationOwner(props: {
unsubscribe();
void clearAutomationOwner({
environmentId: threadRef.environmentId,
- input: { clientId: automationClientId },
+ input: {
+ clientId: automationClientId,
+ environmentId: threadRef.environmentId,
+ threadId: threadRef.threadId,
+ },
});
};
- }, [automationClientId, clearAutomationOwner, reportAutomationOwner, threadRef, visible]);
+ }, [automationClientId, clearAutomationOwner, threadRef]);
return null;
}
diff --git a/apps/web/src/components/preview/previewAutomationRequestConsumer.test.ts b/apps/web/src/components/preview/previewAutomationRequestConsumer.test.ts
new file mode 100644
index 000000000..501fb156d
--- /dev/null
+++ b/apps/web/src/components/preview/previewAutomationRequestConsumer.test.ts
@@ -0,0 +1,81 @@
+import type { PreviewAutomationRequest, PreviewAutomationResponse } from "@t3tools/contracts";
+import { ThreadId } from "@t3tools/contracts";
+import { AsyncResult, Atom, AtomRegistry } from "effect/unstable/reactivity";
+import { describe, expect, it, vi } from "vite-plus/test";
+
+import {
+ createPreviewAutomationRequestConsumerAtom,
+ serializePreviewAutomationError,
+} from "./previewAutomationRequestConsumer";
+
+const request = (requestId: string): PreviewAutomationRequest => ({
+ requestId,
+ threadId: ThreadId.make("thread-1"),
+ operation: "status",
+ input: {},
+ timeoutMs: 15_000,
+});
+
+describe("previewAutomationRequestConsumer", () => {
+ it("consumes every request emitted before React can render", async () => {
+ const requestsAtom = Atom.make<AsyncResult.AsyncResult<PreviewAutomationRequest, Error>>(
+ AsyncResult.initial<PreviewAutomationRequest, Error>(false),
+ );
+ const handleRequest = vi.fn(async (value: PreviewAutomationRequest) => ({
+ requestId: value.requestId,
+ }));
+ const responses: PreviewAutomationResponse[] = [];
+ const respond = vi.fn(async (response: PreviewAutomationResponse) => {
+ responses.push(response);
+ });
+ const consumerAtom = createPreviewAutomationRequestConsumerAtom({
+ requestsAtom,
+ handleRequest,
+ respond,
+ label: "test:preview-automation-consumer",
+ });
+ const registry = AtomRegistry.make();
+ registry.mount(consumerAtom);
+
+ registry.set(requestsAtom, AsyncResult.success(request("request-1")));
+ registry.set(requestsAtom, AsyncResult.success(request("request-2")));
+
+ await vi.waitFor(() => expect(respond).toHaveBeenCalledTimes(2));
+ expect(handleRequest.mock.calls.map(([value]) => value.requestId)).toEqual([
+ "request-1",
+ "request-2",
+ ]);
+ expect(responses.map((response) => response.requestId)).toEqual(["request-1", "request-2"]);
+ registry.dispose();
+ });
+
+ it("consumes a request that arrived immediately before the consumer mounted", async () => {
+ const requestsAtom = Atom.make(
+ AsyncResult.success<PreviewAutomationRequest, Error>(request("request-ready")),
+ );
+ const respond = vi.fn(async (_response: PreviewAutomationResponse) => undefined);
+ const consumerAtom = createPreviewAutomationRequestConsumerAtom({
+ requestsAtom,
+ handleRequest: async () => undefined,
+ respond,
+ label: "test:preview-automation-initial-request",
+ });
+ const registry = AtomRegistry.make();
+
+ registry.mount(consumerAtom);
+
+ await vi.waitFor(() => expect(respond).toHaveBeenCalledTimes(1));
+ expect(respond).toHaveBeenCalledWith({ requestId: "request-ready", ok: true });
+ registry.dispose();
+ });
+
+ it("preserves typed automation errors in responses", () => {
+ const error = new Error("No preview tab");
+ error.name = "PreviewAutomationTabNotFoundError";
+
+ expect(serializePreviewAutomationError(error)).toEqual({
+ _tag: "PreviewAutomationTabNotFoundError",
+ message: "No preview tab",
+ });
+ });
+});
diff --git a/apps/web/src/components/preview/previewAutomationRequestConsumer.ts b/apps/web/src/components/preview/previewAutomationRequestConsumer.ts
new file mode 100644
index 000000000..bb8d8d58d
--- /dev/null
+++ b/apps/web/src/components/preview/previewAutomationRequestConsumer.ts
@@ -0,0 +1,83 @@
+import type { PreviewAutomationRequest, PreviewAutomationResponse } from "@t3tools/contracts";
+import { AsyncResult, Atom } from "effect/unstable/reactivity";
+
+type AutomationRequestResult<E> = AsyncResult.AsyncResult<PreviewAutomationRequest, E>;
+type AutomationRequestHandler = (request: PreviewAutomationRequest) => Promise<unknown>;
+
+export function createLatestPreviewAutomationRequestHandler(initial: AutomationRequestHandler): {
+ readonly set: (handler: AutomationRequestHandler) => void;
+ readonly handle: AutomationRequestHandler;
+} {
+ let current = initial;
+ return {
+ set: (handler) => {
+ current = handler;
+ },
+ handle: (request) => current(request),
+ };
+}
+
+export function serializePreviewAutomationError(
+ error: unknown,
+): NonNullable<PreviewAutomationResponse["error"]> {
+ if (error instanceof Error) {
+ const detail =
+ "detail" in error && (error as { detail?: unknown }).detail !== undefined
+ ? (error as { detail?: unknown }).detail
+ : undefined;
+ return {
+ _tag: error.name.startsWith("PreviewAutomation")
+ ? error.name
+ : "PreviewAutomationExecutionError",
+ message: error.message,
+ ...(detail === undefined ? {} : { detail }),
+ };
+ }
+ return {
+ _tag: "PreviewAutomationExecutionError",
+ message: String(error),
+ };
+}
+
+export function createPreviewAutomationRequestConsumerAtom<E>(options: {
+ readonly requestsAtom: Atom.Atom<AutomationRequestResult<E>>;
+ readonly handleRequest: (request: PreviewAutomationRequest) => Promise<unknown>;
+ readonly respond: (response: PreviewAutomationResponse) => Promise<unknown>;
+ readonly label: string;
+}): Atom.Atom<void> {
+ return Atom.make((get) => {
+ let disposed = false;
+ let requestsVersion = 0;
+
+ const consume = (result: AutomationRequestResult<E>) => {
+ if (!AsyncResult.isSuccess(result)) return;
+ const request = result.value;
+ void options.handleRequest(request).then(
+ (value) =>
+ options.respond({
+ requestId: request.requestId,
+ ok: true,
+ ...(value === undefined ? {} : { result: value }),
+ }),
+ (error) =>
+ options.respond({
+ requestId: request.requestId,
+ ok: false,
+ error: serializePreviewAutomationError(error),
+ }),
+ );
+ };
+
+ get.addFinalizer(() => {
+ disposed = true;
+ });
+ const initialRequest = get.once(options.requestsAtom);
+ get.subscribe(options.requestsAtom, (result) => {
+ requestsVersion += 1;
+ consume(result);
+ });
+ queueMicrotask(() => {
+ if (!disposed && requestsVersion === 0) consume(initialRequest);
+ });
+ }).pipe(Atom.setIdleTTL(0), Atom.withLabel(options.label));
+}
diff --git a/packages/client-runtime/src/state/preview.ts b/packages/client-runtime/src/state/preview.ts
index 1c9232057..800fc5efa 100644
--- a/packages/client-runtime/src/state/preview.ts
+++ b/packages/client-runtime/src/state/preview.ts
@@ -37,6 +37,10 @@ export function createPreviewEnvironmentAtoms<R, E>(
automationRequests: createEnvironmentRpcSubscriptionAtomFamily(runtime, {
label: "environment-data:preview:automation-requests",
tag: WS_METHODS.previewAutomationConnect,
+ // Automation requests are commands, not cached query data. Dispose the
+ // stream immediately with its owner so stale requests cannot replay when
+ // a thread remounts and the server can clear disconnected hosts promptly.
+ idleTtlMs: 0,
}),
open: createEnvironmentRpcCommand(runtime, {
label: "environment-data:preview:open",
diff --git a/packages/contracts/src/ipc.ts b/packages/contracts/src/ipc.ts
index f9377d6bf..9d6ed04c2 100644
--- a/packages/contracts/src/ipc.ts
+++ b/packages/contracts/src/ipc.ts
@@ -75,6 +75,7 @@ import {
PreviewAutomationClickInput,
PreviewAutomationEvaluateInput,
PreviewAutomationOwner,
+ PreviewAutomationOwnerIdentity,
PreviewAutomationPressInput,
PreviewAutomationRequest,
PreviewAutomationResponse,
@@ -1165,7 +1166,7 @@ export interface EnvironmentApi {
) => () => void;
respond: (response: PreviewAutomationResponse) => Promise<void>;
reportOwner: (owner: PreviewAutomationOwner) => Promise<void>;
- clearOwner: (input: { clientId: string }) => Promise<void>;
+ clearOwner: (input: PreviewAutomationOwnerIdentity) => Promise<void>;
};
onEvent: (
callback: (event: PreviewEvent) => void,
diff --git a/packages/contracts/src/previewAutomation.ts b/packages/contracts/src/previewAutomation.ts
index 791591a7a..110fc2415 100644
--- a/packages/contracts/src/previewAutomation.ts
+++ b/packages/contracts/src/previewAutomation.ts
@@ -410,10 +410,15 @@ export const PreviewAutomationRecordingArtifact = Schema.Struct({
});
export type PreviewAutomationRecordingArtifact = typeof PreviewAutomationRecordingArtifact.Type;
-export const PreviewAutomationOwner = Schema.Struct({
+export const PreviewAutomationOwnerIdentity = Schema.Struct({
clientId: TrimmedNonEmptyString,
environmentId: EnvironmentId,
threadId: ThreadId,
+});
+export type PreviewAutomationOwnerIdentity = typeof PreviewAutomationOwnerIdentity.Type;
+
+export const PreviewAutomationOwner = Schema.Struct({
+ ...PreviewAutomationOwnerIdentity.fields,
tabId: Schema.NullOr(PreviewTabId),
visible: Schema.Boolean,
supportsAutomation: Schema.Boolean,
diff --git a/packages/contracts/src/rpc.ts b/packages/contracts/src/rpc.ts
index 87c5a49c7..a2a8e9106 100644
--- a/packages/contracts/src/rpc.ts
+++ b/packages/contracts/src/rpc.ts
@@ -108,6 +108,7 @@ import {
import {
PreviewAutomationError,
PreviewAutomationOwner,
+ PreviewAutomationOwnerIdentity,
PreviewAutomationRequest,
PreviewAutomationResponse,
} from "./previewAutomation.ts";
@@ -549,7 +550,7 @@ export const WsPreviewReportStatusRpc = Rpc.make(WS_METHODS.previewReportStatus,
});
export const WsPreviewAutomationConnectRpc = Rpc.make(WS_METHODS.previewAutomationConnect, {
- payload: Schema.Struct({ clientId: Schema.String }),
+ payload: PreviewAutomationOwner,
success: PreviewAutomationRequest,
error: Schema.Union([PreviewAutomationError, EnvironmentAuthorizationError]),
stream: true,
@@ -566,7 +567,7 @@ export const WsPreviewAutomationReportOwnerRpc = Rpc.make(WS_METHODS.previewAuto
});
export const WsPreviewAutomationClearOwnerRpc = Rpc.make(WS_METHODS.previewAutomationClearOwner, {
- payload: Schema.Struct({ clientId: Schema.String }),
+ payload: PreviewAutomationOwnerIdentity,
error: Schema.Union([PreviewAutomationError, EnvironmentAuthorizationError]),
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1bd9272b6..192723b76 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -194,10 +194,10 @@ importers:
dependencies:
'@callstack/liquid-glass':
specifier: ^0.7.1
'@clerk/expo':
specifier: 3.4.8-snapshot.v20260619001138
'@effect/atom-react':
specifier: 4.0.0-beta.78
version: 4.0.0-beta.78([email protected](patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5))([email protected])([email protected])
@@ -206,10 +206,10 @@ importers:
version: 0.4.2
'@expo/ui':
specifier: ~56.0.8
- version: 56.0.15(961c4aa6f32829b318e3c87ef20ad401)
+ version: 56.0.15(ab3f255d102c60ba0fd2bbe4e47ba584)
'@legendapp/list':
specifier: 3.0.0-beta.44
'@noble/curves':
specifier: 'catalog:'
version: 1.9.1
@@ -221,7 +221,7 @@ importers:
version: 1.3.0-beta.5(patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b345081e285a6c53a)(@shikijs/[email protected])([email protected]([email protected]))([email protected])
'@react-native-menu/menu':
specifier: ^2.0.0
'@shikijs/core':
specifier: 4.2.0
version: 4.2.0
@@ -242,7 +242,7 @@ importers:
version: link:../../packages/contracts
'@t3tools/mobile-markdown-text':
specifier: file:./modules/t3-markdown-text
- version: file:apps/mobile/modules/t3-markdown-text(f0ff241d48c23db461fff5d47e450578)
+ version: file:apps/mobile/modules/t3-markdown-text(e909ee9a8f7fbe234da80c739fca4984)
'@t3tools/mobile-review-diff-native':
specifier: file:./modules/t3-review-diff
version: file:apps/mobile/modules/t3-review-diff
@@ -263,40 +263,40 @@ importers:
version: 4.0.0-beta.78(patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5)
expo:
specifier: ^56.0.0
- version: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-asset:
specifier: ~56.0.15
expo-auth-session:
specifier: ~56.0.12
expo-build-properties:
specifier: ~56.0.15
version: 56.0.16([email protected])
expo-camera:
specifier: ~56.0.7
expo-clipboard:
specifier: ~56.0.3
expo-constants:
specifier: ~56.0.16
expo-crypto:
specifier: ~56.0.4
version: 56.0.4([email protected])
expo-dev-client:
specifier: ~56.0.16
expo-file-system:
specifier: ~56.0.7
expo-font:
specifier: ~56.0.5
expo-glass-effect:
specifier: ~56.0.4
expo-haptics:
specifier: ~56.0.3
version: 56.0.3([email protected])
@@ -305,19 +305,19 @@ importers:
version: 56.0.15([email protected])
expo-linking:
specifier: ~56.0.12
expo-network:
specifier: ~56.0.5
expo-notifications:
specifier: ~56.0.14
expo-paste-input:
specifier: ^0.1.15
expo-router:
specifier: ~56.2.7
- version: 56.2.8(5bfdf39b8f760e4dc2d5c3acffc97310)
+ version: 56.2.8(c021de11d02907bd585610408f5252e8)
expo-secure-store:
specifier: ~56.0.4
version: 56.0.4([email protected])
@@ -326,16 +326,16 @@ importers:
expo-symbols:
specifier: ~56.0.5
expo-updates:
specifier: ~56.0.17
expo-web-browser:
specifier: ~56.0.5
expo-widgets:
specifier: ~56.0.15
- version: 56.0.16(961c4aa6f32829b318e3c87ef20ad401)
+ version: 56.0.16(ab3f255d102c60ba0fd2bbe4e47ba584)
punycode:
specifier: ^2.3.1
version: 2.3.1
@@ -347,43 +347,43 @@ importers:
version: 19.2.3([email protected])
react-native:
specifier: 0.85.3
react-native-gesture-handler:
specifier: ~2.31.1
react-native-image-viewing:
specifier: ^0.2.2
react-native-keyboard-controller:
specifier: 1.21.6
react-native-nitro-markdown:
specifier: ^0.5.0
react-native-nitro-modules:
specifier: ^0.35.4
- version: 0.35.9(patch_hash=825622aae63a8fb5b904f3c77908a0e216261d727ea171709f2c0b6088422675)([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])
+ version: 0.35.9(patch_hash=825622aae63a8fb5b904f3c77908a0e216261d727ea171709f2c0b6088422675)([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])
react-native-reanimated:
specifier: 4.3.1
react-native-safe-area-context:
specifier: ~5.7.0
react-native-screens:
specifier: 4.25.2
react-native-shiki-engine:
specifier: ^0.3.12
react-native-svg:
specifier: 15.15.4
react-native-webview:
specifier: ^13.16.1
react-native-worklets:
specifier: 0.8.3
shiki:
specifier: 4.2.0
version: 4.2.0
@@ -392,7 +392,7 @@ importers:
version: 3.6.0
uniwind:
specifier: ^1.6.2
devDependencies:
'@effect/vitest':
specifier: 4.0.0-beta.78
@@ -10839,10 +10839,10 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.16
dependencies:
react: 19.2.3
'@capsizecss/[email protected]':
dependencies:
@@ -10946,23 +10946,23 @@ snapshots:
electron-store: 8.2.0
react-dom: 19.2.6([email protected])
dependencies:
'@clerk/clerk-js': 6.18.2-snapshot.v20260619001138([email protected]([email protected]))([email protected])
'@clerk/react': 6.10.4-snapshot.v20260619001138([email protected]([email protected]))([email protected])
'@clerk/shared': 4.19.2-snapshot.v20260619001138([email protected]([email protected]))([email protected])
base-64: 1.0.0
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
tslib: 2.8.1
optionalDependencies:
expo-crypto: 56.0.4([email protected])
expo-secure-store: 56.0.4([email protected])
react-dom: 19.2.3([email protected])
@@ -11529,7 +11529,7 @@ snapshots:
'@expo-google-fonts/[email protected]': {}
dependencies:
'@expo/code-signing-certificates': 0.0.6
'@expo/config': 56.0.9([email protected])
@@ -11539,7 +11539,7 @@ snapshots:
'@expo/image-utils': 0.10.1([email protected])
'@expo/inline-modules': 0.0.10([email protected])
'@expo/json-file': 10.2.0
'@expo/metro': 56.0.0([email protected])([email protected])
'@expo/metro-config': 56.0.13(patch_hash=8cb08b5bb7051ed9d2dbe46a2c293c5a1e17f1bd6ddf30de27909e18c921ff46)([email protected])([email protected])([email protected])([email protected])
'@expo/metro-file-map': 56.0.3
@@ -11564,7 +11564,7 @@ snapshots:
connect: 3.7.0
debug: 4.4.3
dnssd-advertise: 1.1.4
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-server: 56.0.4
fetch-nodeshim: 0.4.10
getenv: 2.0.0
@@ -11590,8 +11590,8 @@ snapshots:
zod: 3.25.76
optionalDependencies:
- expo-router: 56.2.8(5bfdf39b8f760e4dc2d5c3acffc97310)
+ expo-router: 56.2.8(c021de11d02907bd585610408f5252e8)
transitivePeerDependencies:
- '@expo/dom-webview'
- '@expo/metro-runtime'
@@ -11653,18 +11653,18 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
chalk: 4.1.2
optionalDependencies:
react: 19.2.3
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
dependencies:
@@ -11725,13 +11725,13 @@ snapshots:
- supports-color
- typescript
dependencies:
anser: 1.4.10
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
stacktrace-parser: 0.1.11
'@expo/[email protected](patch_hash=8cb08b5bb7051ed9d2dbe46a2c293c5a1e17f1bd6ddf30de27909e18c921ff46)([email protected])([email protected])([email protected])([email protected])':
@@ -11761,7 +11761,7 @@ snapshots:
postcss: 8.5.15
resolve-from: 5.0.0
optionalDependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -11779,14 +11779,14 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
anser: 1.4.10
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
pretty-format: 29.7.0
react: 19.2.3
stacktrace-parser: 0.1.11
whatwg-fetch: 3.6.20
optionalDependencies:
@@ -11861,14 +11861,14 @@ snapshots:
dependencies:
debug: 4.4.3
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-server: 56.0.4
react: 19.2.3
optionalDependencies:
- expo-router: 56.2.8(5bfdf39b8f760e4dc2d5c3acffc97310)
+ expo-router: 56.2.8(c021de11d02907bd585610408f5252e8)
react-dom: 19.2.3([email protected])
transitivePeerDependencies:
- supports-color
@@ -11883,18 +11883,18 @@ snapshots:
'@expo/[email protected]': {}
- '@expo/[email protected](961c4aa6f32829b318e3c87ef20ad401)':
+ '@expo/[email protected](ab3f255d102c60ba0fd2bbe4e47ba584)':
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
sf-symbols-typescript: 2.2.0
optionalDependencies:
'@babel/core': 7.29.7
react-dom: 19.2.3([email protected])
transitivePeerDependencies:
- '@types/react'
- '@types/react-dom'
@@ -12155,13 +12155,13 @@ snapshots:
dependencies:
jsbi: 4.3.2
dependencies:
react: 19.2.3
use-sync-external-store: 1.6.0([email protected])
optionalDependencies:
react-dom: 19.2.3([email protected])
dependencies:
@@ -12984,15 +12984,15 @@ snapshots:
prompts: 2.4.2
tinyexec: 1.2.4
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
'@react-native/[email protected]': {}
@@ -13052,7 +13052,7 @@ snapshots:
tinyglobby: 0.2.17
yargs: 17.7.2
dependencies:
'@react-native/dev-middleware': 0.85.3([email protected])([email protected])
debug: 4.4.3
@@ -13062,7 +13062,7 @@ snapshots:
metro-core: 0.84.4
semver: 7.8.1
optionalDependencies:
- '@react-native/metro-config': 0.85.3(@babel/[email protected])([email protected])([email protected])
+ '@react-native/metro-config': 0.85.3(@babel/[email protected])
transitivePeerDependencies:
- bufferutil
- supports-color
@@ -13110,7 +13110,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ '@react-native/[email protected](@babel/[email protected])':
dependencies:
'@react-native/js-polyfills': 0.85.3
'@react-native/metro-babel-transformer': 0.85.3(@babel/[email protected])
@@ -13118,18 +13118,16 @@ snapshots:
metro-runtime: 0.84.4
transitivePeerDependencies:
- '@babel/core'
- - bufferutil
- supports-color
- - utf-8-validate
'@react-native/[email protected]': {}
dependencies:
invariant: 2.2.4
nullthrows: 1.1.1
react: 19.2.3
optionalDependencies:
'@types/react': 19.2.16
@@ -13542,15 +13540,15 @@ snapshots:
dependencies:
defer-to-connect: 2.0.1
- '@t3tools/mobile-markdown-text@file:apps/mobile/modules/t3-markdown-text(f0ff241d48c23db461fff5d47e450578)':
+ '@t3tools/mobile-markdown-text@file:apps/mobile/modules/t3-markdown-text(e909ee9a8f7fbe234da80c739fca4984)':
dependencies:
expo-haptics: 56.0.3([email protected])
react: 19.2.3
'@t3tools/mobile-review-diff-native@file:apps/mobile/modules/t3-review-diff': {}
@@ -14626,8 +14624,8 @@ snapshots:
react-refresh: 0.14.2
optionalDependencies:
'@babel/runtime': 7.29.7
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
- expo-widgets: 56.0.16(961c4aa6f32829b318e3c87ef20ad401)
+ expo-widgets: 56.0.16(ab3f255d102c60ba0fd2bbe4e47ba584)
transitivePeerDependencies:
- '@babel/core'
- supports-color
@@ -15518,29 +15516,29 @@ snapshots:
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
'@expo/image-utils': 0.10.1([email protected])
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
transitivePeerDependencies:
- supports-color
- typescript
dependencies:
expo-application: 56.0.3([email protected])
expo-crypto: 56.0.4([email protected])
invariant: 2.2.4
react: 19.2.3
transitivePeerDependencies:
- expo
- supports-color
@@ -15548,119 +15546,119 @@ snapshots:
dependencies:
'@expo/schema-utils': 56.0.1
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
resolve-from: 5.0.0
semver: 7.8.1
dependencies:
barcode-detector: 3.2.0(@types/[email protected])
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
transitivePeerDependencies:
- '@types/emscripten'
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
dependencies:
'@expo/env': 2.3.0
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
transitivePeerDependencies:
- supports-color
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-dev-menu-interface: 56.0.1([email protected])
expo-manifests: 56.0.4([email protected])
expo-updates-interface: 56.0.2([email protected])
transitivePeerDependencies:
- react-native
dependencies:
'@expo/schema-utils': 56.0.1
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-manifests: 56.0.4([email protected])
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-dev-menu-interface: 56.0.1([email protected])
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
fontfaceobserver: 2.3.0
react: 19.2.3
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-image-loader: 56.0.3([email protected])
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
dependencies:
invariant: 2.2.4
react: 19.2.3
transitivePeerDependencies:
- expo
- supports-color
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-json-utils: 56.0.0
@@ -15673,66 +15671,66 @@ snapshots:
- supports-color
- typescript
dependencies:
'@expo/expo-modules-macros-plugin': 0.0.9
invariant: 2.2.4
react: 19.2.3
optionalDependencies:
dependencies:
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
dependencies:
'@expo/image-utils': 0.10.1([email protected])
abort-controller: 3.0.0
badgin: 1.2.3
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-application: 56.0.3([email protected])
react: 19.2.3
transitivePeerDependencies:
- supports-color
- typescript
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
- [email protected](5bfdf39b8f760e4dc2d5c3acffc97310):
+ [email protected](c021de11d02907bd585610408f5252e8):
dependencies:
'@expo/schema-utils': 56.0.1
- '@expo/ui': 56.0.15(961c4aa6f32829b318e3c87ef20ad401)
+ '@expo/ui': 56.0.15(ab3f255d102c60ba0fd2bbe4e47ba584)
'@radix-ui/react-slot': 1.2.4(@types/[email protected])([email protected])
'@testing-library/jest-dom': 6.9.1
'@testing-library/user-event': 14.6.1(@testing-library/[email protected])
client-only: 0.0.1
color: 4.2.3
debug: 4.4.3
escape-string-regexp: 4.0.0
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-server: 56.0.4
fast-deep-equal: 3.1.3
invariant: 2.2.4
nanoid: 3.3.12
@@ -15740,18 +15738,18 @@ snapshots:
react: 19.2.3
react-fast-compare: 3.2.2
react-is: 19.2.7
- react-native-drawer-layout: 4.2.4(0e9729601f58a7a7ae26c76fe6017455)
server-only: 0.0.1
sf-symbols-typescript: 2.2.0
shallowequal: 1.1.0
optionalDependencies:
react-dom: 19.2.3([email protected])
transitivePeerDependencies:
- '@babel/core'
- '@testing-library/dom'
@@ -15763,7 +15761,7 @@ snapshots:
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
@@ -15771,7 +15769,7 @@ snapshots:
dependencies:
'@expo/config-plugins': 56.0.8([email protected])
'@expo/image-utils': 0.10.1([email protected])
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
xml2js: 0.6.0
transitivePeerDependencies:
- supports-color
@@ -15779,20 +15777,20 @@ snapshots:
dependencies:
'@expo-google-fonts/material-symbols': 0.4.38
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
react: 19.2.3
sf-symbols-typescript: 2.2.0
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
dependencies:
'@expo/code-signing-certificates': 0.0.6
'@expo/plist': 0.7.0
@@ -15800,7 +15798,7 @@ snapshots:
arg: 4.1.3
chalk: 4.1.2
debug: 4.4.3
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
expo-eas-client: 56.0.1
expo-manifests: 56.0.4([email protected])
expo-structured-headers: 56.0.0
@@ -15810,25 +15808,25 @@ snapshots:
ignore: 5.3.2
nullthrows: 1.1.1
react: 19.2.3
resolve-from: 5.0.0
optionalDependencies:
transitivePeerDependencies:
- supports-color
dependencies:
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
- [email protected](961c4aa6f32829b318e3c87ef20ad401):
+ [email protected](ab3f255d102c60ba0fd2bbe4e47ba584):
dependencies:
'@expo/plist': 0.7.0
- '@expo/ui': 56.0.15(961c4aa6f32829b318e3c87ef20ad401)
- expo: 56.0.8(63f7aade424ad9e7b1154b679fa2a14d)
+ '@expo/ui': 56.0.15(ab3f255d102c60ba0fd2bbe4e47ba584)
react: 19.2.3
transitivePeerDependencies:
- '@babel/core'
- '@types/react'
@@ -15837,37 +15835,37 @@ snapshots:
- react-native-reanimated
- react-native-worklets
- [email protected](63f7aade424ad9e7b1154b679fa2a14d):
dependencies:
'@babel/runtime': 7.29.7
'@expo/config': 56.0.9([email protected])
'@expo/config-plugins': 56.0.8([email protected])
'@expo/fingerprint': 0.19.3
'@expo/local-build-cache-provider': 56.0.8([email protected])
'@expo/metro': 56.0.0([email protected])([email protected])
'@expo/metro-config': 56.0.13(patch_hash=8cb08b5bb7051ed9d2dbe46a2c293c5a1e17f1bd6ddf30de27909e18c921ff46)([email protected])([email protected])([email protected])([email protected])
'@ungap/structured-clone': 1.3.1
expo-keep-awake: 56.0.3([email protected])([email protected])
expo-modules-autolinking: 56.0.14([email protected])
pretty-format: 29.7.0
react: 19.2.3
react-refresh: 0.14.2
whatwg-url-minimum: 0.1.2
optionalDependencies:
react-dom: 19.2.3([email protected])
transitivePeerDependencies:
- '@babel/core'
- bufferutil
@@ -18285,102 +18283,102 @@ snapshots:
transitivePeerDependencies:
- supports-color
- [email protected](0e9729601f58a7a7ae26c76fe6017455):
dependencies:
color: 4.2.3
react: 19.2.3
use-latest-callback: 0.2.6([email protected])
dependencies:
'@egjs/hammerjs': 2.0.17
'@types/react-test-renderer': 19.1.0
hoist-non-react-statics: 3.3.2
invariant: 2.2.4
react: 19.2.3
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
- react-native-nitro-modules: 0.35.9(patch_hash=825622aae63a8fb5b904f3c77908a0e216261d727ea171709f2c0b6088422675)([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])
+ react-native-nitro-modules: 0.35.9(patch_hash=825622aae63a8fb5b904f3c77908a0e216261d727ea171709f2c0b6088422675)([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected])
optionalDependencies:
+ [email protected](patch_hash=825622aae63a8fb5b904f3c77908a0e216261d727ea171709f2c0b6088422675)([email protected](@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])([email protected])([email protected]))([email protected]):
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
semver: 7.8.1
dependencies:
react: 19.2.3
dependencies:
react: 19.2.3
react-freeze: 1.0.4([email protected])
warn-once: 0.1.1
dependencies:
'@shikijs/types': 4.2.0
'@shikijs/vscode-textmate': 10.0.2
react: 19.2.3
dependencies:
css-select: 5.2.2
css-tree: 1.1.3
react: 19.2.3
warn-once: 0.1.1
dependencies:
whatwg-url-without-unicode: 8.0.0-3
dependencies:
escape-string-regexp: 4.0.0
invariant: 2.2.4
react: 19.2.3
dependencies:
'@babel/core': 7.29.7
'@babel/plugin-transform-arrow-functions': 7.29.7(@babel/[email protected])
@@ -18392,23 +18390,23 @@ snapshots:
'@babel/plugin-transform-template-literals': 7.29.7(@babel/[email protected])
'@babel/plugin-transform-unicode-regex': 7.29.7(@babel/[email protected])
'@babel/preset-typescript': 7.29.7(@babel/[email protected])
- '@react-native/metro-config': 0.85.3(@babel/[email protected])([email protected])([email protected])
+ '@react-native/metro-config': 0.85.3(@babel/[email protected])
convert-source-map: 2.0.0
react: 19.2.3
semver: 7.8.1
transitivePeerDependencies:
- supports-color
dependencies:
'@react-native/assets-registry': 0.85.3
'@react-native/codegen': 0.85.3(@babel/[email protected])
- '@react-native/community-cli-plugin': 0.85.3(@react-native/[email protected](@babel/[email protected])([email protected])([email protected]))([email protected])([email protected])
+ '@react-native/community-cli-plugin': 0.85.3(@react-native/[email protected](@babel/[email protected]))([email protected])([email protected])
'@react-native/gradle-plugin': 0.85.3
'@react-native/js-polyfills': 0.85.3
'@react-native/normalize-colors': 0.85.3
abort-controller: 3.0.0
anser: 1.4.10
ansi-regex: 5.0.1
@@ -19437,14 +19435,14 @@ snapshots:
dependencies:
'@tailwindcss/node': 4.2.1
'@tailwindcss/oxide': 4.2.1
culori: 4.0.2
lightningcss: 1.30.1
react: 19.2.3
tailwindcss: 4.3.0