Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

pullRequestFixtures.ts

40 lines1.6 KB

1import type { OrchestrationThreadShell, OrchestrationV2ThreadShell } from "@t3tools/contracts";
2import * as DateTime from "effect/DateTime";
3export function v2PullRequestThread(thread: OrchestrationThreadShell): OrchestrationV2ThreadShell {
4 return {
5 id: thread.id,
6 projectId: thread.projectId,
7 title: thread.title,
8 providerInstanceId: thread.modelSelection.instanceId,
9 modelSelection: thread.modelSelection,
10 runtimeMode: thread.runtimeMode,
11 interactionMode: thread.interactionMode,
12 branch: thread.branch,
13 worktreePath: thread.worktreePath,
14 pullRequests: thread.pullRequests,
15 linkedPullRequest: thread.linkedPullRequest,
16 branchPullRequest: thread.branchPullRequest,
17 createdBy: "user",
18 creationSource: "web",
19 activeProviderThreadId: null,
20 lineage: { rootThreadId: thread.id, parentThreadId: null, relationshipToParent: null },
21 forkedFrom: null,
22 latestRunId: null,
23 activeRunId: null,
24 status: "idle",
25 pendingRuntimeRequest: null,
26 latestVisibleMessage: null,
27 latestUserMessageAt: thread.latestUserMessageAt
28 ? DateTime.makeUnsafe(thread.latestUserMessageAt)
29 : null,
30 hasActionableProposedPlan: false,
31 itemCount: 0,
32 visibleItemCount: 0,
33 createdAt: DateTime.makeUnsafe(thread.createdAt),
34 updatedAt: DateTime.makeUnsafe(thread.updatedAt),
35 archivedAt: thread.archivedAt ? DateTime.makeUnsafe(thread.archivedAt) : null,
36 settledOverride: thread.settledOverride,
37 settledAt: thread.settledAt ? DateTime.makeUnsafe(thread.settledAt) : null,
38 deletedAt: null,
39 };