rebrand
This commit is contained in:
34 files changed
+101
-99
No files matched your search
@@ -1,7 +1,7 @@
|
||||
# CLAUDE.md
|
||||
|
||||
## Project Snapshot
|
||||
CodeThing is a minimal web GUI for using code agents like Codex and Claude Code (coming soon).
|
||||
T3 Code is a minimal web GUI for using code agents like Codex and Claude Code (coming soon).
|
||||
|
||||
This repository is a VERY EARLY WIP. Proposing sweeping changes that improve long-term maintainability is encouraged.
|
||||
|
||||
@@ -18,7 +18,7 @@ If a tradeoff is required, choose correctness and robustness over short-term con
|
||||
- `packages/contracts`: Shared Zod schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types.
|
||||
|
||||
## Codex App Server (Important)
|
||||
CodeThing is currently Codex-first. The server starts `codex app-server` (JSON-RPC over stdio) per provider session, then streams structured events to the browser through WebSocket push messages.
|
||||
T3 Code is currently Codex-first. The server starts `codex app-server` (JSON-RPC over stdio) per provider session, then streams structured events to the browser through WebSocket push messages.
|
||||
|
||||
How we use it in this codebase:
|
||||
- Session startup/resume and turn lifecycle are brokered in `apps/server/src/codexAppServerManager.ts`.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# CodeThing
|
||||
# T3 Code
|
||||
|
||||
CodeThing is a minimal web GUI for coding agents. Currently Codex-first, with Claude Code support coming soon.
|
||||
T3 Code is a minimal web GUI for coding agents. Currently Codex-first, with Claude Code support coming soon.
|
||||
|
||||
Run `npx t3` in any project directory to launch the web interface.
|
||||
Run `bun run dev:desktop` to launch the Electron desktop app in this monorepo.
|
||||
|
||||
## Architecture
|
||||
|
||||
CodeThing runs as a **Node.js WebSocket server** that wraps `codex app-server` (JSON-RPC over stdio) and serves a React web app.
|
||||
T3 Code runs as a **Node.js WebSocket server** that wraps `codex app-server` (JSON-RPC over stdio) and serves a React web app.
|
||||
|
||||
```
|
||||
┌─────────────────────────────────┐
|
||||
@@ -37,8 +37,8 @@ CodeThing runs as a **Node.js WebSocket server** that wraps `codex app-server` (
|
||||
## Codex prerequisites
|
||||
|
||||
- Install Codex CLI so `codex` is on your PATH.
|
||||
- Authenticate Codex before running CodeThing (for example via API key or ChatGPT auth supported by Codex).
|
||||
- CodeThing starts the server via `codex app-server` per session.
|
||||
- Authenticate Codex before running T3 Code (for example via API key or ChatGPT auth supported by Codex).
|
||||
- T3 Code starts the server via `codex app-server` per session.
|
||||
|
||||
## Quick start
|
||||
|
||||
@@ -69,7 +69,7 @@ npx t3
|
||||
|
||||
## Runtime modes
|
||||
|
||||
CodeThing has a global runtime mode switch in the chat toolbar:
|
||||
T3 Code has a global runtime mode switch in the chat toolbar:
|
||||
|
||||
- **Full access** (default): starts sessions with `approvalPolicy: never` and `sandboxMode: danger-full-access`.
|
||||
- **Supervised**: starts sessions with `approvalPolicy: on-request` and `sandboxMode: workspace-write`, then prompts in-app for command/file approvals.
|
||||
@@ -81,7 +81,7 @@ The renderer communicates with the server via WebSocket using a simple JSON-RPC-
|
||||
- **Request/Response**: `{ id, method, params }` → `{ id, result }` or `{ id, error }`
|
||||
- **Push events**: `{ type: "push", channel, data }` for streaming provider events
|
||||
|
||||
Methods mirror the `NativeApi` interface defined in `@acme/contracts`:
|
||||
Methods mirror the `NativeApi` interface defined in `@t3tools/contracts`:
|
||||
|
||||
- `providers.startSession`, `providers.sendTurn`, `providers.interruptTurn`
|
||||
- `providers.respondToRequest`, `providers.stopSession`, `providers.listSessions`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@acme/desktop",
|
||||
"name": "@t3tools/desktop",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "dist-electron/main.js",
|
||||
|
||||
@@ -48,11 +48,11 @@ async function reserveLoopbackPort(): Promise<number> {
|
||||
function backendEnv(): NodeJS.ProcessEnv {
|
||||
return {
|
||||
...process.env,
|
||||
CODETHING_MODE: "desktop",
|
||||
CODETHING_NO_BROWSER: "1",
|
||||
CODETHING_PORT: String(backendPort),
|
||||
CODETHING_STATE_DIR: STATE_DIR,
|
||||
CODETHING_AUTH_TOKEN: backendAuthToken,
|
||||
T3CODE_MODE: "desktop",
|
||||
T3CODE_NO_BROWSER: "1",
|
||||
T3CODE_PORT: String(backendPort),
|
||||
T3CODE_STATE_DIR: STATE_DIR,
|
||||
T3CODE_AUTH_TOKEN: backendAuthToken,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ async function bootstrap(): Promise<void> {
|
||||
backendPort = await reserveLoopbackPort();
|
||||
backendAuthToken = randomBytes(24).toString("hex");
|
||||
backendWsUrl = `ws://127.0.0.1:${backendPort}/?token=${encodeURIComponent(backendAuthToken)}`;
|
||||
process.env.CODETHING_DESKTOP_WS_URL = backendWsUrl;
|
||||
process.env.T3CODE_DESKTOP_WS_URL = backendWsUrl;
|
||||
|
||||
registerIpcHandlers();
|
||||
startBackend();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { contextBridge, ipcRenderer } from "electron";
|
||||
|
||||
const PICK_FOLDER_CHANNEL = "desktop:pick-folder";
|
||||
const wsUrl = process.env.CODETHING_DESKTOP_WS_URL ?? null;
|
||||
const wsUrl = process.env.T3CODE_DESKTOP_WS_URL ?? null;
|
||||
|
||||
contextBridge.exposeInMainWorld("desktopBridge", {
|
||||
getWsUrl: () => wsUrl,
|
||||
|
||||
@@ -6,5 +6,5 @@ export default defineConfig({
|
||||
outDir: "dist-electron",
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
noExternal: ["@acme/contracts"],
|
||||
noExternal: ["@t3tools/contracts"],
|
||||
});
|
||||
@@ -3,7 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CodeThing</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..800;1,9..40,300..800&display=swap" rel="stylesheet" />
|
||||
<title>T3 Code</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@acme/renderer",
|
||||
"name": "@t3tools/renderer",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
@@ -11,7 +11,7 @@
|
||||
"test": "vitest run --passWithNoTests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@acme/contracts": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lucide-react": "^0.563.0",
|
||||
"react": "^19.0.0",
|
||||
|
||||
@@ -148,7 +148,7 @@ function Layout() {
|
||||
return (
|
||||
<div className="flex h-screen flex-col bg-background text-foreground">
|
||||
<div className="flex flex-1 items-center justify-center">
|
||||
<p className="text-sm text-muted-foreground">Connecting to CodeThing server...</p>
|
||||
<p className="text-sm text-muted-foreground">Connecting to T3 Code server...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
PROVIDER_SEND_TURN_MAX_INPUT_CHARS,
|
||||
type ProviderApprovalDecision,
|
||||
type ProviderEvent,
|
||||
} from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
import {
|
||||
type FormEvent,
|
||||
Fragment,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { EDITORS, type EditorId } from "@acme/contracts";
|
||||
import { EDITORS, type EditorId } from "@t3tools/contracts";
|
||||
import { isElectron } from "../env";
|
||||
import { buildBootstrapInput } from "../historyBootstrap";
|
||||
import {
|
||||
@@ -50,7 +50,7 @@ function editorLabel(editor: (typeof EDITORS)[number]): string {
|
||||
return editor.command ? editor.label : FILE_MANAGER_LABEL;
|
||||
}
|
||||
|
||||
const LAST_EDITOR_KEY = "codething:last-editor";
|
||||
const LAST_EDITOR_KEY = "t3code:last-editor";
|
||||
const MAX_VISIBLE_WORK_LOG_ENTRIES = 6;
|
||||
|
||||
function workToneClass(tone: "thinking" | "tool" | "info" | "error"): string {
|
||||
|
||||
@@ -202,12 +202,9 @@ export default function Sidebar() {
|
||||
{/* Drag region / traffic light space (Electron only) */}
|
||||
{isElectron && <div className="drag-region h-[52px] shrink-0" />}
|
||||
{/* Branding */}
|
||||
<div className={`flex items-center gap-2 px-4 pb-4 ${isElectron ? "" : "pt-4"}`}>
|
||||
<div className="flex h-7 w-7 items-center justify-center rounded-lg bg-primary text-xs font-bold text-primary-foreground">
|
||||
CT
|
||||
</div>
|
||||
<div className={`flex items-center gap-2.5 px-4 pb-4 ${isElectron ? "" : "pt-4"}`}>
|
||||
<span className="flex-1 text-sm font-semibold tracking-tight text-foreground">
|
||||
CodeThing
|
||||
T3 <span className="font-normal text-muted-foreground">Code</span>
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useSyncExternalStore } from "react";
|
||||
|
||||
type Theme = "light" | "dark" | "system";
|
||||
|
||||
const STORAGE_KEY = "codething:theme";
|
||||
const STORAGE_KEY = "t3code:theme";
|
||||
const MEDIA_QUERY = "(prefers-color-scheme: dark)";
|
||||
|
||||
let listeners: Array<() => void> = [];
|
||||
|
||||
@@ -83,8 +83,8 @@
|
||||
--card-foreground: var(--color-neutral-800);
|
||||
--popover: var(--color-white);
|
||||
--popover-foreground: var(--color-neutral-800);
|
||||
--primary: var(--color-neutral-800);
|
||||
--primary-foreground: var(--color-neutral-50);
|
||||
--primary: oklch(0.488 0.217 264);
|
||||
--primary-foreground: var(--color-white);
|
||||
--secondary: --alpha(var(--color-black) / 4%);
|
||||
--secondary-foreground: var(--color-neutral-800);
|
||||
--muted: --alpha(var(--color-black) / 4%);
|
||||
@@ -93,12 +93,12 @@
|
||||
var(--color-neutral-500) 90%,
|
||||
var(--color-black)
|
||||
);
|
||||
--accent: --alpha(var(--color-black) / 4%);
|
||||
--accent: --alpha(var(--color-black) / 5%);
|
||||
--accent-foreground: var(--color-neutral-800);
|
||||
--destructive: var(--color-red-500);
|
||||
--border: --alpha(var(--color-black) / 8%);
|
||||
--input: --alpha(var(--color-black) / 10%);
|
||||
--ring: var(--color-neutral-400);
|
||||
--ring: oklch(0.488 0.217 264);
|
||||
--chart-1: oklch(0.646 0.222 41.116);
|
||||
--chart-2: oklch(0.6 0.118 184.704);
|
||||
--chart-3: oklch(0.398 0.07 227.392);
|
||||
@@ -132,8 +132,8 @@
|
||||
--card-foreground: var(--color-neutral-100);
|
||||
--popover: color-mix(in srgb, var(--background) 98%, var(--color-white));
|
||||
--popover-foreground: var(--color-neutral-100);
|
||||
--primary: var(--color-neutral-100);
|
||||
--primary-foreground: var(--color-neutral-800);
|
||||
--primary: oklch(0.588 0.217 264);
|
||||
--primary-foreground: var(--color-white);
|
||||
--secondary: --alpha(var(--color-white) / 4%);
|
||||
--secondary-foreground: var(--color-neutral-100);
|
||||
--muted: --alpha(var(--color-white) / 4%);
|
||||
@@ -151,7 +151,7 @@
|
||||
);
|
||||
--border: --alpha(var(--color-white) / 6%);
|
||||
--input: --alpha(var(--color-white) / 8%);
|
||||
--ring: var(--color-neutral-500);
|
||||
--ring: oklch(0.588 0.217 264);
|
||||
--chart-1: oklch(0.488 0.243 264.376);
|
||||
--chart-2: oklch(0.696 0.17 162.48);
|
||||
--chart-3: oklch(0.769 0.188 70.08);
|
||||
@@ -177,7 +177,7 @@
|
||||
|
||||
body {
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
|
||||
@@ -3,7 +3,7 @@ export {
|
||||
MODEL_OPTIONS,
|
||||
normalizeModelSlug,
|
||||
resolveModelSlug,
|
||||
} from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
|
||||
export const REASONING_OPTIONS = ["xhigh", "high", "medium", "low"] as const;
|
||||
export const DEFAULT_REASONING = "high";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { ProviderEvent, ProviderSession } from "@acme/contracts";
|
||||
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts";
|
||||
import {
|
||||
type WorkLogEntry,
|
||||
applyEventToMessages,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { NativeApi, ProviderEvent, ProviderKind, ProviderSession } from "@acme/contracts";
|
||||
import type { NativeApi, ProviderEvent, ProviderKind, ProviderSession } from "@t3tools/contracts";
|
||||
import type { ChatMessage, SessionPhase } from "./types";
|
||||
import { createWsNativeApi } from "./wsNativeApi";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ProviderEvent, ProviderSession } from "@acme/contracts";
|
||||
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { type AppState, reducer } from "./store";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
useReducer,
|
||||
} from "react";
|
||||
|
||||
import type { ProviderEvent, ProviderSession } from "@acme/contracts";
|
||||
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts";
|
||||
import { resolveModelSlug } from "./model-logic";
|
||||
import { hydratePersistedState, toPersistedState } from "./persistenceSchema";
|
||||
import { applyEventToMessages, asObject, asString, evolveSession } from "./session-logic";
|
||||
@@ -45,8 +45,10 @@ export interface AppState {
|
||||
diffOpen: boolean;
|
||||
}
|
||||
|
||||
const PERSISTED_STATE_KEY = "codething:renderer-state:v4";
|
||||
const PERSISTED_STATE_KEY = "t3code:renderer-state:v4";
|
||||
const LEGACY_PERSISTED_STATE_KEYS = [
|
||||
"t3code:renderer-state:v3",
|
||||
"codething:renderer-state:v4",
|
||||
"codething:renderer-state:v3",
|
||||
"codething:renderer-state:v2",
|
||||
"codething:renderer-state:v1",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ProviderEvent, ProviderSession } from "@acme/contracts";
|
||||
import type { ProviderEvent, ProviderSession } from "@t3tools/contracts";
|
||||
|
||||
export type SessionPhase = "disconnected" | "connecting" | "ready" | "running";
|
||||
export type RuntimeMode = "approval-required" | "full-access";
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
import type { NativeApi } from "@acme/contracts";
|
||||
import type { NativeApi } from "@t3tools/contracts";
|
||||
|
||||
interface DesktopBridge {
|
||||
getWsUrl: () => string | null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type NativeApi, WS_CHANNELS, WS_METHODS, type WsWelcomePayload } from "@acme/contracts";
|
||||
import { type NativeApi, WS_CHANNELS, WS_METHODS, type WsWelcomePayload } from "@t3tools/contracts";
|
||||
|
||||
import { WsTransport } from "./wsTransport";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { WsPush, WsRequest, WsResponse } from "@acme/contracts";
|
||||
import type { WsPush, WsRequest, WsResponse } from "@t3tools/contracts";
|
||||
|
||||
type PushListener = (data: unknown) => void;
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
"main": "./dist/index.js",
|
||||
"scripts": {
|
||||
"dev": "VITE_DEV_SERVER_URL=http://localhost:5173 tsx src/index.ts",
|
||||
"dev:desktop": "CODETHING_MODE=desktop CODETHING_NO_BROWSER=1 tsx src/index.ts",
|
||||
"dev:desktop": "T3CODE_MODE=desktop T3CODE_NO_BROWSER=1 tsx src/index.ts",
|
||||
"build": "tsup && node scripts/bundle-client.mjs",
|
||||
"start": "node dist/index.js",
|
||||
"start:desktop": "CODETHING_MODE=desktop CODETHING_NO_BROWSER=1 node dist/index.js",
|
||||
"start:desktop": "T3CODE_MODE=desktop T3CODE_NO_BROWSER=1 node dist/index.js",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest run"
|
||||
},
|
||||
@@ -23,8 +23,8 @@
|
||||
"ws": "^8.18.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@acme/contracts": "workspace:*",
|
||||
"@acme/renderer": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/renderer": "workspace:*",
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/ws": "^8.5.13",
|
||||
"tsup": "^8.3.5",
|
||||
|
||||
@@ -11,8 +11,8 @@ import type {
|
||||
ProviderSession,
|
||||
ProviderSessionStartInput,
|
||||
ProviderTurnStartResult,
|
||||
} from "@acme/contracts";
|
||||
import { normalizeModelSlug } from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
import { normalizeModelSlug } from "@t3tools/contracts";
|
||||
|
||||
type PendingRequestKey = string;
|
||||
|
||||
@@ -180,8 +180,8 @@ export class CodexAppServerManager extends EventEmitter<CodexAppServerManagerEve
|
||||
try {
|
||||
await this.sendRequest(context, "initialize", {
|
||||
clientInfo: {
|
||||
name: "codething_desktop",
|
||||
title: "CodeThing Desktop",
|
||||
name: "t3code_desktop",
|
||||
title: "T3 Code Desktop",
|
||||
version: "0.1.0",
|
||||
},
|
||||
capabilities: {
|
||||
|
||||
@@ -29,7 +29,7 @@ function parsePort(value: string | undefined): number | undefined {
|
||||
if (!value) return undefined;
|
||||
const parsed = Number(value);
|
||||
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 65535) {
|
||||
throw new Error(`Invalid CODETHING_PORT: ${value}`);
|
||||
throw new Error(`Invalid T3CODE_PORT: ${value}`);
|
||||
}
|
||||
return parsed;
|
||||
}
|
||||
@@ -97,15 +97,15 @@ function resolveStaticDir(): string | undefined {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const mode: RuntimeMode = process.env.CODETHING_MODE === "desktop" ? "desktop" : "web";
|
||||
const requestedPort = parsePort(process.env.CODETHING_PORT);
|
||||
const mode: RuntimeMode = process.env.T3CODE_MODE === "desktop" ? "desktop" : "web";
|
||||
const requestedPort = parsePort(process.env.T3CODE_PORT);
|
||||
const port =
|
||||
requestedPort ?? (mode === "desktop" ? DEFAULT_PORT : await findAvailablePort(DEFAULT_PORT));
|
||||
const stateDir = resolveStateDir(process.env.CODETHING_STATE_DIR);
|
||||
const stateDir = resolveStateDir(process.env.T3CODE_STATE_DIR);
|
||||
const projectRegistry = new ProjectRegistry(stateDir);
|
||||
const devUrl = process.env.VITE_DEV_SERVER_URL;
|
||||
const noBrowser = parseBooleanEnv(process.env.CODETHING_NO_BROWSER) ?? mode === "desktop";
|
||||
const authToken = process.env.CODETHING_AUTH_TOKEN;
|
||||
const noBrowser = parseBooleanEnv(process.env.T3CODE_NO_BROWSER) ?? mode === "desktop";
|
||||
const authToken = process.env.T3CODE_AUTH_TOKEN;
|
||||
const staticDir = devUrl ? undefined : resolveStaticDir();
|
||||
|
||||
if (!devUrl && !staticDir) {
|
||||
@@ -126,7 +126,7 @@ async function main() {
|
||||
await server.start();
|
||||
|
||||
const url = `http://localhost:${port}`;
|
||||
logger.info("CodeThing running", {
|
||||
logger.info("T3 Code running", {
|
||||
url,
|
||||
cwd,
|
||||
mode,
|
||||
@@ -171,6 +171,6 @@ async function main() {
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
logger.error("failed to start CodeThing", { error: err });
|
||||
logger.error("failed to start T3 Code", { error: err });
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
projectAddInputSchema,
|
||||
projectRecordSchema,
|
||||
projectRemoveInputSchema,
|
||||
} from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
|
||||
function normalizeCwd(rawCwd: string): string {
|
||||
const resolved = path.resolve(rawCwd.trim());
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
providerSendTurnInputSchema,
|
||||
providerSessionStartInputSchema,
|
||||
providerStopSessionInputSchema,
|
||||
} from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
import { CodexAppServerManager } from "./codexAppServerManager";
|
||||
|
||||
export interface ProviderManagerEvents {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { describe, expect, it, afterEach, vi } from "vitest";
|
||||
import { createServer } from "./wsServer";
|
||||
import WebSocket from "ws";
|
||||
|
||||
import { WS_CHANNELS, WS_METHODS, type WsPush, type WsResponse } from "@acme/contracts";
|
||||
import { WS_CHANNELS, WS_METHODS, type WsPush, type WsResponse } from "@t3tools/contracts";
|
||||
import { ProjectRegistry } from "./projectRegistry";
|
||||
|
||||
interface PendingMessages {
|
||||
@@ -87,7 +87,7 @@ describe("WebSocket Server", () => {
|
||||
stateDir?: string;
|
||||
} = {},
|
||||
): ReturnType<typeof createServer> {
|
||||
const stateDir = options.stateDir ?? makeTempDir("codething-ws-state-");
|
||||
const stateDir = options.stateDir ?? makeTempDir("t3code-ws-state-");
|
||||
return createServer({
|
||||
port: 0,
|
||||
cwd: options.cwd ?? "/test/project",
|
||||
@@ -234,8 +234,8 @@ describe("WebSocket Server", () => {
|
||||
});
|
||||
|
||||
it("supports projects list/add/dedupe/remove", async () => {
|
||||
const stateDir = makeTempDir("codething-ws-projects-state-");
|
||||
const firstProjectCwd = makeTempDir("codething-ws-project-a-");
|
||||
const stateDir = makeTempDir("t3code-ws-projects-state-");
|
||||
const firstProjectCwd = makeTempDir("t3code-ws-project-a-");
|
||||
|
||||
server = createTestServer({ stateDir, cwd: "/test" });
|
||||
await server.start();
|
||||
@@ -282,8 +282,8 @@ describe("WebSocket Server", () => {
|
||||
});
|
||||
|
||||
it("prunes missing projects on startup", async () => {
|
||||
const stateDir = makeTempDir("codething-ws-prune-state-");
|
||||
const existing = makeTempDir("codething-ws-existing-project-");
|
||||
const stateDir = makeTempDir("t3code-ws-prune-state-");
|
||||
const existing = makeTempDir("t3code-ws-existing-project-");
|
||||
const missing = path.join(stateDir, "definitely-missing");
|
||||
const now = new Date().toISOString();
|
||||
const projectsFile = path.join(stateDir, "projects.json");
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
type WsRequest,
|
||||
type WsResponse,
|
||||
wsRequestSchema,
|
||||
} from "@acme/contracts";
|
||||
} from "@t3tools/contracts";
|
||||
import { WebSocketServer, type WebSocket } from "ws";
|
||||
|
||||
import { createLogger } from "./logger";
|
||||
@@ -71,7 +71,7 @@ export function createServer(options: ServerOptions) {
|
||||
const clients = new Set<WebSocket>();
|
||||
const logger = createLogger("ws");
|
||||
const logWebSocketEvents =
|
||||
explicitLogWsEvents ?? parseBooleanEnv(process.env.CODETHING_LOG_WS_EVENTS) ?? Boolean(devUrl);
|
||||
explicitLogWsEvents ?? parseBooleanEnv(process.env.T3CODE_LOG_WS_EVENTS) ?? Boolean(devUrl);
|
||||
|
||||
function logOutgoingPush(push: WsPush, recipients: number) {
|
||||
if (!logWebSocketEvents) return;
|
||||
|
||||
@@ -6,7 +6,7 @@ export default defineConfig({
|
||||
outDir: "dist",
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
noExternal: ["@acme/contracts"],
|
||||
noExternal: ["@t3tools/contracts"],
|
||||
banner: {
|
||||
js: '#!/usr/bin/env node\n',
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
},
|
||||
"apps/desktop": {
|
||||
"name": "@acme/desktop",
|
||||
"name": "@t3tools/desktop",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"electron": "33.4.11",
|
||||
@@ -29,10 +29,10 @@
|
||||
},
|
||||
},
|
||||
"apps/renderer": {
|
||||
"name": "@acme/renderer",
|
||||
"name": "@t3tools/renderer",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@acme/contracts": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"highlight.js": "^11.11.1",
|
||||
"lucide-react": "^0.563.0",
|
||||
"react": "^19.0.0",
|
||||
@@ -64,8 +64,8 @@
|
||||
"ws": "^8.18.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@acme/contracts": "workspace:*",
|
||||
"@acme/renderer": "workspace:*",
|
||||
"@t3tools/contracts": "workspace:*",
|
||||
"@t3tools/renderer": "workspace:*",
|
||||
"@types/node": "^22.10.2",
|
||||
"@types/ws": "^8.5.13",
|
||||
"tsup": "^8.3.5",
|
||||
@@ -74,7 +74,7 @@
|
||||
},
|
||||
},
|
||||
"packages/contracts": {
|
||||
"name": "@acme/contracts",
|
||||
"name": "@t3tools/contracts",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"zod": "^3.24.1",
|
||||
@@ -86,12 +86,6 @@
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@acme/contracts": ["@acme/contracts@workspace:packages/contracts"],
|
||||
|
||||
"@acme/desktop": ["@acme/desktop@workspace:apps/desktop"],
|
||||
|
||||
"@acme/renderer": ["@acme/renderer@workspace:apps/renderer"],
|
||||
|
||||
"@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
|
||||
|
||||
"@babel/compat-data": ["@babel/[email protected]", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="],
|
||||
@@ -296,6 +290,12 @@
|
||||
|
||||
"@szmarczak/http-timer": ["@szmarczak/[email protected]", "", { "dependencies": { "defer-to-connect": "^2.0.0" } }, "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w=="],
|
||||
|
||||
"@t3tools/contracts": ["@t3tools/contracts@workspace:packages/contracts"],
|
||||
|
||||
"@t3tools/desktop": ["@t3tools/desktop@workspace:apps/desktop"],
|
||||
|
||||
"@t3tools/renderer": ["@t3tools/renderer@workspace:apps/renderer"],
|
||||
|
||||
"@tailwindcss/node": ["@tailwindcss/[email protected]", "", { "dependencies": { "@jridgewell/remapping": "^2.3.4", "enhanced-resolve": "^5.18.3", "jiti": "^2.6.1", "lightningcss": "1.30.2", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.1.18" } }, "sha512-DoR7U1P7iYhw16qJ49fgXUlry1t4CpXeErJHnQ44JgTSKMaZUdf17cfn5mHchfJ4KRBZRFA/Coo+MUF5+gOaCQ=="],
|
||||
|
||||
"@tailwindcss/oxide": ["@tailwindcss/[email protected]", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.1.18", "@tailwindcss/oxide-darwin-arm64": "4.1.18", "@tailwindcss/oxide-darwin-x64": "4.1.18", "@tailwindcss/oxide-freebsd-x64": "4.1.18", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.18", "@tailwindcss/oxide-linux-arm64-gnu": "4.1.18", "@tailwindcss/oxide-linux-arm64-musl": "4.1.18", "@tailwindcss/oxide-linux-x64-gnu": "4.1.18", "@tailwindcss/oxide-linux-x64-musl": "4.1.18", "@tailwindcss/oxide-wasm32-wasi": "4.1.18", "@tailwindcss/oxide-win32-arm64-msvc": "4.1.18", "@tailwindcss/oxide-win32-x64-msvc": "4.1.18" } }, "sha512-EgCR5tTS5bUSKQgzeMClT6iCY3ToqE1y+ZB0AKldj809QXk1Y+3jB0upOYZrn9aGIzPtUsP7sX4QQ4XtjBB95A=="],
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ct-round-5",
|
||||
"name": "@t3tools/monorepo",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "CODETHING_LOG_WS_EVENTS=1 VITE_WS_URL=ws://localhost:3773 turbo run dev --ui=tui --filter=@acme/contracts --filter=@acme/renderer --filter=t3 --parallel",
|
||||
"dev": "T3CODE_LOG_WS_EVENTS=1 VITE_WS_URL=ws://localhost:3773 turbo run dev --ui=tui --filter=@t3tools/contracts --filter=@t3tools/renderer --filter=t3 --parallel",
|
||||
"dev:server": "bun run build:contracts && bun run --cwd apps/server dev",
|
||||
"dev:web": "VITE_WS_URL=ws://localhost:3773 bun run --cwd apps/renderer dev",
|
||||
"dev:desktop": "bun run --cwd apps/desktop dev",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@acme/contracts",
|
||||
"name": "@t3tools/contracts",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"files": [
|
||||
|
||||
+8
-8
@@ -4,13 +4,13 @@
|
||||
"PORT",
|
||||
"VITE_WS_URL",
|
||||
"VITE_DEV_SERVER_URL",
|
||||
"CODETHING_LOG_WS_EVENTS",
|
||||
"CODETHING_MODE",
|
||||
"CODETHING_PORT",
|
||||
"CODETHING_NO_BROWSER",
|
||||
"CODETHING_STATE_DIR",
|
||||
"CODETHING_AUTH_TOKEN",
|
||||
"CODETHING_DESKTOP_WS_URL"
|
||||
"T3CODE_LOG_WS_EVENTS",
|
||||
"T3CODE_MODE",
|
||||
"T3CODE_PORT",
|
||||
"T3CODE_NO_BROWSER",
|
||||
"T3CODE_STATE_DIR",
|
||||
"T3CODE_AUTH_TOKEN",
|
||||
"T3CODE_DESKTOP_WS_URL"
|
||||
],
|
||||
"tasks": {
|
||||
"build": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"outputs": ["dist/**", "dist-electron/**"]
|
||||
},
|
||||
"dev": {
|
||||
"dependsOn": ["@acme/contracts#build"],
|
||||
"dependsOn": ["@t3tools/contracts#build"],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user