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

main
ts 68 lines 2.26 KB
Raw
1 import type { EnvironmentProject } from "@t3tools/client-runtime/state/shell";
2 import {
3 CommandId,
4 DEFAULT_PROVIDER_INTERACTION_MODE,
5 DEFAULT_RUNTIME_MODE,
6 MessageId,
7 ProviderInstanceId,
8 ThreadId,
9 } from "@t3tools/contracts";
10
11 import type { QueuedThreadMessage } from "../../state/thread-outbox-model";
12
13 export const SHOWCASE_PENDING_TASK_DEFINITIONS = [
14 {
15 projectId: "t3code",
16 id: "offline-launch-checklist",
17 // oxlint-disable-next-line t3code/no-untranslated-copy -- showcase fixture data
18 text: "Ship the offline launch checklist before touchdown ✈️",
19 branch: "feat/offline-launchpad",
20 minutesAgo: 8,
21 },
22 {
23 projectId: "react",
24 id: "train-tunnel-suspense",
25 // oxlint-disable-next-line t3code/no-untranslated-copy -- showcase fixture data
26 text: "Polish the Suspense handoff for the train tunnel 🚇",
27 branch: "perf/tunnel-handoff",
28 minutesAgo: 27,
29 },
30 ] as const;
31
32 const FALLBACK_MODEL_SELECTION = {
33 instanceId: ProviderInstanceId.make("codex"),
34 model: "gpt-5.4",
35 } as const;
36
37 export function buildShowcasePendingTasks(
38 projects: ReadonlyArray<EnvironmentProject>,
39 now: number,
40 ): ReadonlyArray<QueuedThreadMessage> {
41 return SHOWCASE_PENDING_TASK_DEFINITIONS.flatMap((definition) => {
42 const project = projects.find((candidate) => String(candidate.id) === definition.projectId);
43 if (!project) return [];
44
45 return [
46 {
47 environmentId: project.environmentId,
48 threadId: ThreadId.make(`showcase-pending-${definition.id}`),
49 messageId: MessageId.make(`showcase-pending-message-${definition.id}`),
50 commandId: CommandId.make(`showcase-pending-command-${definition.id}`),
51 text: definition.text,
52 attachments: [],
53 modelSelection: project.defaultModelSelection ?? FALLBACK_MODEL_SELECTION,
54 runtimeMode: DEFAULT_RUNTIME_MODE,
55 interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
56 creation: {
57 projectId: project.id,
58 projectTitle: project.title,
59 projectCwd: project.workspaceRoot,
60 workspaceMode: "local" as const,
61 branch: definition.branch,
62 worktreePath: project.workspaceRoot,
63 },
64 createdAt: new Date(now - definition.minutesAgo * 60_000).toISOString(),
65 },
66 ];
67 });
68 }