@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 22 lines 780 Bytes
Raw
1 import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
2
3 export type LinkedThreadRouteParams = {
4 readonly viaEnvironmentId: string;
5 readonly environmentId: string;
6 readonly threadId: string;
7 readonly label: string;
8 readonly title?: string;
9 };
10
11 /** The route params that open a linked environment's thread read-only. */
12 export const linkedThreadRouteParams = (
13 thread: { readonly environmentId: EnvironmentId; readonly threadId: ThreadId },
14 linked: { readonly viaEnvironmentId: EnvironmentId; readonly label: string },
15 title: string | null,
16 ): LinkedThreadRouteParams => ({
17 viaEnvironmentId: linked.viaEnvironmentId,
18 environmentId: thread.environmentId,
19 threadId: thread.threadId,
20 label: linked.label,
21 ...(title === null ? {} : { title }),
22 });