Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"electron-updater": "^6.6.2"
},
"devDependencies": {
"@types/node": "catalog:",
"@workbench/contracts": "workspace:*",
"@workbench/shared": "workspace:*",
"@types/node": "catalog:",
"effect-acp": "workspace:*",
"tsdown": "catalog:",
"typescript": "catalog:",
Expand Down
8 changes: 4 additions & 4 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"directory": "apps/server"
},
"bin": {
"workbench": "./dist/bin.mjs",
"t3": "./dist/bin.mjs"
"t3": "./dist/bin.mjs",
"workbench": "./dist/bin.mjs"
},
"files": [
"dist"
Expand Down Expand Up @@ -39,11 +39,11 @@
"devDependencies": {
"@effect/language-service": "catalog:",
"@effect/vitest": "catalog:",
"@types/bun": "catalog:",
"@types/node": "catalog:",
"@workbench/contracts": "workspace:*",
"@workbench/shared": "workspace:*",
"@workbench/web": "workspace:*",
"@types/bun": "catalog:",
"@types/node": "catalog:",
"effect-acp": "workspace:*",
"tsdown": "catalog:",
"typescript": "catalog:",
Expand Down
6 changes: 5 additions & 1 deletion apps/server/src/auth/Layers/SessionCredentialService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { AuthSessionId, type AuthClientMetadata, type AuthClientSession } from "@workbench/contracts";
import {
AuthSessionId,
type AuthClientMetadata,
type AuthClientSession,
} from "@workbench/contracts";
import { Clock, DateTime, Duration, Effect, Layer, PubSub, Ref, Schema, Stream } from "effect";
import { Option } from "effect";

Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ function optionalConfigWithAliases<Value>(
config = Config.orElse(config, () => read(name));
}

return config.pipe(Config.option, Config.map((value) => Option.getOrUndefined(value)));
return config.pipe(
Config.option,
Config.map((value) => Option.getOrUndefined(value)),
);
}

const stringConfigWithAliases = (...names: ReadonlyArray<string>) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { CheckpointRef, EventId, MessageId, ProjectId, ThreadId, TurnId } from "@workbench/contracts";
import {
CheckpointRef,
EventId,
MessageId,
ProjectId,
ThreadId,
TurnId,
} from "@workbench/contracts";
import { assert, it } from "@effect/vitest";
import { Effect, Layer } from "effect";
import * as SqlClient from "effect/unstable/sql/SqlClient";
Expand Down
5 changes: 4 additions & 1 deletion apps/server/src/project/Layers/RepositoryIdentityResolver.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { RepositoryIdentity } from "@workbench/contracts";
import { Cache, Duration, Effect, Exit, Layer } from "effect";
import { detectGitHostingProviderFromRemoteUrl, normalizeGitRemoteUrl } from "@workbench/shared/git";
import {
detectGitHostingProviderFromRemoteUrl,
normalizeGitRemoteUrl,
} from "@workbench/shared/git";

import { runProcess } from "../../processRunner.ts";
import {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"@legendapp/list": "3.0.0-beta.44",
"@lexical/react": "^0.41.0",
"@pierre/diffs": "^1.1.0-beta.16",
"@workbench/client-runtime": "workspace:*",
"@workbench/contracts": "workspace:*",
"@workbench/shared": "workspace:*",
"@tanstack/react-pacer": "^0.19.4",
"@tanstack/react-query": "^5.90.0",
"@tanstack/react-router": "^1.160.2",
"@workbench/client-runtime": "workspace:*",
"@workbench/contracts": "workspace:*",
"@workbench/shared": "workspace:*",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"class-variance-authority": "^0.7.1",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/Sidebar.logic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import * as React from "react";
import type { SidebarProjectSortOrder, SidebarThreadSortOrder } from "@workbench/contracts/settings";
import type {
SidebarProjectSortOrder,
SidebarThreadSortOrder,
} from "@workbench/contracts/settings";
import {
getThreadSortTimestamp,
sortThreads,
Expand Down
5 changes: 4 additions & 1 deletion apps/web/src/components/console/ViewerPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ export function ViewerPane({
}, [activeDocumentViewMode, editBuffer]);

return (
<div ref={paneRootRef} className="flex h-full min-h-0 min-w-0 flex-col [-webkit-app-region:no-drag]">
<div
ref={paneRootRef}
className="flex h-full min-h-0 min-w-0 flex-col [-webkit-app-region:no-drag]"
>
<div className="flex h-12 shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 [-webkit-app-region:no-drag]">
<div className="flex min-w-0 items-center gap-1.5">
<Button
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/components/console/consolePaneState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ const DEFAULT_COLLAPSED: ConsolePaneVisibilityMap = {
export function useConsolePaneVisibility(): [
ConsolePaneVisibilityMap,
(
next:
| ConsolePaneVisibilityMap
| ((prev: ConsolePaneVisibilityMap) => ConsolePaneVisibilityMap),
next: ConsolePaneVisibilityMap | ((prev: ConsolePaneVisibilityMap) => ConsolePaneVisibilityMap),
) => void,
(paneId: ConsolePaneId) => void,
] {
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/settings/SettingsPanels.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@ describe("GeneralSettingsPanel observability", () => {
await networkAccessToggle.click();
await expect.element(page.getByText("Enable network access?")).toBeInTheDocument();
await expect
.element(page.getByText("Workbench will restart to expose this environment over the network."))
.element(
page.getByText("Workbench will restart to expose this environment over the network."),
)
.toBeInTheDocument();
await page.getByRole("button", { name: "Restart and enable", exact: true }).click();
await vi.waitFor(() => {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/components/settings/SettingsPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ function getProviderSummary(provider: ServerProvider | undefined) {
return {
headline: "Disabled",
detail:
provider.message ?? "This provider is installed but disabled for new sessions in Workbench.",
provider.message ??
"This provider is installed but disabled for new sessions in Workbench.",
};
}
if (!provider.installed) {
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/coworkShell.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { PROVIDER_DISPLAY_NAMES, type ProviderKind, type ServerProvider } from "@workbench/contracts";
import {
PROVIDER_DISPLAY_NAMES,
type ProviderKind,
type ServerProvider,
} from "@workbench/contracts";

export const COWORK_SHELL = {
hideGitSurfaces: true,
Expand Down
20 changes: 15 additions & 5 deletions apps/web/src/environments/primary/bootstrap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ describe("environmentBootstrap", () => {
vi.stubEnv("VITE_WS_URL", "wss://remote.example.com");

await expect(resolveInitialPrimaryEnvironmentDescriptor()).resolves.toEqual(BASE_ENVIRONMENT);
expect(fetchMock).toHaveBeenCalledWith("https://remote.example.com/.well-known/workbench/environment");
expect(fetchMock).toHaveBeenCalledWith(
"https://remote.example.com/.well-known/workbench/environment",
);
});

it("derives the websocket url when only VITE_HTTP_URL is configured", async () => {
Expand All @@ -116,7 +118,9 @@ describe("environmentBootstrap", () => {
vi.stubEnv("VITE_HTTP_URL", "https://remote.example.com");

await expect(resolveInitialPrimaryEnvironmentDescriptor()).resolves.toEqual(BASE_ENVIRONMENT);
expect(fetchMock).toHaveBeenCalledWith("https://remote.example.com/.well-known/workbench/environment");
expect(fetchMock).toHaveBeenCalledWith(
"https://remote.example.com/.well-known/workbench/environment",
);
expect(getPrimaryKnownEnvironment()?.target).toEqual({
httpBaseUrl: "https://remote.example.com/",
wsBaseUrl: "wss://remote.example.com/",
Expand All @@ -129,7 +133,9 @@ describe("environmentBootstrap", () => {
vi.stubEnv("VITE_WS_URL", "wss://remote.example.com");

await expect(resolveInitialPrimaryEnvironmentDescriptor()).resolves.toEqual(BASE_ENVIRONMENT);
expect(fetchMock).toHaveBeenCalledWith("https://remote.example.com/.well-known/workbench/environment");
expect(fetchMock).toHaveBeenCalledWith(
"https://remote.example.com/.well-known/workbench/environment",
);
expect(getPrimaryKnownEnvironment()?.target).toEqual({
httpBaseUrl: "https://remote.example.com/",
wsBaseUrl: "wss://remote.example.com/",
Expand All @@ -142,7 +148,9 @@ describe("environmentBootstrap", () => {
installTestBrowser("http://localhost:5735/");

await expect(resolveInitialPrimaryEnvironmentDescriptor()).resolves.toEqual(BASE_ENVIRONMENT);
expect(fetchMock).toHaveBeenCalledWith("http://localhost:5735/.well-known/workbench/environment");
expect(fetchMock).toHaveBeenCalledWith(
"http://localhost:5735/.well-known/workbench/environment",
);
});

it("uses the vite proxy for desktop-managed loopback descriptor requests during local dev", async () => {
Expand All @@ -165,6 +173,8 @@ describe("environmentBootstrap", () => {
});

await expect(resolveInitialPrimaryEnvironmentDescriptor()).resolves.toEqual(BASE_ENVIRONMENT);
expect(fetchMock).toHaveBeenCalledWith("http://127.0.0.1:5733/.well-known/workbench/environment");
expect(fetchMock).toHaveBeenCalledWith(
"http://127.0.0.1:5733/.well-known/workbench/environment",
);
});
});
5 changes: 4 additions & 1 deletion apps/web/src/lib/threadSort.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { ProjectId } from "@workbench/contracts";
import type { SidebarProjectSortOrder, SidebarThreadSortOrder } from "@workbench/contracts/settings";
import type {
SidebarProjectSortOrder,
SidebarThreadSortOrder,
} from "@workbench/contracts/settings";
import type { Thread } from "../types";

export type ThreadSortInput = Pick<Thread, "createdAt" | "updatedAt"> & {
Expand Down
5 changes: 2 additions & 3 deletions scripts/build-desktop-artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,8 @@ const BuildEnvConfig = Config.all({
["WORKBENCH_DESKTOP_TARGET", "T3CODE_DESKTOP_TARGET"],
Config.string,
),
arch: optionalConfigWithAliases(
["WORKBENCH_DESKTOP_ARCH", "T3CODE_DESKTOP_ARCH"],
(name) => Config.schema(BuildArch, name),
arch: optionalConfigWithAliases(["WORKBENCH_DESKTOP_ARCH", "T3CODE_DESKTOP_ARCH"], (name) =>
Config.schema(BuildArch, name),
),
version: optionalConfigWithAliases(
["WORKBENCH_DESKTOP_VERSION", "T3CODE_DESKTOP_VERSION"],
Expand Down
27 changes: 20 additions & 7 deletions scripts/dev-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ const MODE_ARGS = {
],
"dev:server": ["run", "dev", "--filter=workbench"],
"dev:web": ["run", "dev", "--filter=@workbench/web"],
"dev:desktop": ["run", "dev", "--filter=@workbench/desktop", "--filter=@workbench/web", "--parallel"],
"dev:desktop": [
"run",
"dev",
"--filter=@workbench/desktop",
"--filter=@workbench/web",
"--parallel",
],
} as const satisfies Record<string, ReadonlyArray<string>>;

type DevMode = keyof typeof MODE_ARGS;
Expand All @@ -76,17 +82,22 @@ function optionalConfigWithAliases<Value>(
config = Config.orElse(config, () => read(name));
}

return config.pipe(Config.option, Config.map((value) => Option.getOrUndefined(value)));
return config.pipe(
Config.option,
Config.map((value) => Option.getOrUndefined(value)),
);
}

const optionalStringConfig = (...names: ReadonlyArray<string>): Config.Config<string | undefined> =>
optionalConfigWithAliases(names, Config.string);
const optionalBooleanConfig = (...names: ReadonlyArray<string>): Config.Config<boolean | undefined> =>
optionalConfigWithAliases(names, Config.boolean);
const optionalBooleanConfig = (
...names: ReadonlyArray<string>
): Config.Config<boolean | undefined> => optionalConfigWithAliases(names, Config.boolean);
const optionalPortConfig = (...names: ReadonlyArray<string>): Config.Config<number | undefined> =>
optionalConfigWithAliases(names, Config.port);
const optionalIntegerConfig = (...names: ReadonlyArray<string>): Config.Config<number | undefined> =>
optionalConfigWithAliases(names, Config.int);
const optionalIntegerConfig = (
...names: ReadonlyArray<string>
): Config.Config<number | undefined> => optionalConfigWithAliases(names, Config.int);
const optionalUrlConfig = (...names: ReadonlyArray<string>): Config.Config<URL | undefined> =>
optionalConfigWithAliases(names, Config.url);

Expand Down Expand Up @@ -530,7 +541,9 @@ const devRunnerCli = Command.make("dev-runner", {
logWebSocketEvents: Flag.boolean("log-websocket-events").pipe(
Flag.withDescription("WebSocket event logging toggle (equivalent to WORKBENCH_LOG_WS_EVENTS)."),
Flag.withAlias("log-ws-events"),
Flag.withFallbackConfig(optionalBooleanConfig("WORKBENCH_LOG_WS_EVENTS", "T3CODE_LOG_WS_EVENTS")),
Flag.withFallbackConfig(
optionalBooleanConfig("WORKBENCH_LOG_WS_EVENTS", "T3CODE_LOG_WS_EVENTS"),
),
),
host: Flag.string("host").pipe(
Flag.withDescription("Server host/interface override (forwards to WORKBENCH_HOST)."),
Expand Down