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

turnItemPresentation.test.ts

36 lines1.2 KB

1import { RunId, ThreadId, TurnItemId, type OrchestrationV2TurnItem } from "@t3tools/contracts";
2import * as DateTime from "effect/DateTime";
3import { describe, expect, it } from "vite-plus/test";
4​
5import { turnItemIsWorkspacePreparation } from "./turnItemPresentation.ts";
6​
7function command(input: string): OrchestrationV2TurnItem {
8 const now = DateTime.makeUnsafe("2026-08-03T00:00:00.000Z");
9 return {
10 id: TurnItemId.make("item-command"),
11 threadId: ThreadId.make("thread-1"),
12 runId: RunId.make("run-1"),
13 nodeId: null,
14 providerThreadId: null,
15 providerTurnId: null,
16 nativeItemRef: null,
17 parentItemId: null,
18 ordinal: 1,
19 status: "completed",
20 title: "Workspace ready",
21 startedAt: now,
22 completedAt: now,
23 updatedAt: now,
24 type: "command_execution",
25 input,
26 output: "Workspace preparation completed.",
27 exitCode: 0,
28 };
30​
31describe("turnItemIsWorkspacePreparation", () => {
32 it("identifies the synthetic workspace preparation command", () => {
33 expect(turnItemIsWorkspacePreparation(command("Preparing workspace"))).toBe(true);
34 expect(turnItemIsWorkspacePreparation(command("prepare workspace"))).toBe(false);
35 });
36});