Compare commits

...
Author SHA1 Message Date
Julius Marmingeandcodex 33b347391d Merge origin/main into t3code/viteplus-migrate
Co-authored-by: codex <[email protected]>
2026-04-01 00:17:19 -07:00
Julius Marminge e3404d1710 Migrate CI and web tests to vite-plus
- switch workspace checks and tests to `vp`
- fold Vitest browser config into `vite.config.ts`
- add `electron-builder` for desktop packaging
2026-03-31 15:52:01 -07:00
Julius Marminge 5abe2845ca rev 2026-03-31 15:30:48 -07:00
Julius Marminge 435a08b35a pin it 2026-03-31 15:24:12 -07:00
Julius Marminge b6227a4b67 rev 2026-03-31 15:16:05 -07:00
Julius Marminge c190e9f2b7 Migrate workspace to package exports
- Remove tsconfig path aliases and Vite aliases
- Point contracts/shared packages at source entrypoints
- Update dev runner imports to use package specifiers
2026-03-31 14:57:00 -07:00
Julius Marminge 881c64937a Migrate build and tests to vite-plus
- Replace tsdown and Turbo build wiring with vite-plus tasks
- Switch server, desktop, and web tests to vite-plus test imports
- Tighten related Effect types and update CI/docs for the new workflow
2026-03-31 13:50:19 -07:00
168 changed files with 1336 additions and 936 deletions

No files matched your search

+2 -2
View File
@@ -1,13 +1,13 @@
# Scripts # Scripts
- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode. - `bun run dev` — Starts contracts, server, and web in workspace dev mode.
- `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution). - `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution).
- `bun run dev:web` — Starts just the Vite dev server for the web app. - `bun run dev:web` — Starts just the Vite dev server for the web app.
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state. - Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
- Override server CLI-equivalent flags from root dev commands with `--`, for example: - Override server CLI-equivalent flags from root dev commands with `--`, for example:
`bun run dev -- --base-dir ~/.t3-2` `bun run dev -- --base-dir ~/.t3-2`
- `bun run start` — Runs the production server (serves built web app as static files). - `bun run start` — Runs the production server (serves built web app as static files).
- `bun run build` — Builds contracts, web app, and server through Turbo. - `bun run build` — Builds workspace packages and apps through Vite+ task running.
- `bun run typecheck` — Strict TypeScript checks for all packages. - `bun run typecheck` — Strict TypeScript checks for all packages.
- `bun run test` — Runs workspace tests. - `bun run test` — Runs workspace tests.
- `bun run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch. - `bun run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
+15 -18
View File
@@ -19,18 +19,17 @@ jobs:
with: with:
bun-version-file: package.json bun-version-file: package.json
- name: Setup Node - name: Setup Vite+
uses: actions/setup-node@v6 uses: voidzero-dev/setup-vp@v1
with: with:
node-version-file: package.json node-version-file: package.json
run-install: false
- name: Cache Bun and Turbo - name: Cache Bun
uses: actions/cache@v5 uses: actions/cache@v5
with: with:
path: | path: ~/.bun/install/cache
~/.bun/install/cache key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
.turbo
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}- ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
@@ -45,22 +44,19 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: bun install --frozen-lockfile run: bun install --frozen-lockfile
- name: Format - name: Check workspace (lint & fmt)
run: bun run fmt:check run: vp check
- name: Lint - name: Check workspace (typecheck)
run: bun run lint run: vp run -r typecheck
- name: Typecheck
run: bun run typecheck
- name: Test - name: Test
run: bun run test run: vp test
- name: Install browser test runtime - name: Install browser test runtime
run: | run: |
cd apps/web cd apps/web
bunx playwright install --with-deps chromium vpx playwright install --with-deps chromium
- name: Browser test - name: Browser test
run: bun run --cwd apps/web test:browser run: bun run --cwd apps/web test:browser
@@ -85,10 +81,11 @@ jobs:
with: with:
bun-version-file: package.json bun-version-file: package.json
- name: Setup Node - name: Setup Vite+
uses: actions/setup-node@v6 uses: voidzero-dev/setup-vp@v1
with: with:
node-version-file: package.json node-version-file: package.json
run-install: false
- name: Exercise release-only workflow steps - name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts run: node scripts/release-smoke.ts
-15
View File
@@ -1,15 +0,0 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [
".reference",
".plans",
"dist",
"dist-electron",
"node_modules",
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts",
"apps/web/public/mockServiceWorker.js"
],
"sortPackageJson": {}
}
-22
View File
@@ -1,22 +0,0 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": [
"dist",
"dist-electron",
"node_modules",
"bun.lock",
"*.tsbuildinfo",
"**/routeTree.gen.ts"
],
"plugins": ["eslint", "oxc", "react", "unicorn", "typescript"],
"categories": {
"correctness": "warn",
"suspicious": "warn",
"perf": "warn"
},
"rules": {
"react-in-jsx-scope": "off",
"eslint/no-shadow": "off",
"eslint/no-await-in-loop": "off"
}
}
+2 -2
View File
@@ -2,8 +2,8 @@
## Task Completion Requirements ## Task Completion Requirements
- All of `bun fmt`, `bun lint`, and `bun typecheck` must pass before considering tasks completed. - `vp check` & `vp run typecheck` must pass before considering tasks completed.
- NEVER run `bun test`. Always use `bun run test` (runs Vitest). - NEVER run `bun test`. Always use `vp test` (runs Vitest).
## Project Snapshot ## Project Snapshot
+5 -5
View File
@@ -5,12 +5,12 @@
"main": "dist-electron/main.js", "main": "dist-electron/main.js",
"scripts": { "scripts": {
"dev": "bun run --parallel dev:bundle dev:electron", "dev": "bun run --parallel dev:bundle dev:electron",
"dev:bundle": "tsdown --watch", "dev:bundle": "vp pack --watch",
"dev:electron": "bun run scripts/dev-electron.mjs", "dev:electron": "bun run scripts/dev-electron.mjs",
"build": "tsdown", "build": "vp pack",
"start": "bun run scripts/start-electron.mjs", "start": "bun run scripts/start-electron.mjs",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests", "test": "vp test run --passWithNoTests",
"smoke-test": "node scripts/smoke-test.mjs" "smoke-test": "node scripts/smoke-test.mjs"
}, },
"dependencies": { "dependencies": {
@@ -22,9 +22,9 @@
"@t3tools/contracts": "workspace:*", "@t3tools/contracts": "workspace:*",
"@t3tools/shared": "workspace:*", "@t3tools/shared": "workspace:*",
"@types/node": "catalog:", "@types/node": "catalog:",
"tsdown": "catalog:", "electron-builder": "26.8.1",
"typescript": "catalog:", "typescript": "catalog:",
"vitest": "catalog:" "vite-plus": "catalog:"
}, },
"productName": "T3 Code (Alpha)" "productName": "T3 Code (Alpha)"
} }
+1 -1
View File
@@ -1,5 +1,5 @@
import type { BrowserWindow } from "electron"; import type { BrowserWindow } from "electron";
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vite-plus/test";
const { showMessageBoxMock } = vi.hoisted(() => ({ const { showMessageBoxMock } = vi.hoisted(() => ({
showMessageBoxMock: vi.fn(), showMessageBoxMock: vi.fn(),
+1 -1
View File
@@ -104,7 +104,7 @@ let destructiveMenuIconCache: Electron.NativeImage | null | undefined;
const desktopRuntimeInfo = resolveDesktopRuntimeInfo({ const desktopRuntimeInfo = resolveDesktopRuntimeInfo({
platform: process.platform, platform: process.platform,
processArch: process.arch, processArch: process.arch,
runningUnderArm64Translation: app.runningUnderARM64Translation === true, runningUnderArm64Translation: app.runningUnderARM64Translation,
}); });
const initialUpdateState = (): DesktopUpdateState => const initialUpdateState = (): DesktopUpdateState =>
createInitialDesktopUpdateState(app.getVersion(), desktopRuntimeInfo); createInitialDesktopUpdateState(app.getVersion(), desktopRuntimeInfo);
+1 -1
View File
@@ -3,7 +3,7 @@ import os from "node:os";
import path from "node:path"; import path from "node:path";
import { RotatingFileSink } from "@t3tools/shared/logging"; import { RotatingFileSink } from "@t3tools/shared/logging";
import { afterEach, describe, expect, it } from "vitest"; import { afterEach, describe, expect, it } from "vite-plus/test";
const tempRoots: string[] = []; const tempRoots: string[] = [];
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { isArm64HostRunningIntelBuild, resolveDesktopRuntimeInfo } from "./runtimeArch"; import { isArm64HostRunningIntelBuild, resolveDesktopRuntimeInfo } from "./runtimeArch";
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vite-plus/test";
import { syncShellEnvironment } from "./syncShellEnvironment"; import { syncShellEnvironment } from "./syncShellEnvironment";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
createInitialDesktopUpdateState, createInitialDesktopUpdateState,
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import type { DesktopUpdateState } from "@t3tools/contracts"; import type { DesktopUpdateState } from "@t3tools/contracts";
import { import {
+1 -1
View File
@@ -5,5 +5,5 @@
"types": ["node", "electron"], "types": ["node", "electron"],
"lib": ["ES2023", "DOM", "esnext.disposable"] "lib": ["ES2023", "DOM", "esnext.disposable"]
}, },
"include": ["src", "tsdown.config.ts"] "include": ["src", "vite.config.ts"]
} }
-21
View File
@@ -1,21 +0,0 @@
import { defineConfig } from "tsdown";
const shared = {
format: "cjs" as const,
outDir: "dist-electron",
sourcemap: true,
outExtensions: () => ({ js: ".js" }),
};
export default defineConfig([
{
...shared,
entry: ["src/main.ts"],
clean: true,
noExternal: (id) => id.startsWith("@t3tools/"),
},
{
...shared,
entry: ["src/preload.ts"],
},
]);
-24
View File
@@ -1,24 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist-electron/**"],
},
"dev": {
"dependsOn": ["t3#build"],
"persistent": true,
},
"start": {
"dependsOn": ["build", "@t3tools/web#build", "t3#build"],
"cache": false,
"persistent": true,
},
"smoke-test": {
"dependsOn": ["build", "@t3tools/web#build", "t3#build"],
"cache": false,
"outputs": [],
},
},
}
+26
View File
@@ -0,0 +1,26 @@
import { defineConfig } from "vite-plus";
const shared = {
format: "cjs" as const,
outDir: "dist-electron",
sourcemap: true,
outExtensions: () => ({ js: ".js" }),
};
export default defineConfig({
resolve: {
tsconfigPaths: true,
},
pack: [
{
...shared,
entry: ["src/main.ts"],
clean: true,
noExternal: (id) => id.startsWith("@t3tools/"),
},
{
...shared,
entry: ["src/preload.ts"],
},
],
});
@@ -115,19 +115,19 @@ function waitFor<A, E>(
predicate: (value: A) => boolean, predicate: (value: A) => boolean,
description: string, description: string,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<A, never>; ): Effect.Effect<A>;
function waitFor<A, B extends A, E>( function waitFor<A, B extends A, E>(
read: Effect.Effect<A, E>, read: Effect.Effect<A, E>,
predicate: (value: A) => value is B, predicate: (value: A) => value is B,
description: string, description: string,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<B, never>; ): Effect.Effect<B>;
function waitFor<A, E>( function waitFor<A, E>(
read: Effect.Effect<A, E>, read: Effect.Effect<A, E>,
predicate: (value: A) => boolean, predicate: (value: A) => boolean,
description: string, description: string,
timeoutMs = 40_000, timeoutMs = 40_000,
): Effect.Effect<A, never> { ): Effect.Effect<A> {
const RETRY_SIGNAL = "wait_for_retry"; const RETRY_SIGNAL = "wait_for_retry";
const retryIntervalMs = 10; const retryIntervalMs = 10;
const maxRetries = Math.max(0, Math.floor(timeoutMs / retryIntervalMs)); const maxRetries = Math.max(0, Math.floor(timeoutMs / retryIntervalMs));
@@ -176,11 +176,11 @@ export interface OrchestrationIntegrationHarness {
threadId: string, threadId: string,
predicate: (thread: OrchestrationThread) => boolean, predicate: (thread: OrchestrationThread) => boolean,
timeoutMs?: number, timeoutMs?: number,
) => Effect.Effect<OrchestrationThread, never>; ) => Effect.Effect<OrchestrationThread>;
readonly waitForDomainEvent: ( readonly waitForDomainEvent: (
predicate: (event: OrchestrationEvent) => boolean, predicate: (event: OrchestrationEvent) => boolean,
timeoutMs?: number, timeoutMs?: number,
) => Effect.Effect<ReadonlyArray<OrchestrationEvent>, never>; ) => Effect.Effect<ReadonlyArray<OrchestrationEvent>>;
readonly waitForPendingApproval: ( readonly waitForPendingApproval: (
requestId: string, requestId: string,
predicate: (row: { predicate: (row: {
@@ -189,25 +189,22 @@ export interface OrchestrationIntegrationHarness {
readonly resolvedAt: string | null; readonly resolvedAt: string | null;
}) => boolean, }) => boolean,
timeoutMs?: number, timeoutMs?: number,
) => Effect.Effect< ) => Effect.Effect<{
{ readonly status: "pending" | "resolved";
readonly status: "pending" | "resolved"; readonly decision: "accept" | "acceptForSession" | "decline" | "cancel" | null;
readonly decision: "accept" | "acceptForSession" | "decline" | "cancel" | null; readonly resolvedAt: string | null;
readonly resolvedAt: string | null; }>;
},
never
>;
readonly waitForReceipt: { readonly waitForReceipt: {
( (
predicate: (receipt: OrchestrationRuntimeReceipt) => boolean, predicate: (receipt: OrchestrationRuntimeReceipt) => boolean,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<OrchestrationRuntimeReceipt, never>; ): Effect.Effect<OrchestrationRuntimeReceipt>;
<Receipt extends OrchestrationRuntimeReceipt>( <Receipt extends OrchestrationRuntimeReceipt>(
predicate: (receipt: OrchestrationRuntimeReceipt) => receipt is Receipt, predicate: (receipt: OrchestrationRuntimeReceipt) => receipt is Receipt,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<Receipt, never>; ): Effect.Effect<Receipt>;
}; };
readonly dispose: Effect.Effect<void, never>; readonly dispose: Effect.Effect<void>;
} }
interface MakeOrchestrationIntegrationHarnessOptions { interface MakeOrchestrationIntegrationHarnessOptions {
@@ -394,7 +391,7 @@ export const makeOrchestrationIntegrationHarness = (
(thread): thread is OrchestrationThread => thread !== null && predicate(thread), (thread): thread is OrchestrationThread => thread !== null && predicate(thread),
`projected thread '${threadId}'`, `projected thread '${threadId}'`,
timeoutMs, timeoutMs,
) as Effect.Effect<OrchestrationThread, never>; ) as Effect.Effect<OrchestrationThread>;
const waitForDomainEvent: OrchestrationIntegrationHarness["waitForDomainEvent"] = ( const waitForDomainEvent: OrchestrationIntegrationHarness["waitForDomainEvent"] = (
predicate, predicate,
@@ -438,23 +435,20 @@ export const makeOrchestrationIntegrationHarness = (
} => row !== null && predicate(row), } => row !== null && predicate(row),
`pending approval '${requestId}'`, `pending approval '${requestId}'`,
timeoutMs, timeoutMs,
) as Effect.Effect< ) as Effect.Effect<{
{ readonly status: "pending" | "resolved";
readonly status: "pending" | "resolved"; readonly decision: "accept" | "acceptForSession" | "decline" | "cancel" | null;
readonly decision: "accept" | "acceptForSession" | "decline" | "cancel" | null; readonly resolvedAt: string | null;
readonly resolvedAt: string | null; }>;
},
never
>;
function waitForReceipt( function waitForReceipt(
predicate: (receipt: OrchestrationRuntimeReceipt) => boolean, predicate: (receipt: OrchestrationRuntimeReceipt) => boolean,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<OrchestrationRuntimeReceipt, never>; ): Effect.Effect<OrchestrationRuntimeReceipt>;
function waitForReceipt<Receipt extends OrchestrationRuntimeReceipt>( function waitForReceipt<Receipt extends OrchestrationRuntimeReceipt>(
predicate: (receipt: OrchestrationRuntimeReceipt) => receipt is Receipt, predicate: (receipt: OrchestrationRuntimeReceipt) => receipt is Receipt,
timeoutMs?: number, timeoutMs?: number,
): Effect.Effect<Receipt, never>; ): Effect.Effect<Receipt>;
function waitForReceipt( function waitForReceipt(
predicate: (receipt: OrchestrationRuntimeReceipt) => boolean, predicate: (receipt: OrchestrationRuntimeReceipt) => boolean,
timeoutMs?: number, timeoutMs?: number,
@@ -30,7 +30,7 @@ export interface TestTurnResponse {
readonly mutateWorkspace?: (input: { readonly mutateWorkspace?: (input: {
readonly cwd: string; readonly cwd: string;
readonly turnCount: number; readonly turnCount: number;
}) => Effect.Effect<void, never>; }) => Effect.Effect<void>;
} }
export type FixtureProviderRuntimeEvent = { export type FixtureProviderRuntimeEvent = {
@@ -183,9 +183,7 @@ export interface TestProviderAdapterHarness {
threadId: ThreadId, threadId: ThreadId,
response: TestTurnResponse, response: TestTurnResponse,
) => Effect.Effect<void, ProviderAdapterSessionNotFoundError>; ) => Effect.Effect<void, ProviderAdapterSessionNotFoundError>;
readonly queueTurnResponseForNextSession: ( readonly queueTurnResponseForNextSession: (response: TestTurnResponse) => Effect.Effect<void>;
response: TestTurnResponse,
) => Effect.Effect<void, never>;
readonly getStartCount: () => number; readonly getStartCount: () => number;
readonly getRollbackCalls: (threadId: ThreadId) => ReadonlyArray<number>; readonly getRollbackCalls: (threadId: ThreadId) => ReadonlyArray<number>;
readonly getInterruptCalls: (threadId: ThreadId) => ReadonlyArray<TurnId | undefined>; readonly getInterruptCalls: (threadId: ThreadId) => ReadonlyArray<TurnId | undefined>;
@@ -337,7 +335,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
} }
if (response.mutateWorkspace && state.session.cwd) { if (response.mutateWorkspace && state.session.cwd) {
yield* response.mutateWorkspace({ cwd: state.session.cwd!, turnCount }); yield* response.mutateWorkspace({ cwd: state.session.cwd, turnCount });
} }
const userItem = { const userItem = {
@@ -505,9 +503,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
), ),
); );
const queueTurnResponseForNextSession = ( const queueTurnResponseForNextSession = (response: TestTurnResponse): Effect.Effect<void> =>
response: TestTurnResponse,
): Effect.Effect<void, never> =>
Effect.sync(() => { Effect.sync(() => {
queuedResponsesForNextSession.push(response); queuedResponsesForNextSession.push(response);
}); });
@@ -58,7 +58,7 @@ function waitForSync<A>(
predicate: (value: A) => boolean, predicate: (value: A) => boolean,
description: string, description: string,
timeoutMs = 10_000, timeoutMs = 10_000,
): Effect.Effect<A, never> { ): Effect.Effect<A> {
return Effect.gen(function* () { return Effect.gen(function* () {
const deadline = Date.now() + timeoutMs; const deadline = Date.now() + timeoutMs;
@@ -226,9 +226,7 @@ it.live("runs a single turn end-to-end and persists checkpoint state in sqlite +
THREAD_ID, THREAD_ID,
(entry) => (entry) =>
entry.session?.status === "ready" && entry.session?.status === "ready" &&
entry.messages.some( entry.messages.some((message) => message.role === "assistant" && !message.streaming) &&
(message) => message.role === "assistant" && message.streaming === false,
) &&
entry.checkpoints.length === 1, entry.checkpoints.length === 1,
); );
assert.equal(thread.checkpoints[0]?.status, "ready"); assert.equal(thread.checkpoints[0]?.status, "ready");
@@ -309,9 +307,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
(entry) => (entry) =>
entry.session?.status === "ready" && entry.session?.status === "ready" &&
entry.session.providerName === "codex" && entry.session.providerName === "codex" &&
entry.messages.some( entry.messages.some((message) => message.role === "assistant" && !message.streaming),
(message) => message.role === "assistant" && message.streaming === false,
),
180_000, 180_000,
); );
assert.equal(firstThread.session?.threadId, "thread-1"); assert.equal(firstThread.session?.threadId, "thread-1");
@@ -40,7 +40,7 @@ const makeWorkspaceDirectory = Effect.gen(function* () {
interface IntegrationFixture { interface IntegrationFixture {
readonly cwd: string; readonly cwd: string;
readonly harness: TestProviderAdapterHarness; readonly harness: TestProviderAdapterHarness;
readonly layer: Layer.Layer<ProviderService, unknown, never>; readonly layer: Layer.Layer<ProviderService, unknown>;
} }
const makeIntegrationFixture = Effect.gen(function* () { const makeIntegrationFixture = Effect.gen(function* () {
+2 -3
View File
@@ -20,7 +20,7 @@
"start": "node dist/bin.mjs", "start": "node dist/bin.mjs",
"prepare": "effect-language-service patch", "prepare": "effect-language-service patch",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"test": "vitest run" "test": "vp test run"
}, },
"dependencies": { "dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.2.77", "@anthropic-ai/claude-agent-sdk": "^0.2.77",
@@ -40,9 +40,8 @@
"@t3tools/web": "workspace:*", "@t3tools/web": "workspace:*",
"@types/bun": "catalog:", "@types/bun": "catalog:",
"@types/node": "catalog:", "@types/node": "catalog:",
"tsdown": "catalog:",
"typescript": "catalog:", "typescript": "catalog:",
"vitest": "catalog:" "vite-plus": "catalog:"
}, },
"engines": { "engines": {
"node": "^22.16 || ^23.11 || >=24.10" "node": "^22.16 || ^23.11 || >=24.10"
+4 -4
View File
@@ -129,7 +129,7 @@ const buildCmd = Command.make(
const repoRoot = yield* RepoRoot; const repoRoot = yield* RepoRoot;
const serverDir = path.join(repoRoot, "apps/server"); const serverDir = path.join(repoRoot, "apps/server");
yield* Effect.log("[cli] Running tsdown..."); yield* Effect.log("[cli] Running vp pack...");
yield* runCommand( yield* runCommand(
ChildProcess.make({ ChildProcess.make({
cwd: serverDir, cwd: serverDir,
@@ -137,7 +137,7 @@ const buildCmd = Command.make(
stderr: "inherit", stderr: "inherit",
// Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd). // Windows needs shell mode to resolve .cmd shims (e.g. bun.cmd).
shell: process.platform === "win32", shell: process.platform === "win32",
})`bun tsdown`, })`vp pack`,
); );
const webDist = path.join(repoRoot, "apps/web/dist"); const webDist = path.join(repoRoot, "apps/web/dist");
@@ -151,7 +151,7 @@ const buildCmd = Command.make(
yield* Effect.logWarning("[cli] Web dist not found — skipping client bundle."); yield* Effect.logWarning("[cli] Web dist not found — skipping client bundle.");
} }
}), }),
).pipe(Command.withDescription("Build the server package (tsdown + bundle web client).")); ).pipe(Command.withDescription("Build the server package (vp pack + bundle web client)."));
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// publish subcommand // publish subcommand
@@ -205,7 +205,7 @@ const publishCmd = Command.make(
pkg.dependencies = resolveCatalogDependencies( pkg.dependencies = resolveCatalogDependencies(
pkg.dependencies, pkg.dependencies,
rootPackageJson.workspaces.catalog, rootPackageJson.catalog,
"apps/server dependencies", "apps/server dependencies",
); );
+1 -1
View File
@@ -2,7 +2,7 @@ import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
createAttachmentId, createAttachmentId,
+1 -1
View File
@@ -8,7 +8,7 @@ import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect"; import * as Effect from "effect/Effect";
import * as Fiber from "effect/Fiber"; import * as Fiber from "effect/Fiber";
import { TestClock } from "effect/testing"; import { TestClock } from "effect/testing";
import { vi } from "vitest"; import { vi } from "vite-plus/test";
import { readBootstrapEnvelope, resolveFdPath } from "./bootstrap"; import { readBootstrapEnvelope, resolveFdPath } from "./bootstrap";
import { assertNone, assertSome } from "@effect/vitest/utils"; import { assertNone, assertSome } from "@effect/vitest/utils";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { parseTurnDiffFilesFromUnifiedDiff } from "./Diffs.ts"; import { parseTurnDiffFilesFromUnifiedDiff } from "./Diffs.ts";
@@ -7,7 +7,7 @@ import {
type OrchestrationReadModel, type OrchestrationReadModel,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { Effect, Layer } from "effect"; import { Effect, Layer } from "effect";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { ProjectionSnapshotQuery } from "../../orchestration/Services/ProjectionSnapshotQuery.ts"; import { ProjectionSnapshotQuery } from "../../orchestration/Services/ProjectionSnapshotQuery.ts";
import { checkpointRefForThreadTurn } from "../Utils.ts"; import { checkpointRefForThreadTurn } from "../Utils.ts";
@@ -3,7 +3,7 @@ import path from "node:path";
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest"; import { it } from "@effect/vitest";
import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect"; import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
import { describe, expect } from "vitest"; import { describe, expect } from "vite-plus/test";
import { checkpointRefForThreadTurn } from "../Utils.ts"; import { checkpointRefForThreadTurn } from "../Utils.ts";
import { CheckpointStoreLive } from "./CheckpointStore.ts"; import { CheckpointStoreLive } from "./CheckpointStore.ts";
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vite-plus/test";
import { randomUUID } from "node:crypto"; import { randomUUID } from "node:crypto";
import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
import os from "node:os"; import os from "node:os";
+1 -1
View File
@@ -432,7 +432,7 @@ export interface CodexAppServerManagerEvents {
export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEvents> { export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEvents> {
private readonly sessions = new Map<ThreadId, CodexSessionContext>(); private readonly sessions = new Map<ThreadId, CodexSessionContext>();
private runPromise: (effect: Effect.Effect<unknown, never>) => Promise<unknown>; private runPromise: (effect: Effect.Effect<unknown>) => Promise<unknown>;
constructor(services?: ServiceMap.ServiceMap<never>) { constructor(services?: ServiceMap.ServiceMap<never>) {
super(); super();
this.runPromise = services ? Effect.runPromiseWith(services) : Effect.runPromise; this.runPromise = services ? Effect.runPromiseWith(services) : Effect.runPromise;
@@ -1,7 +1,7 @@
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest"; import { it } from "@effect/vitest";
import { Effect, FileSystem, Layer, Path } from "effect"; import { Effect, FileSystem, Layer, Path } from "effect";
import { expect } from "vitest"; import { expect } from "vite-plus/test";
import { ServerConfig } from "../../config.ts"; import { ServerConfig } from "../../config.ts";
import { TextGeneration } from "../Services/TextGeneration.ts"; import { TextGeneration } from "../Services/TextGeneration.ts";
@@ -1,7 +1,7 @@
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest"; import { it } from "@effect/vitest";
import { Effect, FileSystem, Layer, Path, Result } from "effect"; import { Effect, FileSystem, Layer, Path, Result } from "effect";
import { expect } from "vitest"; import { expect } from "vite-plus/test";
import { ServerConfig } from "../../config.ts"; import { ServerConfig } from "../../config.ts";
import { CodexTextGenerationLive } from "./CodexTextGeneration.ts"; import { CodexTextGenerationLive } from "./CodexTextGeneration.ts";
@@ -82,7 +82,7 @@ const makeCodexTextGeneration = Effect.gen(function* () {
); );
}; };
const safeUnlink = (filePath: string): Effect.Effect<void, never> => const safeUnlink = (filePath: string): Effect.Effect<void> =>
fileSystem.remove(filePath).pipe(Effect.catch(() => Effect.void)); fileSystem.remove(filePath).pipe(Effect.catch(() => Effect.void));
const materializeImageAttachments = ( const materializeImageAttachments = (
+2 -2
View File
@@ -4,7 +4,7 @@ import path from "node:path";
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest"; import { it } from "@effect/vitest";
import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect"; import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
import { describe, expect, vi } from "vitest"; import { describe, expect, vi } from "vite-plus/test";
import { GitCoreLive, makeGitCore } from "./GitCore.ts"; import { GitCoreLive, makeGitCore } from "./GitCore.ts";
import { GitCore, type GitCoreShape } from "../Services/GitCore.ts"; import { GitCore, type GitCoreShape } from "../Services/GitCore.ts";
@@ -432,7 +432,7 @@ it.layer(TestLayer)("git integration", (it) => {
const tmp = yield* makeTmpDir(); const tmp = yield* makeTmpDir();
yield* initRepoWithCommit(tmp); yield* initRepoWithCommit(tmp);
const result = yield* (yield* GitCore).listBranches({ cwd: tmp }); const result = yield* (yield* GitCore).listBranches({ cwd: tmp });
expect(result.branches.every((b) => b.isDefault === false)).toBe(true); expect(result.branches.every((b) => !b.isDefault)).toBe(true);
}), }),
); );
+2 -2
View File
@@ -324,7 +324,7 @@ function toGitCommandError(
interface Trace2Monitor { interface Trace2Monitor {
readonly env: NodeJS.ProcessEnv; readonly env: NodeJS.ProcessEnv;
readonly flush: Effect.Effect<void, never>; readonly flush: Effect.Effect<void>;
} }
function trace2ChildKey(record: Record<string, unknown>): string | null { function trace2ChildKey(record: Record<string, unknown>): string | null {
@@ -488,7 +488,7 @@ const collectOutput = Effect.fn("collectOutput")(function* <E>(
stream: Stream.Stream<Uint8Array, E>, stream: Stream.Stream<Uint8Array, E>,
maxOutputBytes: number, maxOutputBytes: number,
truncateOutputAtMaxBytes: boolean, truncateOutputAtMaxBytes: boolean,
onLine: ((line: string) => Effect.Effect<void, never>) | undefined, onLine: ((line: string) => Effect.Effect<void>) | undefined,
): Effect.fn.Return<{ readonly text: string; readonly truncated: boolean }, GitCommandError> { ): Effect.fn.Return<{ readonly text: string; readonly truncated: boolean }, GitCommandError> {
const decoder = new TextDecoder(); const decoder = new TextDecoder();
let bytes = 0; let bytes = 0;
+1 -1
View File
@@ -1,6 +1,6 @@
import { assert, it } from "@effect/vitest"; import { assert, it } from "@effect/vitest";
import { Effect } from "effect"; import { Effect } from "effect";
import { afterEach, expect, vi } from "vitest"; import { afterEach, expect, vi } from "vite-plus/test";
vi.mock("../../processRunner", () => ({ vi.mock("../../processRunner", () => ({
runProcess: vi.fn(), runProcess: vi.fn(),
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { it } from "@effect/vitest"; import { it } from "@effect/vitest";
import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect"; import { Effect, FileSystem, Layer, PlatformError, Scope } from "effect";
import { expect } from "vitest"; import { expect } from "vite-plus/test";
import type { GitActionProgressEvent, ModelSelection } from "@t3tools/contracts"; import type { GitActionProgressEvent, ModelSelection } from "@t3tools/contracts";
import { GitCommandError, GitHubCliError, TextGenerationError } from "@t3tools/contracts"; import { GitCommandError, GitHubCliError, TextGenerationError } from "@t3tools/contracts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
buildBranchNamePrompt, buildBranchNamePrompt,
+7 -7
View File
@@ -55,27 +55,27 @@ export interface GitPreparedCommitContext {
} }
export interface ExecuteGitProgress { export interface ExecuteGitProgress {
readonly onStdoutLine?: (line: string) => Effect.Effect<void, never>; readonly onStdoutLine?: (line: string) => Effect.Effect<void>;
readonly onStderrLine?: (line: string) => Effect.Effect<void, never>; readonly onStderrLine?: (line: string) => Effect.Effect<void>;
readonly onHookStarted?: (hookName: string) => Effect.Effect<void, never>; readonly onHookStarted?: (hookName: string) => Effect.Effect<void>;
readonly onHookFinished?: (input: { readonly onHookFinished?: (input: {
hookName: string; hookName: string;
exitCode: number | null; exitCode: number | null;
durationMs: number | null; durationMs: number | null;
}) => Effect.Effect<void, never>; }) => Effect.Effect<void>;
} }
export interface GitCommitProgress { export interface GitCommitProgress {
readonly onOutputLine?: (input: { readonly onOutputLine?: (input: {
stream: "stdout" | "stderr"; stream: "stdout" | "stderr";
text: string; text: string;
}) => Effect.Effect<void, never>; }) => Effect.Effect<void>;
readonly onHookStarted?: (hookName: string) => Effect.Effect<void, never>; readonly onHookStarted?: (hookName: string) => Effect.Effect<void>;
readonly onHookFinished?: (input: { readonly onHookFinished?: (input: {
hookName: string; hookName: string;
exitCode: number | null; exitCode: number | null;
durationMs: number | null; durationMs: number | null;
}) => Effect.Effect<void, never>; }) => Effect.Effect<void>;
} }
export interface GitCommitOptions { export interface GitCommitOptions {
+1 -1
View File
@@ -22,7 +22,7 @@ import type { Effect } from "effect";
import type { GitManagerServiceError } from "@t3tools/contracts"; import type { GitManagerServiceError } from "@t3tools/contracts";
export interface GitActionProgressReporter { export interface GitActionProgressReporter {
readonly publish: (event: GitActionProgressEvent) => Effect.Effect<void, never>; readonly publish: (event: GitActionProgressEvent) => Effect.Effect<void>;
} }
export interface GitRunStackedActionOptions { export interface GitRunStackedActionOptions {
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { inferImageExtension, parseBase64DataUrl } from "./imageMime.ts"; import { inferImageExtension, parseBase64DataUrl } from "./imageMime.ts";
@@ -15,7 +15,7 @@ import {
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import * as NodeServices from "@effect/platform-node/NodeServices"; import * as NodeServices from "@effect/platform-node/NodeServices";
import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect"; import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { CheckpointStoreLive } from "../../checkpointing/Layers/CheckpointStore.ts"; import { CheckpointStoreLive } from "../../checkpointing/Layers/CheckpointStore.ts";
import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts"; import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts";
@@ -70,7 +70,7 @@ function createProviderServiceHarness(
); );
const unsupported = <A>() => const unsupported = <A>() =>
Effect.die(new Error("Unsupported provider call in test")) as Effect.Effect<A, never>; Effect.die(new Error("Unsupported provider call in test")) as Effect.Effect<A>;
const listSessions = () => const listSessions = () =>
hasSession hasSession
? Effect.succeed([ ? Effect.succeed([
@@ -748,7 +748,7 @@ const make = Effect.gen(function* () {
const processInput = ( const processInput = (
input: ReactorInput, input: ReactorInput,
): Effect.Effect<void, CheckpointStoreError | OrchestrationDispatchError, never> => ): Effect.Effect<void, CheckpointStoreError | OrchestrationDispatchError> =>
input.source === "domain" ? processDomainEvent(input.event) : processRuntimeEvent(input.event); input.source === "domain" ? processDomainEvent(input.event) : processRuntimeEvent(input.event);
const processInputSafely = (input: ReactorInput) => const processInputSafely = (input: ReactorInput) =>
@@ -9,7 +9,7 @@ import {
type OrchestrationEvent, type OrchestrationEvent,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { Effect, Layer, ManagedRuntime, Queue, Stream } from "effect"; import { Effect, Layer, ManagedRuntime, Queue, Stream } from "effect";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { PersistenceSqlError } from "../../persistence/Errors.ts"; import { PersistenceSqlError } from "../../persistence/Errors.ts";
import { OrchestrationCommandReceiptRepositoryLive } from "../../persistence/Layers/OrchestrationCommandReceipts.ts"; import { OrchestrationCommandReceiptRepositoryLive } from "../../persistence/Layers/OrchestrationCommandReceipts.ts";
@@ -1,5 +1,5 @@
import { Effect, Exit, Layer, ManagedRuntime, Scope } from "effect"; import { Effect, Exit, Layer, ManagedRuntime, Scope } from "effect";
import { afterEach, describe, expect, it } from "vitest"; import { afterEach, describe, expect, it } from "vite-plus/test";
import { CheckpointReactor } from "../Services/CheckpointReactor.ts"; import { CheckpointReactor } from "../Services/CheckpointReactor.ts";
import { ProviderCommandReactor } from "../Services/ProviderCommandReactor.ts"; import { ProviderCommandReactor } from "../Services/ProviderCommandReactor.ts";
@@ -14,7 +14,7 @@ import {
TurnId, TurnId,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect"; import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { deriveServerPaths, ServerConfig } from "../../config.ts"; import { deriveServerPaths, ServerConfig } from "../../config.ts";
import { TextGenerationError } from "@t3tools/contracts"; import { TextGenerationError } from "@t3tools/contracts";
@@ -20,7 +20,7 @@ import {
TurnId, TurnId,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect"; import { Effect, Exit, Layer, ManagedRuntime, PubSub, Scope, Stream } from "effect";
import { afterEach, describe, expect, it } from "vitest"; import { afterEach, describe, expect, it } from "vite-plus/test";
import { OrchestrationEventStoreLive } from "../../persistence/Layers/OrchestrationEventStore.ts"; import { OrchestrationEventStoreLive } from "../../persistence/Layers/OrchestrationEventStore.ts";
import { OrchestrationCommandReceiptRepositoryLive } from "../../persistence/Layers/OrchestrationCommandReceipts.ts"; import { OrchestrationCommandReceiptRepositoryLive } from "../../persistence/Layers/OrchestrationCommandReceipts.ts";
@@ -1626,8 +1626,7 @@ describe("ProviderRuntimeIngestion", () => {
return false; return false;
} }
return ( return (
event.payload.messageId === "assistant:item-complete-dedup" && event.payload.messageId === "assistant:item-complete-dedup" && !event.payload.streaming
event.payload.streaming === false
); );
}); });
expect(completionEvents).toHaveLength(1); expect(completionEvents).toHaveLength(1);
@@ -30,7 +30,7 @@ export interface OrchestrationEngineShape {
* *
* @returns Effect containing the latest read model. * @returns Effect containing the latest read model.
*/ */
readonly getReadModel: () => Effect.Effect<OrchestrationReadModel, never, never>; readonly getReadModel: () => Effect.Effect<OrchestrationReadModel, never>;
/** /**
* Replay persisted orchestration events from an exclusive sequence cursor. * Replay persisted orchestration events from an exclusive sequence cursor.
@@ -40,7 +40,7 @@ export interface OrchestrationEngineShape {
*/ */
readonly readEvents: ( readonly readEvents: (
fromSequenceExclusive: number, fromSequenceExclusive: number,
) => Stream.Stream<OrchestrationEvent, OrchestrationEventStoreError, never>; ) => Stream.Stream<OrchestrationEvent, OrchestrationEventStoreError>;
/** /**
* Dispatch a validated orchestration command. * Dispatch a validated orchestration command.
@@ -53,7 +53,7 @@ export interface OrchestrationEngineShape {
*/ */
readonly dispatch: ( readonly dispatch: (
command: OrchestrationCommand, command: OrchestrationCommand,
) => Effect.Effect<{ sequence: number }, OrchestrationDispatchError, never>; ) => Effect.Effect<{ sequence: number }, OrchestrationDispatchError>;
/** /**
* Stream persisted domain events in dispatch order. * Stream persisted domain events in dispatch order.
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
MessageId, MessageId,
CommandId, CommandId,
@@ -6,7 +6,7 @@ import {
ProjectId, ProjectId,
ThreadId, ThreadId,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { Effect } from "effect"; import { Effect } from "effect";
import { decideOrchestrationCommand } from "./decider.ts"; import { decideOrchestrationCommand } from "./decider.ts";
+1 -1
View File
@@ -679,7 +679,7 @@ export const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand"
default: { default: {
command satisfies never; command satisfies never;
const fallback = command as never as { type: string }; const fallback = command as { type: string };
return yield* new OrchestrationCommandInvariantError({ return yield* new OrchestrationCommandInvariantError({
commandType: fallback.type, commandType: fallback.type,
detail: `Unknown command type: ${fallback.type}`, detail: `Unknown command type: ${fallback.type}`,
@@ -6,7 +6,7 @@ import {
type OrchestrationEvent, type OrchestrationEvent,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { Effect } from "effect"; import { Effect } from "effect";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { createEmptyReadModel, projectEvent } from "./projector.ts"; import { createEmptyReadModel, projectEvent } from "./projector.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vite-plus/test";
import { fixPath } from "./os-jank"; import { fixPath } from "./os-jank";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { runProcess } from "./processRunner"; import { runProcess } from "./processRunner";
@@ -2137,7 +2137,7 @@ describe("ClaudeAdapterLive", () => {
}); });
const permissionResult = yield* Effect.promise(() => permissionPromise); const permissionResult = yield* Effect.promise(() => permissionPromise);
assert.equal((permissionResult as PermissionResult).behavior, "allow"); assert.equal(permissionResult.behavior, "allow");
}).pipe( }).pipe(
Effect.provideService(Random.Random, makeDeterministicRandomService()), Effect.provideService(Random.Random, makeDeterministicRandomService()),
Effect.provide(harness.layer), Effect.provide(harness.layer),
@@ -2626,7 +2626,7 @@ describe("ClaudeAdapterLive", () => {
}); });
const permissionResult = yield* Effect.promise(() => permissionPromise); const permissionResult = yield* Effect.promise(() => permissionPromise);
assert.equal((permissionResult as PermissionResult).behavior, "deny"); assert.equal(permissionResult.behavior, "deny");
const deniedResult = permissionResult as PermissionResult & { const deniedResult = permissionResult as PermissionResult & {
message?: string; message?: string;
}; };
@@ -2820,7 +2820,7 @@ describe("ClaudeAdapterLive", () => {
// The canUseTool promise should resolve with the answers in SDK format. // The canUseTool promise should resolve with the answers in SDK format.
const permissionResult = yield* Effect.promise(() => permissionPromise); const permissionResult = yield* Effect.promise(() => permissionPromise);
assert.equal((permissionResult as PermissionResult).behavior, "allow"); assert.equal(permissionResult.behavior, "allow");
const updatedInput = (permissionResult as { updatedInput: Record<string, unknown> }) const updatedInput = (permissionResult as { updatedInput: Record<string, unknown> })
.updatedInput; .updatedInput;
assert.deepEqual(updatedInput.answers, { "Which framework?": "React" }); assert.deepEqual(updatedInput.answers, { "Which framework?": "React" });
@@ -2892,7 +2892,7 @@ describe("ClaudeAdapterLive", () => {
yield* Stream.runHead(adapter.streamEvents); yield* Stream.runHead(adapter.streamEvents);
const permissionResult = yield* Effect.promise(() => permissionPromise); const permissionResult = yield* Effect.promise(() => permissionPromise);
assert.equal((permissionResult as PermissionResult).behavior, "allow"); assert.equal(permissionResult.behavior, "allow");
const updatedInput = (permissionResult as { updatedInput: Record<string, unknown> }) const updatedInput = (permissionResult as { updatedInput: Record<string, unknown> })
.updatedInput; .updatedInput;
assert.deepEqual(updatedInput.answers, { "Deploy to which env?": "Staging" }); assert.deepEqual(updatedInput.answers, { "Deploy to which env?": "Staging" });
@@ -261,7 +261,7 @@ function isInterruptedResult(result: SDKResultMessage): boolean {
return ( return (
result.subtype === "error_during_execution" && result.subtype === "error_during_execution" &&
result.is_error === false && !result.is_error &&
(errors.includes("request was aborted") || (errors.includes("request was aborted") ||
errors.includes("interrupted by user") || errors.includes("interrupted by user") ||
errors.includes("aborted")) errors.includes("aborted"))
@@ -2817,7 +2817,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
providerRefs: {}, providerRefs: {},
}); });
let streamFiber: Fiber.Fiber<void, never>; let streamFiber: Fiber.Fiber<void>;
streamFiber = runFork( streamFiber = runFork(
Effect.exit(runSdkStream(context)).pipe( Effect.exit(runSdkStream(context)).pipe(
Effect.flatMap((exit) => { Effect.flatMap((exit) => {
@@ -1364,7 +1364,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (
if (options?.manager) { if (options?.manager) {
return options.manager; return options.manager;
} }
const services = yield* Effect.services<never>(); const services = yield* Effect.services();
return options?.makeManager?.(services) ?? new CodexAppServerManager(services); return options?.makeManager?.(services) ?? new CodexAppServerManager(services);
}); });
@@ -1583,7 +1583,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (
}); });
const registerListener = Effect.fn("registerListener")(function* () { const registerListener = Effect.fn("registerListener")(function* () {
const services = yield* Effect.services<never>(); const services = yield* Effect.services();
const listenerEffect = Effect.fn("listener")(function* (event: ProviderEvent) { const listenerEffect = Effect.fn("listener")(function* (event: ProviderEvent) {
yield* writeNativeEvent(event); yield* writeNativeEvent(event);
const runtimeEvents = mapToRuntimeEvents(event, event.threadId); const runtimeEvents = mapToRuntimeEvents(event, event.threadId);
@@ -15,12 +15,12 @@ export interface AnalyticsServiceShape {
readonly record: ( readonly record: (
event: string, event: string,
properties?: Readonly<Record<string, unknown>>, properties?: Readonly<Record<string, unknown>>,
) => Effect.Effect<void, never>; ) => Effect.Effect<void>;
/** /**
* Flush queued telemetry. * Flush queued telemetry.
*/ */
readonly flush: Effect.Effect<void, never>; readonly flush: Effect.Effect<void>;
} }
export class AnalyticsService extends ServiceMap.Service<AnalyticsService, AnalyticsServiceShape>()( export class AnalyticsService extends ServiceMap.Service<AnalyticsService, AnalyticsServiceShape>()(
@@ -22,7 +22,7 @@ import {
Scope, Scope,
} from "effect"; } from "effect";
import { TestClock } from "effect/testing"; import { TestClock } from "effect/testing";
import { expect } from "vitest"; import { expect } from "vite-plus/test";
import type { TerminalManagerShape } from "../Services/Manager"; import type { TerminalManagerShape } from "../Services/Manager";
import { import {
@@ -483,7 +483,7 @@ it.layer(NodeServices.layer, { excludeTestServices: true })("TerminalManager", (
hasRunningSubprocess = true; hasRunningSubprocess = true;
yield* waitFor( yield* waitFor(
Effect.map(getEvents, (events) => Effect.map(getEvents, (events) =>
events.some((event) => event.type === "activity" && event.hasRunningSubprocess === true), events.some((event) => event.type === "activity" && event.hasRunningSubprocess),
), ),
"1200 millis", "1200 millis",
); );
@@ -491,7 +491,7 @@ it.layer(NodeServices.layer, { excludeTestServices: true })("TerminalManager", (
hasRunningSubprocess = false; hasRunningSubprocess = false;
yield* waitFor( yield* waitFor(
Effect.map(getEvents, (events) => Effect.map(getEvents, (events) =>
events.some((event) => event.type === "activity" && event.hasRunningSubprocess === false), events.some((event) => event.type === "activity" && !event.hasRunningSubprocess),
), ),
"1200 millis", "1200 millis",
); );
+6 -6
View File
@@ -130,7 +130,7 @@ type DrainProcessEventAction =
interface TerminalManagerState { interface TerminalManagerState {
sessions: Map<string, TerminalSessionState>; sessions: Map<string, TerminalSessionState>;
killFibers: Map<PtyProcess, Fiber.Fiber<void, never>>; killFibers: Map<PtyProcess, Fiber.Fiber<void>>;
} }
function snapshot(session: TerminalSessionState): TerminalSessionSnapshot { function snapshot(session: TerminalSessionState): TerminalSessionSnapshot {
@@ -742,14 +742,14 @@ export const makeTerminalManagerWithOptions = Effect.fn("makeTerminalManagerWith
process: PtyProcess | null, process: PtyProcess | null,
) { ) {
if (!process) return; if (!process) return;
const fiber: Option.Option<Fiber.Fiber<void, never>> = yield* modifyManagerState< const fiber: Option.Option<Fiber.Fiber<void>> = yield* modifyManagerState<
Option.Option<Fiber.Fiber<void, never>> Option.Option<Fiber.Fiber<void>>
>((state) => { >((state) => {
const existing: Option.Option<Fiber.Fiber<void, never>> = Option.fromNullishOr( const existing: Option.Option<Fiber.Fiber<void>> = Option.fromNullishOr(
state.killFibers.get(process), state.killFibers.get(process),
); );
if (Option.isNone(existing)) { if (Option.isNone(existing)) {
return [Option.none<Fiber.Fiber<void, never>>(), state] as const; return [Option.none<Fiber.Fiber<void>>(), state] as const;
} }
const killFibers = new Map(state.killFibers); const killFibers = new Map(state.killFibers);
killFibers.delete(process); killFibers.delete(process);
@@ -762,7 +762,7 @@ export const makeTerminalManagerWithOptions = Effect.fn("makeTerminalManagerWith
const registerKillFiber = Effect.fn("terminal.registerKillFiber")(function* ( const registerKillFiber = Effect.fn("terminal.registerKillFiber")(function* (
process: PtyProcess, process: PtyProcess,
fiber: Fiber.Fiber<void, never>, fiber: Fiber.Fiber<void>,
) { ) {
yield* modifyManagerState((state) => { yield* modifyManagerState((state) => {
const killFibers = new Map(state.killFibers); const killFibers = new Map(state.killFibers);
@@ -228,10 +228,7 @@ export const makeWorkspaceEntries = Effect.gen(function* () {
onNone: () => Effect.succeed(false), onNone: () => Effect.succeed(false),
}); });
const filterGitIgnoredPaths = ( const filterGitIgnoredPaths = (cwd: string, relativePaths: string[]): Effect.Effect<string[]> =>
cwd: string,
relativePaths: string[],
): Effect.Effect<string[], never> =>
Option.match(gitOption, { Option.match(gitOption, {
onSome: (git) => onSome: (git) =>
git.filterIgnoredPaths(cwd, relativePaths).pipe( git.filterIgnoredPaths(cwd, relativePaths).pipe(
+1 -1
View File
@@ -21,5 +21,5 @@
} }
] ]
}, },
"include": ["src", "tsdown.config.ts", "scripts", "integration", "../../scripts/lib"] "include": ["src", "vite.config.ts", "scripts", "integration", "../../scripts/lib"]
} }
-17
View File
@@ -1,17 +0,0 @@
import { defineConfig } from "tsdown";
export default defineConfig({
entry: ["src/bin.ts"],
format: ["esm", "cjs"],
checks: {
legacyCjs: false,
},
outDir: "dist",
sourcemap: true,
clean: true,
noExternal: (id) => id.startsWith("@t3tools/"),
inlineOnly: false,
banner: {
js: "#!/usr/bin/env node\n",
},
});
-11
View File
@@ -1,11 +0,0 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"start": {
"dependsOn": ["build"],
"cache": false,
"persistent": true,
},
},
}
+27
View File
@@ -0,0 +1,27 @@
import { defineConfig } from "vite-plus";
export default defineConfig({
resolve: {
tsconfigPaths: true,
},
pack: {
entry: ["src/bin.ts"],
format: ["esm", "cjs"],
checks: {
legacyCjs: false,
},
outDir: "dist",
sourcemap: true,
clean: true,
noExternal: (id) => id.startsWith("@t3tools/"),
inlineOnly: false,
banner: {
js: "#!/usr/bin/env node\n",
},
},
test: {
fileParallelism: false,
testTimeout: 60_000,
hookTimeout: 60_000,
},
});
-18
View File
@@ -1,18 +0,0 @@
import { defineConfig, mergeConfig } from "vitest/config";
import baseConfig from "../../vitest.config";
export default mergeConfig(
baseConfig,
defineConfig({
test: {
// The server suite exercises sqlite, git, temp worktrees, and orchestration
// runtimes heavily. Running files in parallel introduces load-sensitive flakes.
fileParallelism: false,
// Server integration tests exercise sqlite, git, and orchestration together.
// Under package-wide parallel runs they regularly exceed the default 15s budget.
testTimeout: 60_000,
hookTimeout: 60_000,
},
}),
);
+7 -8
View File
@@ -4,13 +4,14 @@
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vp dev",
"build": "vite build", "build": "vp build",
"prepare": "effect-language-service patch", "prepare": "effect-language-service patch",
"preview": "vite preview", "preview": "vp preview",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"test": "vitest run --passWithNoTests", "test": "vp test run --passWithNoTests",
"test:browser": "vitest run --config vitest.browser.config.ts", "test:browser": "vp test run --project browser",
"test:unit": "vp test run --project unit",
"test:browser:install": "playwright install --with-deps chromium" "test:browser:install": "playwright install --with-deps chromium"
}, },
"dependencies": { "dependencies": {
@@ -51,14 +52,12 @@
"@types/react": "^19.0.0", "@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0", "@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^6.0.0", "@vitejs/plugin-react": "^6.0.0",
"@vitest/browser-playwright": "^4.0.18",
"babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112", "babel-plugin-react-compiler": "^19.0.0-beta-e552027-20250112",
"msw": "2.12.11", "msw": "2.12.11",
"playwright": "^1.58.2", "playwright": "^1.58.2",
"tailwindcss": "^4.0.0", "tailwindcss": "^4.0.0",
"typescript": "catalog:", "typescript": "catalog:",
"vite": "^8.0.0", "vite-plus": "catalog:",
"vitest": "catalog:",
"vitest-browser-react": "^2.0.5" "vitest-browser-react": "^2.0.5"
} }
} }
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { AUTO_SCROLL_BOTTOM_THRESHOLD_PX, isScrollContainerNearBottom } from "./chat-scroll"; import { AUTO_SCROLL_BOTTOM_THRESHOLD_PX, isScrollContainerNearBottom } from "./chat-scroll";
@@ -1,5 +1,5 @@
import type { GitBranch } from "@t3tools/contracts"; import type { GitBranch } from "@t3tools/contracts";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
dedupeRemoteBranchesWithLocalMatches, dedupeRemoteBranchesWithLocalMatches,
deriveLocalBranchNameFromRemoteRef, deriveLocalBranchNameFromRemoteRef,
+44 -20
View File
@@ -19,8 +19,17 @@ import {
import { RouterProvider, createMemoryHistory } from "@tanstack/react-router"; import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
import { HttpResponse, http, ws } from "msw"; import { HttpResponse, http, ws } from "msw";
import { setupWorker } from "msw/browser"; import { setupWorker } from "msw/browser";
import { page } from "vitest/browser"; import { page } from "vite-plus/test/browser";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import {
afterAll,
afterEach,
beforeAll,
beforeEach,
describe,
expect,
it,
vi,
} from "vite-plus/test";
import { render } from "vitest-browser-react"; import { render } from "vitest-browser-react";
import { useComposerDraftStore } from "../composerDraftStore"; import { useComposerDraftStore } from "../composerDraftStore";
@@ -905,12 +914,30 @@ async function triggerChatNewShortcutUntilPath(
async function waitForNewThreadShortcutLabel(): Promise<void> { async function waitForNewThreadShortcutLabel(): Promise<void> {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.hover(); await newThreadButton.hover();
const shortcutLabel = isMacPlatform(navigator.platform) const shortcutLabel = isMacPlatform(navigator.platform)
? "New thread (⇧⌘O)" ? "New thread (⇧⌘O)"
: "New thread (Ctrl+Shift+O)"; : "New thread (Ctrl+Shift+O)";
await expect.element(page.getByText(shortcutLabel)).toBeInTheDocument(); await waitForLocatorVisible(page.getByText(shortcutLabel));
}
async function waitForLocatorVisible(locator: {
query: () => HTMLElement | SVGElement | null;
}): Promise<void> {
await vi.waitFor(
() => {
const element = locator.query();
expect(element).not.toBeNull();
if (!element) {
return;
}
const style = getComputedStyle(element);
expect(style.display).not.toBe("none");
expect(style.visibility).not.toBe("hidden");
},
{ timeout: 4_000, interval: 16 },
);
} }
async function waitForImagesToLoad(scope: ParentNode): Promise<void> { async function waitForImagesToLoad(scope: ParentNode): Promise<void> {
@@ -1309,7 +1336,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
}); });
try { try {
await expect.element(page.getByText("No threads yet")).toBeInTheDocument(); await waitForLocatorVisible(page.getByText("No threads yet"));
} finally { } finally {
await mounted.cleanup(); await mounted.cleanup();
} }
@@ -2059,7 +2086,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const threadRow = page.getByTestId(`thread-row-${THREAD_ID}`); const threadRow = page.getByTestId(`thread-row-${THREAD_ID}`);
await expect.element(threadRow).toBeInTheDocument(); await waitForLocatorVisible(threadRow);
const archiveButton = await waitForElement( const archiveButton = await waitForElement(
() => () =>
document.querySelector<HTMLButtonElement>(`[data-testid="thread-archive-${THREAD_ID}"]`), document.querySelector<HTMLButtonElement>(`[data-testid="thread-archive-${THREAD_ID}"]`),
@@ -2112,16 +2139,15 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const threadRow = page.getByTestId(`thread-row-${THREAD_ID}`); const threadRow = page.getByTestId(`thread-row-${THREAD_ID}`);
await expect.element(threadRow).toBeInTheDocument(); await waitForLocatorVisible(threadRow);
await threadRow.hover(); await threadRow.hover();
const archiveButton = page.getByTestId(`thread-archive-${THREAD_ID}`); const archiveButton = page.getByTestId(`thread-archive-${THREAD_ID}`);
await expect.element(archiveButton).toBeInTheDocument(); await waitForLocatorVisible(archiveButton);
await archiveButton.click(); await archiveButton.click();
const confirmButton = page.getByTestId(`thread-archive-confirm-${THREAD_ID}`); const confirmButton = page.getByTestId(`thread-archive-confirm-${THREAD_ID}`);
await expect.element(confirmButton).toBeInTheDocument(); await waitForLocatorVisible(confirmButton);
await expect.element(confirmButton).toBeVisible();
} finally { } finally {
localStorage.removeItem("t3code:client-settings:v1"); localStorage.removeItem("t3code:client-settings:v1");
await mounted.cleanup(); await mounted.cleanup();
@@ -2140,7 +2166,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
// Wait for the sidebar to render with the project. // Wait for the sidebar to render with the project.
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.click(); await newThreadButton.click();
@@ -2168,10 +2194,8 @@ describe("ChatView timeline estimator parity (full app)", () => {
); );
// The empty thread view and composer should still be visible. // The empty thread view and composer should still be visible.
await expect await waitForLocatorVisible(page.getByText("Send a message to start the conversation."));
.element(page.getByText("Send a message to start the conversation.")) await waitForLocatorVisible(page.getByTestId("composer-editor"));
.toBeInTheDocument();
await expect.element(page.getByTestId("composer-editor")).toBeInTheDocument();
} finally { } finally {
await mounted.cleanup(); await mounted.cleanup();
} }
@@ -2202,7 +2226,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.click(); await newThreadButton.click();
@@ -2255,7 +2279,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.click(); await newThreadButton.click();
@@ -2295,7 +2319,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.click(); await newThreadButton.click();
@@ -2337,7 +2361,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await newThreadButton.click(); await newThreadButton.click();
@@ -2474,7 +2498,7 @@ describe("ChatView timeline estimator parity (full app)", () => {
try { try {
const newThreadButton = page.getByTestId("new-thread-button"); const newThreadButton = page.getByTestId("new-thread-button");
await expect.element(newThreadButton).toBeInTheDocument(); await waitForLocatorVisible(newThreadButton);
await waitForNewThreadShortcutLabel(); await waitForNewThreadShortcutLabel();
await waitForServerConfigToApply(); await waitForServerConfigToApply();
await newThreadButton.click(); await newThreadButton.click();
@@ -1,5 +1,5 @@
import { ProjectId, ThreadId, TurnId } from "@t3tools/contracts"; import { ProjectId, ThreadId, TurnId } from "@t3tools/contracts";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { useStore } from "../store"; import { useStore } from "../store";
import { import {
+3 -5
View File
@@ -1842,9 +1842,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan"); handleInteractionModeChange(interactionMode === "plan" ? "default" : "plan");
}, [handleInteractionModeChange, interactionMode]); }, [handleInteractionModeChange, interactionMode]);
const toggleRuntimeMode = useCallback(() => { const toggleRuntimeMode = useCallback(() => {
void handleRuntimeModeChange( handleRuntimeModeChange(runtimeMode === "full-access" ? "approval-required" : "full-access");
runtimeMode === "full-access" ? "approval-required" : "full-access",
);
}, [handleRuntimeModeChange, runtimeMode]); }, [handleRuntimeModeChange, runtimeMode]);
const togglePlanSidebar = useCallback(() => { const togglePlanSidebar = useCallback(() => {
setPlanSidebarOpen((open) => { setPlanSidebarOpen((open) => {
@@ -3560,7 +3558,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
} }
return; return;
} }
void handleInteractionModeChange(item.command === "plan" ? "plan" : "default"); handleInteractionModeChange(item.command === "plan" ? "plan" : "default");
const applied = applyPromptReplacement(trigger.rangeStart, trigger.rangeEnd, "", { const applied = applyPromptReplacement(trigger.rangeStart, trigger.rangeEnd, "", {
expectedText: snapshot.value.slice(trigger.rangeStart, trigger.rangeEnd), expectedText: snapshot.value.slice(trigger.rangeStart, trigger.rangeEnd),
}); });
@@ -4136,7 +4134,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
size="sm" size="sm"
type="button" type="button"
onClick={() => onClick={() =>
void handleRuntimeModeChange( handleRuntimeModeChange(
runtimeMode === "full-access" runtimeMode === "full-access"
? "approval-required" ? "approval-required"
: "full-access", : "full-access",
+1 -1
View File
@@ -597,7 +597,7 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) {
data-diff-file-path={filePath} data-diff-file-path={filePath}
className="diff-render-file mb-2 rounded-md first:mt-2 last:mb-0" className="diff-render-file mb-2 rounded-md first:mt-2 last:mb-0"
onClickCapture={(event) => { onClickCapture={(event) => {
const nativeEvent = event.nativeEvent as MouseEvent; const nativeEvent = event.nativeEvent;
const composedPath = nativeEvent.composedPath?.() ?? []; const composedPath = nativeEvent.composedPath?.() ?? [];
const clickedHeader = composedPath.some((node) => { const clickedHeader = composedPath.some((node) => {
if (!(node instanceof Element)) return false; if (!(node instanceof Element)) return false;
@@ -1,5 +1,5 @@
import type { GitStatusResult } from "@t3tools/contracts"; import type { GitStatusResult } from "@t3tools/contracts";
import { assert, describe, it } from "vitest"; import { assert, describe, it } from "vite-plus/test";
import { import {
buildGitActionProgressStages, buildGitActionProgressStages,
buildMenuItems, buildMenuItems,
@@ -13,7 +13,16 @@ import {
import { RouterProvider, createMemoryHistory } from "@tanstack/react-router"; import { RouterProvider, createMemoryHistory } from "@tanstack/react-router";
import { ws, http, HttpResponse } from "msw"; import { ws, http, HttpResponse } from "msw";
import { setupWorker } from "msw/browser"; import { setupWorker } from "msw/browser";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import {
afterAll,
afterEach,
beforeAll,
beforeEach,
describe,
expect,
it,
vi,
} from "vite-plus/test";
import { render } from "vitest-browser-react"; import { render } from "vitest-browser-react";
import { useComposerDraftStore } from "../composerDraftStore"; import { useComposerDraftStore } from "../composerDraftStore";
@@ -1,4 +1,4 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
import { import {
createThreadJumpHintVisibilityController, createThreadJumpHintVisibilityController,
+1 -1
View File
@@ -440,7 +440,7 @@ function getLatestUserMessageTimestamp(thread: SidebarThreadSortInput): number {
function getThreadSortTimestamp( function getThreadSortTimestamp(
thread: SidebarThreadSortInput, thread: SidebarThreadSortInput,
sortOrder: SidebarThreadSortOrder | Exclude<SidebarProjectSortOrder, "manual">, sortOrder: SidebarThreadSortOrder,
): number { ): number {
if (sortOrder === "created_at") { if (sortOrder === "created_at") {
return toSortableTimestamp(thread.createdAt) ?? Number.NEGATIVE_INFINITY; return toSortableTimestamp(thread.createdAt) ?? Number.NEGATIVE_INFINITY;
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
resolveTerminalSelectionActionPosition, resolveTerminalSelectionActionPosition,
@@ -1,8 +1,8 @@
import { DEFAULT_MODEL_BY_PROVIDER, ModelSelection, ThreadId } from "@t3tools/contracts"; import { DEFAULT_MODEL_BY_PROVIDER, ModelSelection, ThreadId } from "@t3tools/contracts";
import "../../index.css"; import "../../index.css";
import { page } from "vitest/browser"; import { page } from "vite-plus/test/browser";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { render } from "vitest-browser-react"; import { render } from "vitest-browser-react";
import { CompactComposerControlsMenu } from "./CompactComposerControlsMenu"; import { CompactComposerControlsMenu } from "./CompactComposerControlsMenu";
@@ -1,6 +1,6 @@
import { ThreadId } from "@t3tools/contracts"; import { ThreadId } from "@t3tools/contracts";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { ComposerPendingTerminalContextChip } from "./ComposerPendingTerminalContexts"; import { ComposerPendingTerminalContextChip } from "./ComposerPendingTerminalContexts";
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { computeMessageDurationStart, normalizeCompactToolLabel } from "./MessagesTimeline.logic"; import { computeMessageDurationStart, normalizeCompactToolLabel } from "./MessagesTimeline.logic";
describe("computeMessageDurationStart", () => { describe("computeMessageDurationStart", () => {
@@ -1,6 +1,6 @@
import { MessageId } from "@t3tools/contracts"; import { MessageId } from "@t3tools/contracts";
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { beforeAll, describe, expect, it, vi } from "vitest"; import { beforeAll, describe, expect, it, vi } from "vite-plus/test";
function matchMedia() { function matchMedia() {
return { return {
@@ -198,7 +198,7 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({
</Button> </Button>
<Button <Button
size="sm" size="sm"
onClick={() => void handleSaveToWorkspace()} onClick={() => handleSaveToWorkspace()}
disabled={isSavingToWorkspace} disabled={isSavingToWorkspace}
> >
{isSavingToWorkspace ? "Saving..." : "Save"} {isSavingToWorkspace ? "Saving..." : "Save"}
@@ -1,6 +1,6 @@
import { type ProviderKind, type ServerProvider } from "@t3tools/contracts"; import { type ProviderKind, type ServerProvider } from "@t3tools/contracts";
import { page } from "vitest/browser"; import { page } from "vite-plus/test/browser";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { render } from "vitest-browser-react"; import { render } from "vitest-browser-react";
import { ProviderModelPicker } from "./ProviderModelPicker"; import { ProviderModelPicker } from "./ProviderModelPicker";
@@ -10,9 +10,9 @@ import {
type ServerProvider, type ServerProvider,
ThreadId, ThreadId,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { page } from "vitest/browser"; import { page } from "vite-plus/test/browser";
import { useCallback } from "react"; import { useCallback } from "react";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vite-plus/test";
import { render } from "vitest-browser-react"; import { render } from "vitest-browser-react";
import { TraitsPicker } from "./TraitsPicker"; import { TraitsPicker } from "./TraitsPicker";
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import type { ServerProviderModel } from "@t3tools/contracts"; import type { ServerProviderModel } from "@t3tools/contracts";
import { getComposerProviderState } from "./composerProviderRegistry"; import { getComposerProviderState } from "./composerProviderRegistry";
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
buildInlineTerminalContextText, buildInlineTerminalContextText,
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
COMPOSER_FOOTER_COMPACT_BREAKPOINT_PX, COMPOSER_FOOTER_COMPACT_BREAKPOINT_PX,
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts"; import type { DesktopUpdateActionResult, DesktopUpdateState } from "@t3tools/contracts";
import { import {
@@ -1042,7 +1042,7 @@ export function GeneralSettingsPanel() {
variant="ghost" variant="ghost"
className="size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground" className="size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground"
disabled={isRefreshingProviders} disabled={isRefreshingProviders}
onClick={() => void refreshProviders()} onClick={() => refreshProviders()}
aria-label="Refresh provider status" aria-label="Refresh provider status"
> >
{isRefreshingProviders ? ( {isRefreshingProviders ? (
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { appendTerminalContextsToPrompt } from "../lib/terminalContext"; import { appendTerminalContextsToPrompt } from "../lib/terminalContext";
import { buildInlineTerminalContextText } from "./chat/userMessageTerminalContexts"; import { buildInlineTerminalContextText } from "./chat/userMessageTerminalContexts";
+1 -1
View File
@@ -23,7 +23,7 @@ function AutocompleteInput({
size?: "sm" | "default" | "lg" | number; size?: "sm" | "default" | "lg" | number;
ref?: React.Ref<HTMLInputElement>; ref?: React.Ref<HTMLInputElement>;
}) { }) {
const sizeValue = (size ?? "default") as "sm" | "default" | "lg" | number; const sizeValue = size ?? "default";
return ( return (
<div className="relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64"> <div className="relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64">
+2 -2
View File
@@ -36,7 +36,7 @@ function ComboboxChipsInput({
size?: "sm" | "default" | "lg" | number; size?: "sm" | "default" | "lg" | number;
ref?: React.Ref<HTMLInputElement>; ref?: React.Ref<HTMLInputElement>;
}) { }) {
const sizeValue = (size ?? "default") as "sm" | "default" | "lg" | number; const sizeValue = size ?? "default";
return ( return (
<ComboboxPrimitive.Input <ComboboxPrimitive.Input
@@ -69,7 +69,7 @@ function ComboboxInput({
size?: "sm" | "default" | "lg" | number; size?: "sm" | "default" | "lg" | number;
ref?: React.Ref<HTMLInputElement>; ref?: React.Ref<HTMLInputElement>;
}) { }) {
const sizeValue = (size ?? "default") as "sm" | "default" | "lg" | number; const sizeValue = size ?? "default";
return ( return (
<div className="relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64"> <div className="relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64">
+1 -1
View File
@@ -1,5 +1,5 @@
import { renderToStaticMarkup } from "react-dom/server"; import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
SidebarMenuAction, SidebarMenuAction,
@@ -1,4 +1,4 @@
import { assert, describe, it } from "vitest"; import { assert, describe, it } from "vite-plus/test";
import { buildVisibleToastLayout, shouldHideCollapsedToastContent } from "./toast.logic"; import { buildVisibleToastLayout, shouldHideCollapsedToastContent } from "./toast.logic";
describe("shouldHideCollapsedToastContent", () => { describe("shouldHideCollapsedToastContent", () => {
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { splitPromptIntoComposerSegments } from "./composer-editor-mentions"; import { splitPromptIntoComposerSegments } from "./composer-editor-mentions";
import { INLINE_TERMINAL_CONTEXT_PLACEHOLDER } from "./lib/terminalContext"; import { INLINE_TERMINAL_CONTEXT_PLACEHOLDER } from "./lib/terminalContext";
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { import {
clampCollapsedComposerCursor, clampCollapsedComposerCursor,
+1 -1
View File
@@ -5,7 +5,7 @@ import {
type ModelSelection, type ModelSelection,
type ProviderModelOptions, type ProviderModelOptions,
} from "@t3tools/contracts"; } from "@t3tools/contracts";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
import { import {
COMPOSER_DRAFT_STORAGE_KEY, COMPOSER_DRAFT_STORAGE_KEY,
+1 -1
View File
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vite-plus/test";
import { parseDiffRouteSearch } from "./diffRouteSearch"; import { parseDiffRouteSearch } from "./diffRouteSearch";
+1 -1
View File
@@ -22,7 +22,7 @@ export function stripDiffSearchParams<T extends Record<string, unknown>>(
params: T, params: T,
): Omit<T, "diff" | "diffTurnId" | "diffFilePath"> { ): Omit<T, "diff" | "diffTurnId" | "diffFilePath"> {
const { diff: _diff, diffTurnId: _diffTurnId, diffFilePath: _diffFilePath, ...rest } = params; const { diff: _diff, diffTurnId: _diffTurnId, diffFilePath: _diffFilePath, ...rest } = params;
return rest as Omit<T, "diff" | "diffTurnId" | "diffFilePath">; return rest;
} }
export function parseDiffRouteSearch(search: Record<string, unknown>): DiffRouteSearch { export function parseDiffRouteSearch(search: Record<string, unknown>): DiffRouteSearch {
Loaded 100 of 168 files, more files were not shown because too many files have changed in this diff. Show more