Compare commits

..
Author SHA1 Message Date
Julius Marmingeandcodex 18c7d97082 fix(web): hide collapsed sidebar header toggle
Co-authored-by: codex <[email protected]>
2026-07-17 21:27:02 +02:00
Julius Marminge 8709035a09 Merge branch 'main' into t3code/macos-corner-fix 2026-07-17 21:18:15 +02:00
Olivier Melcher a7f6d97b94 Allow preview panel to grow on wide displays (#4044) 2026-07-17 18:40:24 +00:00
Kriday DaveandJulius Marminge f9a4f59930 Fix documented task-runner commands (bun run -> vp) (#3965)
Co-authored-by: Julius Marminge <[email protected]>
2026-07-17 20:35:24 +02:00
BunnyGamezsc 7f1cb61031 fix(cursor): default binary path to cursor-agent (avoid path conflict w/ grok) (#4094) 2026-07-17 18:01:02 +00:00
Kriday Dave c49d424e3a Normalize protocol-relative remote host input as https (#3971) 2026-07-17 18:59:42 +02:00
Manuel De Ceglie 4804a9824f fix(marketing): correct Cursor icon color (#4090) 2026-07-17 18:56:59 +02:00
Manuel De Ceglie 0748134cec Update marketing GitHub star count (#4088) 2026-07-17 18:56:35 +02:00
Julius Marmingeandcodex 6e9987cf17 Refresh app icons across release variants (#4080)
Co-authored-by: codex <[email protected]>
2026-07-17 18:51:14 +02:00
Theo BrowneandClaude Fable 5 2ff16b4891 Fix macOS titlebar corner: brand next to traffic lights
The always-visible sidebar toggle sat between the macOS traffic lights
and the brand, pushing "T3 Code" ~130px right against the sidebar's
right edge. Move the toggle to the right edge of the sidebar header
while expanded, and only show the fixed titlebar toggle when the
sidebar is collapsed, so the brand sits directly after the traffic
lights.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-16 14:44:21 -07:00
86 changed files with 1633 additions and 271 deletions

No files matched your search

@@ -1 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="cursor_light__Ebene_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 466.73 532.09"><defs></defs><path class="cursor_light__st0" d="M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z"></path></svg>
<?xml version="1.0" encoding="UTF-8"?><svg id="cursor_light__Ebene_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 466.73 532.09"><defs></defs><path class="cursor_light__st0" fill="#EDECEC" d="M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z"></path></svg>

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 665 B

+1 -1
View File
@@ -1,6 +1,6 @@
export const GITHUB_REPOSITORY_URL = "https://github.com/pingdotgg/t3code";
export const MARKETING_STATS = {
githubStars: "12k+",
githubStars: "14k+",
users: "100,000",
} as const;
+22 -8
View File
@@ -1,5 +1,6 @@
import type { ExpoConfig } from "expo/config";
import { BRAND_ASSET_PATHS } from "../../scripts/lib/brand-assets.ts";
import { loadRepoEnv } from "../../scripts/lib/public-config.ts";
type AppVariant = "development" | "preview" | "production";
@@ -13,6 +14,8 @@ const isIosPersonalTeamBuild = repoEnv.T3CODE_IOS_PERSONAL_TEAM === "1";
const personalTeamBundleIdentifier = repoEnv.T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID?.trim();
const IOS_BUNDLE_IDENTIFIER_PATTERN = /^[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+$/;
const fromRepoRoot = (relativePath: string) => `../../${relativePath}`;
if (
isIosPersonalTeamBuild &&
(!personalTeamBundleIdentifier ||
@@ -24,20 +27,31 @@ if (
}
const DEVELOPMENT_ASSETS = {
appIcon: "./assets/splash-icon-dev.png",
iosIcon: "./assets/icon-composer-dev.icon",
splashIcon: "./assets/splash-icon-dev.png",
androidAdaptiveForeground: "./assets/android-icon-dev-foreground.png",
appIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIosIconPng),
iosIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIconComposerProject),
splashIcon: fromRepoRoot(BRAND_ASSET_PATHS.developmentIosIconPng),
androidAdaptiveForeground: fromRepoRoot(BRAND_ASSET_PATHS.developmentUniversalIconPng),
androidAdaptiveBackgroundColor: "#00639B",
androidMonochromeIcon: "./assets/android-icon-mark.png",
androidNotificationIcon: "./assets/android-notification-icon.png",
androidNotificationColor: "#00639B",
} as const;
const PREVIEW_ASSETS = {
appIcon: fromRepoRoot(BRAND_ASSET_PATHS.nightlyIosIconPng),
iosIcon: fromRepoRoot(BRAND_ASSET_PATHS.nightlyIconComposerProject),
splashIcon: fromRepoRoot(BRAND_ASSET_PATHS.nightlyIosIconPng),
androidAdaptiveForeground: fromRepoRoot(BRAND_ASSET_PATHS.nightlyLinuxIconPng),
androidAdaptiveBackgroundColor: "#111533",
androidMonochromeIcon: "./assets/android-icon-mark.png",
androidNotificationIcon: "./assets/android-notification-icon.png",
androidNotificationColor: "#7565C7",
} as const;
const RELEASE_ASSETS = {
appIcon: "./assets/splash-icon-prod.png",
iosIcon: "./assets/icon-composer-prod.icon",
splashIcon: "./assets/splash-icon-prod.png",
appIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
iosIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIconComposerProject),
splashIcon: fromRepoRoot(BRAND_ASSET_PATHS.productionIosIconPng),
androidAdaptiveForeground: "./assets/android-icon-mark.png",
androidAdaptiveBackgroundColor: "#000000",
androidMonochromeIcon: "./assets/android-icon-mark.png",
@@ -60,7 +74,7 @@ const VARIANT_CONFIG = {
iosBundleIdentifier: "com.t3tools.t3code.preview",
androidPackage: "com.t3tools.t3code.preview",
relyingParty: "clerk.t3.codes",
assets: RELEASE_ASSETS,
assets: PREVIEW_ASSETS,
},
production: {
appName: "T3 Code",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

@@ -1,3 +0,0 @@
<svg width="77" height="47" viewBox="0 0 77 47" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.56 45.5V8.58H1.69082e-06V-3.09944e-06H39.65V8.58H25.09V45.5H14.56ZM57.8454 46.28C54.6821 46.28 51.5404 45.8683 48.4204 45.045C45.3004 44.1783 42.6571 42.965 40.4904 41.405L44.5854 33.345C46.3188 34.6017 48.3338 35.5983 50.6304 36.335C52.9271 37.0717 55.2454 37.44 57.5854 37.44C60.2288 37.44 62.3088 36.92 63.8254 35.88C65.3421 34.84 66.1004 33.41 66.1004 31.59C66.1004 29.8567 65.4288 28.4917 64.0854 27.495C62.7421 26.4983 60.5754 26 57.5854 26H52.7754V19.045L65.4504 4.68L66.6204 8.45H42.7654V-3.09944e-06H74.6154V6.825L62.0054 21.19L56.6754 18.135H59.7304C65.3204 18.135 69.5454 19.3917 72.4054 21.905C75.2654 24.4183 76.6954 27.6467 76.6954 31.59C76.6954 34.1467 76.0238 36.5517 74.6804 38.805C73.3371 41.015 71.2788 42.8133 68.5054 44.2C65.7321 45.5867 62.1788 46.28 57.8454 46.28Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

+13 -3
View File
@@ -1,13 +1,23 @@
import { Image, View } from "react-native";
import Constants from "expo-constants";
import { Image } from "expo-image";
import { View } from "react-native";
import { AppText as Text } from "./AppText";
const BRAND_MARK_SOURCE = require("../../../../assets/dev/blueprint-ios-1024.png");
const appVariant = Constants.expoConfig?.extra?.appVariant;
const BRAND_MARK_SOURCE =
appVariant === "development"
? require("../../../../assets/dev/blueprint-ios-1024.png")
: appVariant === "preview"
? require("../../../../assets/nightly/nightly-ios-1024.png")
: require("../../../../assets/prod/black-ios-1024.png");
const DEFAULT_STAGE_LABEL =
appVariant === "development" ? "Dev" : appVariant === "preview" ? "Preview" : "Alpha";
export function BrandMark(props: { readonly compact?: boolean; readonly stageLabel?: string }) {
const compact = props.compact ?? false;
const iconSize = compact ? 32 : 44;
const stageLabel = props.stageLabel ?? "Alpha";
const stageLabel = props.stageLabel ?? DEFAULT_STAGE_LABEL;
return (
<View className="flex-row items-center gap-3">
@@ -62,7 +62,7 @@ const promptText = NodeProcess.argv[4] ?? "helo";
const targetReasoning = NodeProcess.env.CURSOR_REASONING ?? "";
const targetContext = NodeProcess.env.CURSOR_CONTEXT ?? "";
const targetFast = NodeProcess.env.CURSOR_FAST ?? "";
const agentBin = NodeProcess.env.CURSOR_AGENT_BIN ?? "agent";
const agentBin = NodeProcess.env.CURSOR_AGENT_BIN ?? "cursor-agent";
const promptWaitMs = Number(NodeProcess.env.CURSOR_PROMPT_WAIT_MS ?? "4000");
const requestTimeoutMs = Number(NodeProcess.env.CURSOR_REQUEST_TIMEOUT_MS ?? "20000");
@@ -1,5 +1,5 @@
/**
* CursorDriver — `ProviderDriver` for the Cursor Agent (`agent`) runtime.
* CursorDriver — `ProviderDriver` for the Cursor Agent (`cursor-agent`) runtime.
*
* Cursor exposes an ACP-based CLI. Model catalog and capability refreshes
* happen during the managed provider status check via Cursor's
@@ -42,7 +42,7 @@ import type { ServerProviderDraft } from "../providerSnapshot.ts";
import { mergeProviderInstanceEnvironment } from "../ProviderInstanceEnvironment.ts";
import {
makeProviderMaintenanceCapabilities,
makeStaticProviderMaintenanceResolver,
type ProviderMaintenanceCapabilitiesResolver,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import {
@@ -54,15 +54,16 @@ const decodeCursorSettings = Schema.decodeSync(CursorSettings);
const DRIVER_KIND = ProviderDriverKind.make("cursor");
const SNAPSHOT_REFRESH_INTERVAL = Duration.minutes(5);
const UPDATE = makeStaticProviderMaintenanceResolver(
makeProviderMaintenanceCapabilities({
provider: DRIVER_KIND,
packageName: null,
updateExecutable: "agent",
updateArgs: ["update"],
updateLockKey: "cursor-agent",
}),
);
const UPDATE: ProviderMaintenanceCapabilitiesResolver = {
resolve: (options) =>
makeProviderMaintenanceCapabilities({
provider: DRIVER_KIND,
packageName: null,
updateExecutable: options?.binaryPath?.trim() || "cursor-agent",
updateArgs: ["update"],
updateLockKey: "cursor-agent",
}),
};
export type CursorDriverEnv =
| ChildProcessSpawner.ChildProcessSpawner
@@ -294,7 +294,7 @@ const parameterizedClaudeModelOptionConfigOptions = [
const baseCursorSettings: CursorSettings = {
enabled: true,
binaryPath: "agent",
binaryPath: "cursor-agent",
apiEndpoint: "",
customModels: [],
};
@@ -38,7 +38,6 @@ import {
import { type OpenCodeAdapterShape } from "../Services/OpenCodeAdapter.ts";
import {
buildOpenCodePermissionRules,
isOpenCodeRuntimeError,
OpenCodeRuntime,
OpenCodeRuntimeError,
openCodeQuestionId,
@@ -132,7 +131,7 @@ const toProcessError = (threadId: ThreadId, cause: unknown): ProviderAdapterProc
new ProviderAdapterProcessError({
provider: PROVIDER,
threadId,
detail: isOpenCodeRuntimeError(cause) ? cause.detail : openCodeRuntimeErrorDetail(cause),
detail: OpenCodeRuntimeError.is(cause) ? cause.detail : openCodeRuntimeErrorDetail(cause),
cause,
});
@@ -76,7 +76,7 @@ const makeClaudeConfig = (overrides: Partial<ClaudeSettings>): ClaudeSettings =>
const makeCursorConfig = (overrides: Partial<CursorSettings>): CursorSettings => ({
enabled: false,
binaryPath: "agent",
binaryPath: "cursor-agent",
apiEndpoint: "",
customModels: [],
...overrides,
@@ -1396,7 +1396,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
Layer.provideMerge(OpenCodeRuntime.OpenCodeRuntimeLive),
Layer.provideMerge(
mockCommandSpawnerLayer((command, args) => {
if (command === "agent") {
if (command === "cursor-agent") {
cursorSpawned = true;
}
const joined = args.join(" ");
@@ -1,5 +1,5 @@
/**
* Optional integration check against a real `agent acp` install.
* Optional integration check against a real `cursor-agent acp` install.
* Enable with: T3_CURSOR_ACP_PROBE=1 bun run test --filter CursorAcpCliProbe
*/
import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -12,7 +12,7 @@ import type * as EffectAcpSchema from "effect-acp/schema";
import * as AcpSessionRuntime from "./AcpSessionRuntime.ts";
describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe", () => {
it.effect("initialize and authenticate against real agent acp", () =>
it.effect("initialize and authenticate against real cursor-agent acp", () =>
Effect.gen(function* () {
const runtime = yield* AcpSessionRuntime.AcpSessionRuntime;
const started = yield* runtime.start();
@@ -21,7 +21,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
Effect.provide(
AcpSessionRuntime.layer({
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
@@ -77,7 +77,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
AcpSessionRuntime.layer({
authMethodId: "cursor_login",
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
@@ -133,7 +133,7 @@ describe.runIf(process.env.T3_CURSOR_ACP_PROBE === "1")("Cursor ACP CLI probe",
AcpSessionRuntime.layer({
authMethodId: "cursor_login",
spawn: {
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: process.cwd(),
},
@@ -53,7 +53,7 @@ const parameterizedGpt54ConfigOptions: ReadonlyArray<EffectAcpSchema.SessionConf
describe("buildCursorAcpSpawnInput", () => {
it("builds the default Cursor ACP command", () => {
expect(buildCursorAcpSpawnInput(undefined, "/tmp/project")).toEqual({
command: "agent",
command: "cursor-agent",
args: ["acp"],
cwd: "/tmp/project",
});
@@ -35,7 +35,7 @@ export function buildCursorAcpSpawnInput(
environment?: NodeJS.ProcessEnv,
): AcpSessionRuntime.AcpSpawnInput {
return {
command: cursorSettings?.binaryPath || "agent",
command: cursorSettings?.binaryPath || "cursor-agent",
args: [
...(cursorSettings?.apiEndpoint ? (["-e", cursorSettings.apiEndpoint] as const) : []),
"acp",
+13 -12
View File
@@ -13,12 +13,14 @@ import {
} from "@opencode-ai/sdk/v2";
import * as Cause from "effect/Cause";
import * as Context from "effect/Context";
import * as Data from "effect/Data";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as Fiber from "effect/Fiber";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as P from "effect/Predicate";
import * as Ref from "effect/Ref";
import * as Result from "effect/Result";
import * as Scope from "effect/Scope";
@@ -48,16 +50,15 @@ export interface OpenCodeServerConnection {
readonly external: boolean;
}
export class OpenCodeRuntimeError extends Schema.TaggedErrorClass<OpenCodeRuntimeError>()(
"OpenCodeRuntimeError",
{
operation: Schema.String,
cause: Schema.optional(Schema.Defect()),
detail: Schema.String,
},
) {}
export const isOpenCodeRuntimeError = Schema.is(OpenCodeRuntimeError);
const OPENCODE_RUNTIME_ERROR_TAG = "OpenCodeRuntimeError";
export class OpenCodeRuntimeError extends Data.TaggedError(OPENCODE_RUNTIME_ERROR_TAG)<{
readonly operation: string;
readonly cause?: unknown;
readonly detail: string;
}> {
static readonly is = (u: unknown): u is OpenCodeRuntimeError =>
P.isTagged(u, OPENCODE_RUNTIME_ERROR_TAG);
}
function encodeJsonStringForDiagnostics(input: unknown): string | undefined {
const result = encodeUnknownJsonStringExit(input);
@@ -65,7 +66,7 @@ function encodeJsonStringForDiagnostics(input: unknown): string | undefined {
}
export function openCodeRuntimeErrorDetail(cause: unknown): string {
if (isOpenCodeRuntimeError(cause)) return cause.detail;
if (OpenCodeRuntimeError.is(cause)) return cause.detail;
if (cause instanceof Error && cause.message.trim().length > 0) return cause.message.trim();
if (cause && typeof cause === "object") {
// SDK v2 throws { response, request, error? } shapes — extract what's useful
@@ -269,7 +270,7 @@ function ensureRuntimeError(
detail: string,
cause: unknown,
): OpenCodeRuntimeError {
return isOpenCodeRuntimeError(cause)
return OpenCodeRuntimeError.is(cause)
? cause
: new OpenCodeRuntimeError({ operation, detail, cause });
}
@@ -48,7 +48,7 @@ function lifecycleFor(provider: ProviderDriverKind): ProviderMaintenanceCapabili
return makeProviderMaintenanceCapabilities({
provider,
packageName: null,
updateExecutable: "agent",
updateExecutable: "cursor-agent",
updateArgs: ["update"],
updateLockKey: "cursor-agent",
});
@@ -226,7 +226,7 @@ describe("providerMaintenanceRunner", () => {
const result = yield* updater.updateProvider(CURSOR_DRIVER);
assert.deepStrictEqual(calls, [
{
command: "agent",
command: "cursor-agent",
args: ["update"],
},
]);
@@ -1,13 +1,13 @@
import { OpenCodeSettings, ProviderInstanceId, TextGenerationError } from "@t3tools/contracts";
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, it } from "@effect/vitest";
import { it } from "@effect/vitest";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Schema from "effect/Schema";
import * as TestClock from "effect/testing/TestClock";
import * as NetService from "@t3tools/shared/Net";
import { beforeEach } from "vite-plus/test";
import { beforeEach, expect } from "vite-plus/test";
import * as ServerConfig from "../config.ts";
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
@@ -39,7 +39,7 @@ const runtimeMock = {
},
};
const OpenCodeRuntimeTestLayer = Layer.mock(OpenCodeRuntime.OpenCodeRuntime)({
const OpenCodeRuntimeTestDouble: OpenCodeRuntime.OpenCodeRuntimeShape = {
startOpenCodeServerProcess: ({ binaryPath }) =>
Effect.gen(function* () {
const index = runtimeMock.state.startCalls.length + 1;
@@ -57,6 +57,13 @@ const OpenCodeRuntimeTestLayer = Layer.mock(OpenCodeRuntime.OpenCodeRuntime)({
exitCode: Effect.never,
};
}),
connectToOpenCodeServer: ({ serverUrl }) =>
Effect.succeed({
url: serverUrl ?? "http://127.0.0.1:4301",
exitCode: null,
external: Boolean(serverUrl),
}),
runOpenCodeCommand: () => Effect.succeed({ stdout: "", stderr: "", code: 0 }),
createOpenCodeSdkClient: ({ baseUrl, serverPassword }) =>
({
session: {
@@ -92,7 +99,15 @@ const OpenCodeRuntimeTestLayer = Layer.mock(OpenCodeRuntime.OpenCodeRuntime)({
},
},
}) as unknown as ReturnType<OpenCodeRuntime.OpenCodeRuntimeShape["createOpenCodeSdkClient"]>,
});
loadOpenCodeInventory: () =>
Effect.fail(
new OpenCodeRuntime.OpenCodeRuntimeError({
operation: "loadOpenCodeInventory",
detail: "OpenCodeRuntimeTestDouble.loadOpenCodeInventory not used in this test",
cause: null,
}),
),
};
const DEFAULT_TEST_MODEL_SELECTION = {
instanceId: ProviderInstanceId.make("opencode"),
@@ -108,7 +123,10 @@ const DEFAULT_COMMIT_MESSAGE_INPUT = {
const OPENCODE_TEXT_GENERATION_IDLE_TTL_MS = 30_000;
const OpenCodeTextGenerationTestLayer = OpenCodeRuntimeTestLayer.pipe(
const OpenCodeTextGenerationTestLayer = Layer.succeed(
OpenCodeRuntime.OpenCodeRuntime,
OpenCodeRuntimeTestDouble,
).pipe(
Layer.provideMerge(
ServerConfig.ServerConfig.layerTest(process.cwd(), {
prefix: "t3code-opencode-text-generation-test-",
@@ -118,7 +136,10 @@ const OpenCodeTextGenerationTestLayer = OpenCodeRuntimeTestLayer.pipe(
Layer.provideMerge(NodeServices.layer),
);
const OpenCodeTextGenerationExistingServerTestLayer = OpenCodeRuntimeTestLayer.pipe(
const OpenCodeTextGenerationExistingServerTestLayer = Layer.succeed(
OpenCodeRuntime.OpenCodeRuntime,
OpenCodeRuntimeTestDouble,
).pipe(
Layer.provideMerge(
ServerConfig.ServerConfig.layerTest(process.cwd(), {
prefix: "t3code-opencode-text-generation-existing-server-test-",
@@ -176,16 +197,16 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
modelSelection: DEFAULT_TEST_MODEL_SELECTION,
});
assert.deepStrictEqual(runtimeMock.state.startCalls, ["fake-opencode"]);
assert.deepStrictEqual(runtimeMock.state.promptUrls, [
expect(runtimeMock.state.startCalls).toEqual(["fake-opencode"]);
expect(runtimeMock.state.promptUrls).toEqual([
"http://127.0.0.1:4301",
"http://127.0.0.1:4301",
]);
assert.deepStrictEqual(runtimeMock.state.closeCalls, []);
expect(runtimeMock.state.closeCalls).toEqual([]);
yield* advanceIdleClock;
assert.deepStrictEqual(runtimeMock.state.closeCalls, ["http://127.0.0.1:4301"]);
expect(runtimeMock.state.closeCalls).toEqual(["http://127.0.0.1:4301"]);
}),
).pipe(Effect.provide(TestClock.layer())),
);
@@ -211,12 +232,12 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
modelSelection: DEFAULT_TEST_MODEL_SELECTION,
});
assert.deepStrictEqual(runtimeMock.state.startCalls, ["fake-opencode", "fake-opencode"]);
assert.deepStrictEqual(runtimeMock.state.promptUrls, [
expect(runtimeMock.state.startCalls).toEqual(["fake-opencode", "fake-opencode"]);
expect(runtimeMock.state.promptUrls).toEqual([
"http://127.0.0.1:4301",
"http://127.0.0.1:4302",
]);
assert.deepStrictEqual(runtimeMock.state.closeCalls, ["http://127.0.0.1:4301"]);
expect(runtimeMock.state.closeCalls).toEqual(["http://127.0.0.1:4301"]);
}),
).pipe(Effect.provide(TestClock.layer())),
);
@@ -231,13 +252,15 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
.pipe(Effect.flip);
assert.instanceOf(error, TextGenerationError);
assert.include(error.message, "OpenCode session.create request failed.");
const cause = error.cause;
assert.instanceOf(cause, OpenCodeTextGeneration.OpenCodeTextGenerationSessionRequestError);
assert.strictEqual(cause.operation, "generateCommitMessage");
assert.strictEqual(cause.cwd, process.cwd());
assert.strictEqual(cause.cause, sdkCause);
expect(error).toBeInstanceOf(TextGenerationError);
expect(error.message).toContain("OpenCode session.create request failed.");
expect(error.cause).toMatchObject({
_tag: "OpenCodeTextGenerationSessionRequestError",
operation: "generateCommitMessage",
cwd: process.cwd(),
cause: sdkCause,
});
expect((error.cause as { cause: unknown }).cause).toBe(sdkCause);
}),
),
);
@@ -251,12 +274,13 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
.pipe(Effect.flip);
assert.include(error.message, "OpenCode session.create returned no session payload.");
const cause = error.cause;
assert.instanceOf(cause, OpenCodeTextGeneration.OpenCodeTextGenerationSessionPayloadError);
assert.strictEqual(cause.operation, "generateCommitMessage");
assert.strictEqual(cause.cwd, process.cwd());
assert.notProperty(cause, "cause");
expect(error.message).toContain("OpenCode session.create returned no session payload.");
expect(error.cause).toMatchObject({
_tag: "OpenCodeTextGenerationSessionPayloadError",
operation: "generateCommitMessage",
cwd: process.cwd(),
});
expect(error.cause).not.toHaveProperty("cause");
}),
),
);
@@ -271,15 +295,17 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
.pipe(Effect.flip);
assert.include(error.message, "OpenCode session.prompt request failed.");
const cause = error.cause;
assert.instanceOf(cause, OpenCodeTextGeneration.OpenCodeTextGenerationPromptRequestError);
assert.strictEqual(cause.operation, "generateCommitMessage");
assert.strictEqual(cause.cwd, process.cwd());
assert.strictEqual(cause.sessionId, "http://127.0.0.1:4301/session");
assert.strictEqual(cause.providerId, "openai");
assert.strictEqual(cause.modelId, "gpt-5");
assert.strictEqual(cause.cause, sdkCause);
expect(error.message).toContain("OpenCode session.prompt request failed.");
expect(error.cause).toMatchObject({
_tag: "OpenCodeTextGenerationPromptRequestError",
operation: "generateCommitMessage",
cwd: process.cwd(),
sessionId: "http://127.0.0.1:4301/session",
providerId: "openai",
modelId: "gpt-5",
cause: sdkCause,
});
expect((error.cause as { cause: unknown }).cause).toBe(sdkCause);
}),
),
);
@@ -297,17 +323,18 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
.pipe(Effect.flip);
assert.include(error.message, "OpenCode returned empty output.");
const cause = error.cause;
assert.instanceOf(cause, OpenCodeTextGeneration.OpenCodeTextGenerationEmptyOutputError);
assert.strictEqual(cause.operation, "generateCommitMessage");
assert.strictEqual(cause.cwd, process.cwd());
assert.strictEqual(cause.sessionId, "http://127.0.0.1:4301/session");
assert.strictEqual(cause.providerId, "openai");
assert.strictEqual(cause.modelId, "gpt-5");
assert.strictEqual(cause.responsePartCount, 3);
assert.strictEqual(cause.textPartCount, 1);
assert.notProperty(cause, "cause");
expect(error.message).toContain("OpenCode returned empty output.");
expect(error.cause).toMatchObject({
_tag: "OpenCodeTextGenerationEmptyOutputError",
operation: "generateCommitMessage",
cwd: process.cwd(),
sessionId: "http://127.0.0.1:4301/session",
providerId: "openai",
modelId: "gpt-5",
responsePartCount: 3,
textPartCount: 1,
});
expect(error.cause).not.toHaveProperty("cause");
}),
),
);
@@ -334,7 +361,7 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
modelSelection: DEFAULT_TEST_MODEL_SELECTION,
});
assert.deepStrictEqual(result, {
expect(result).toEqual({
subject: "Tighten OpenCode parsing",
body: "Handle JSON text output locally.",
});
@@ -363,17 +390,18 @@ it.layer(OpenCodeTextGenerationTestLayer)("OpenCodeTextGeneration", (it) => {
.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
.pipe(Effect.flip);
assert.include(error.message, "Model did not produce structured output");
const cause = error.cause;
assert.instanceOf(cause, OpenCodeTextGeneration.OpenCodeTextGenerationPromptResponseError);
assert.strictEqual(cause.operation, "generateCommitMessage");
assert.strictEqual(cause.cwd, process.cwd());
assert.strictEqual(cause.sessionId, "http://127.0.0.1:4301/session");
assert.strictEqual(cause.providerId, "openai");
assert.strictEqual(cause.modelId, "gpt-5");
assert.strictEqual(cause.providerErrorName, "StructuredOutputError");
assert.strictEqual(cause.providerMessage, "Model did not produce structured output");
assert.notProperty(cause, "cause");
expect(error.message).toContain("Model did not produce structured output");
expect(error.cause).toMatchObject({
_tag: "OpenCodeTextGenerationPromptResponseError",
operation: "generateCommitMessage",
cwd: process.cwd(),
sessionId: "http://127.0.0.1:4301/session",
providerId: "openai",
modelId: "gpt-5",
providerErrorName: "StructuredOutputError",
providerMessage: "Model did not produce structured output",
});
expect(error.cause).not.toHaveProperty("cause");
}),
),
);
@@ -400,19 +428,19 @@ it.layer(OpenCodeTextGenerationExistingServerTestLayer)(
modelSelection: DEFAULT_TEST_MODEL_SELECTION,
});
assert.deepStrictEqual(runtimeMock.state.startCalls, []);
assert.deepStrictEqual(runtimeMock.state.promptUrls, [
expect(runtimeMock.state.startCalls).toEqual([]);
expect(runtimeMock.state.promptUrls).toEqual([
"http://127.0.0.1:9999",
"http://127.0.0.1:9999",
]);
assert.deepStrictEqual(runtimeMock.state.authHeaders, [
expect(runtimeMock.state.authHeaders).toEqual([
`Basic ${btoa("opencode:secret-password")}`,
`Basic ${btoa("opencode:secret-password")}`,
]);
yield* advanceIdleClock;
assert.deepStrictEqual(runtimeMock.state.closeCalls, []);
expect(runtimeMock.state.closeCalls).toEqual([]);
}),
).pipe(Effect.provide(TestClock.layer())),
);
@@ -389,21 +389,19 @@ export const makeOpenCodeTextGeneration = Effect.fn("makeOpenCodeTextGeneration"
? { serverPassword: openCodeSettings.serverPassword }
: {}),
});
const session = yield* OpenCodeRuntime.runOpenCodeSdk("session.create", () =>
client.session.create({
title: `T3 Code ${input.operation}`,
permission: [{ permission: "*", pattern: "*", action: "deny" }],
}),
).pipe(
Effect.mapError(
(cause) =>
new OpenCodeTextGenerationSessionRequestError({
operation: input.operation,
cwd: input.cwd,
cause: cause.cause,
}),
),
);
const session = yield* Effect.tryPromise({
try: () =>
client.session.create({
title: `T3 Code ${input.operation}`,
permission: [{ permission: "*", pattern: "*", action: "deny" }],
}),
catch: (cause) =>
new OpenCodeTextGenerationSessionRequestError({
operation: input.operation,
cwd: input.cwd,
cause,
}),
});
if (!session.data) {
return yield* new OpenCodeTextGenerationSessionPayloadError({
operation: input.operation,
@@ -420,23 +418,21 @@ export const makeOpenCodeTextGeneration = Effect.fn("makeOpenCodeTextGeneration"
modelId: parsedModel.modelID,
};
const result = yield* OpenCodeRuntime.runOpenCodeSdk("session.prompt", () =>
client.session.prompt({
sessionID: session.data.id,
model: parsedModel,
...(selectedAgent ? { agent: selectedAgent } : {}),
...(selectedVariant ? { variant: selectedVariant } : {}),
parts: [{ type: "text", text: input.prompt }, ...fileParts],
}),
).pipe(
Effect.mapError(
(cause) =>
new OpenCodeTextGenerationPromptRequestError({
...promptContext,
cause: cause.cause,
}),
),
);
const result = yield* Effect.tryPromise({
try: () =>
client.session.prompt({
sessionID: session.data.id,
model: parsedModel,
...(selectedAgent ? { agent: selectedAgent } : {}),
...(selectedVariant ? { variant: selectedVariant } : {}),
parts: [{ type: "text", text: input.prompt }, ...fileParts],
}),
catch: (cause) =>
new OpenCodeTextGenerationPromptRequestError({
...promptContext,
cause,
}),
});
const promptFailure = getOpenCodePromptFailure(result.data?.info?.error);
if (promptFailure) {
return yield* new OpenCodeTextGenerationPromptResponseError({
+7 -15
View File
@@ -3,12 +3,12 @@ import { useEffect, useState, type CSSProperties, type ReactNode } from "react";
import { useNavigate } from "@tanstack/react-router";
import { isElectron } from "../env";
import { resolveShortcutCommand, shortcutLabelForCommand } from "../keybindings";
import { resolveShortcutCommand } from "../keybindings";
import { isMacPlatform } from "../lib/utils";
import { primaryServerKeybindingsAtom } from "../state/server";
import ThreadSidebar from "./Sidebar";
import { Sidebar, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar } from "./ui/sidebar";
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
import { MainSidebarToggle } from "./SidebarToggle";
import { Sidebar, SidebarProvider, SidebarRail, useSidebar } from "./ui/sidebar";
const THREAD_SIDEBAR_WIDTH_STORAGE_KEY = "chat_thread_sidebar_width";
const THREAD_SIDEBAR_MIN_WIDTH = 13 * 16;
@@ -18,7 +18,6 @@ const MACOS_TRAFFIC_LIGHTS_LEFT_INSET = "90px";
function SidebarControl() {
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
const { toggleSidebar } = useSidebar();
const shortcutLabel = shortcutLabelForCommand(keybindings, "sidebar.toggle");
useEffect(() => {
const onKeyDown = (event: KeyboardEvent) => {
@@ -34,21 +33,14 @@ function SidebarControl() {
return () => window.removeEventListener("keydown", onKeyDown);
}, [keybindings, toggleSidebar]);
// Only visible while the sidebar is collapsed: when expanded, the toggle
// lives at the right edge of the sidebar header instead.
return (
<div
className="pointer-events-none fixed left-[var(--workspace-controls-left)] top-[var(--workspace-controls-top)] z-50 flex h-[var(--workspace-topbar-height)] items-center"
className="pointer-events-none fixed left-[var(--workspace-controls-left)] top-[var(--workspace-controls-top)] z-50 flex h-[var(--workspace-topbar-height)] items-center [[data-sidebar-state=expanded]_&]:hidden"
data-sidebar-control=""
>
<Tooltip>
<TooltipTrigger
render={
<SidebarTrigger className="pointer-events-auto" aria-label="Toggle main sidebar" />
}
/>
<TooltipPopup side="bottom">
Toggle main sidebar{shortcutLabel ? ` (${shortcutLabel})` : ""}
</TooltipPopup>
</Tooltip>
<MainSidebarToggle className="pointer-events-auto" />
</div>
);
}
+11 -9
View File
@@ -77,7 +77,7 @@ import { isElectron } from "../env";
import { APP_STAGE_LABEL } from "../branding";
import { useOpenPrLink } from "../lib/openPullRequestLink";
import { isTerminalFocused } from "../lib/terminalFocus";
import { isMacPlatform } from "../lib/utils";
import { cn, isMacPlatform } from "../lib/utils";
import {
readThreadShell,
useProject,
@@ -126,6 +126,7 @@ import {
import { stackedThreadToast, toastManager } from "./ui/toast";
import { formatRelativeTimeLabel } from "../timestampFormat";
import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";
import { MainSidebarToggle } from "./SidebarToggle";
import { Kbd } from "./ui/kbd";
import {
getArm64IntelBuildWarningDescription,
@@ -2744,15 +2745,16 @@ const SidebarChromeHeader = memo(function SidebarChromeHeader({
}: {
isElectron: boolean;
}) {
return isElectron ? (
<SidebarHeader className="@container/sidebar-header drag-region h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0">
<SidebarTrigger className="md:hidden" />
<SidebarBrand />
</SidebarHeader>
) : (
<SidebarHeader className="@container/sidebar-header h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0">
return (
<SidebarHeader
className={cn(
"@container/sidebar-header h-[var(--workspace-topbar-height)] shrink-0 flex-row items-center px-3 py-0 md:px-0",
isElectron && "drag-region",
)}
>
<SidebarTrigger className="md:hidden" />
<SidebarBrand />
<MainSidebarToggle className="ml-auto max-md:hidden md:mr-2 [[data-sidebar-state=collapsed]_&]:hidden" />
</SidebarHeader>
);
});
@@ -2763,7 +2765,7 @@ function SidebarBrand() {
return (
<Link
aria-label="Go to threads"
className="sidebar-brand ml-[var(--workspace-titlebar-content-left)] h-7 w-fit min-w-0 shrink-0 items-center gap-1 overflow-hidden rounded-md text-foreground outline-hidden ring-ring focus-visible:ring-2"
className="sidebar-brand ml-[var(--workspace-controls-left)] h-7 w-fit min-w-0 items-center gap-1 overflow-hidden rounded-md text-foreground outline-hidden ring-ring focus-visible:ring-2 max-md:ml-0"
to="/"
>
<T3Wordmark />
+21
View File
@@ -0,0 +1,21 @@
import { useAtomValue } from "@effect/atom-react";
import type { ComponentProps } from "react";
import { shortcutLabelForCommand } from "../keybindings";
import { primaryServerKeybindingsAtom } from "../state/server";
import { SidebarTrigger } from "./ui/sidebar";
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
export function MainSidebarToggle(props: ComponentProps<typeof SidebarTrigger>) {
const keybindings = useAtomValue(primaryServerKeybindingsAtom);
const shortcutLabel = shortcutLabelForCommand(keybindings, "sidebar.toggle");
return (
<Tooltip>
<TooltipTrigger render={<SidebarTrigger aria-label="Toggle main sidebar" {...props} />} />
<TooltipPopup side="bottom">
Toggle main sidebar{shortcutLabel ? ` (${shortcutLabel})` : ""}
</TooltipPopup>
</Tooltip>
);
}
@@ -0,0 +1,13 @@
import { describe, expect, it } from "vite-plus/test";
import { getPreviewPanelMaxWidth } from "./PreviewPanelShell";
describe("getPreviewPanelMaxWidth", () => {
it("allows the panel to use 70% of an ultra-wide viewport without a pixel ceiling", () => {
expect(getPreviewPanelMaxWidth(6_000)).toBe(4_200);
});
it("rounds fractional CSS pixels down", () => {
expect(getPreviewPanelMaxWidth(2_001)).toBe(1_400);
});
});
@@ -10,12 +10,14 @@ export type PreviewPanelMode = "inline" | "sheet" | "sidebar" | "embedded";
const PREVIEW_PANEL_WIDTH_STORAGE_KEY = "t3code:preview-panel-width";
const PREVIEW_PANEL_MIN_WIDTH = 360;
/** Hard ceiling so a wide monitor can't yield a panel that swallows the chat. */
const PREVIEW_PANEL_MAX_WIDTH_PX = 1400;
/** Fraction of the viewport allowed; the panel is min(this · vw, MAX_PX). */
/** Fraction of the viewport allowed, preserving the remaining space for chat. */
const PREVIEW_PANEL_MAX_WIDTH_FRACTION = 0.7;
const PREVIEW_PANEL_DEFAULT_WIDTH = 540;
export function getPreviewPanelMaxWidth(viewportWidth: number): number {
return Math.floor(viewportWidth * PREVIEW_PANEL_MAX_WIDTH_FRACTION);
}
/**
* Shell for the preview panel. In inline mode the panel is user-resizable
* via a drag handle on the left edge; width persists per browser. In
@@ -82,5 +84,5 @@ function useViewportClampedMaxWidth(): number {
if (frame !== 0) window.cancelAnimationFrame(frame);
};
}, []);
return Math.min(PREVIEW_PANEL_MAX_WIDTH_PX, Math.floor(vw * PREVIEW_PANEL_MAX_WIDTH_FRACTION));
return getPreviewPanelMaxWidth(vw);
}
+50
View File
@@ -0,0 +1,50 @@
# Brand icons
The three Icon Composer projects are the source of truth for full application icons:
- `dev/app-icon.icon`
- `nightly/app-icon.icon`
- `prod/app-icon.icon`
Each project uses `text.svg` for the T3 mark and `background.svg` when the background is a vector layer. Additional layers use semantic names that describe their role and placement.
Run `vp run icons:export` from the repository root to regenerate the tracked iOS, Linux, Windows, and web assets. Run `vp run icons:check` to verify that those generated assets match their sources without changing files.
Exporting requires Icon Composer 2 or newer on macOS. The script selects the newest compatible exporter from Xcode or a standalone Icon Composer installation and pins design generation 26. Set `ICON_COMPOSER_TOOL` to the full path of `Icon Composer.app/Contents/Executables/ictool` to override automatic discovery.
## macOS exports
Icon Composer's command-line exporter does not expose the `macOS pre-Tahoe` preset. A plain command-line `macOS` export is full bleed and is not suitable for the desktop app, so the export script intentionally leaves the tracked macOS PNGs unchanged and prints a reminder after every run.
After changing an Icon Composer project, open it in Icon Composer and export the macOS PNG with exactly these settings:
- Platform: `macOS pre-Tahoe`
- Appearance: `Default`
- Size: `1024pt`
- Scale: `1×`
Save the three exports to:
- `dev/app-icon.icon` -> `dev/blueprint-macos-1024.png`
- `nightly/app-icon.icon` -> `nightly/nightly-macos-1024.png`
- `prod/app-icon.icon` -> `prod/black-macos-1024.png`
The result must be a 1024×1024 PNG with the classic macOS safe area: the opaque icon body is 824×824, inset 100 pixels on every side, with only the native Icon Composer shadow extending into the surrounding transparent canvas.
To have Codex perform the native exports, paste this prompt into a task opened at the repository root:
```text
Use [@Computer](plugin://computer-use@openai-bundled) and the Icon Composer app to export the three macOS app icons in this repository.
For each project below, use Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, and Scale: 1×, then save the PNG to the exact destination:
- assets/dev/app-icon.icon -> assets/dev/blueprint-macos-1024.png
- assets/nightly/app-icon.icon -> assets/nightly/nightly-macos-1024.png
- assets/prod/app-icon.icon -> assets/prod/black-macos-1024.png
Do not resize, composite, or otherwise post-process the exported PNGs.
Verify every result is 1024×1024 and has the classic macOS safe area: an 824×824 opaque body inset 100px on every side, with only Icon Composer's native shadow extending beyond it.
```
Do not edit the generated PNG or ICO files directly.
@@ -0,0 +1,37 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="arrowStart" markerWidth="5" markerHeight="5" refX="1.2" refY="2.5" orient="auto" markerUnits="strokeWidth">
<path d="M4.5 0.6L1 2.5L4.5 4.4" fill="none" stroke="#DDF7FF" stroke-width="0.8" stroke-linecap="round"/>
</marker>
<marker id="arrowEnd" markerWidth="5" markerHeight="5" refX="3.8" refY="2.5" orient="auto" markerUnits="strokeWidth">
<path d="M0.5 0.6L4 2.5L0.5 4.4" fill="none" stroke="#DDF7FF" stroke-width="0.8" stroke-linecap="round"/>
</marker>
</defs>
<g stroke="#DDF7FF" stroke-linecap="round" stroke-linejoin="round">
<g opacity="0.9" stroke-width="0.44">
<path d="M15.5309 31V25.6M64.3309 31V25.6M68.1653 31V25.6M107.365 31V25.6"/>
<path d="M16.9 27.2H62.96" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
<path d="M69.54 27.2H105.99" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
<path d="M33.4509 97.3V103M46.4109 97.3V103M65.3653 97.3V103M109.925 97.3V103"/>
<path d="M34.82 101.1H45.04" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
<path d="M66.74 101.1H108.55" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
<path d="M10.2 37H6.1M10.2 47.6H6.1M10.2 93H6.1"/>
<path d="M7.9 38.4V46.2" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
<path d="M7.9 49V91.6" marker-start="url(#arrowStart)" marker-end="url(#arrowEnd)"/>
</g>
<g opacity="0.58" stroke-width="0.34">
<path d="M12.5 35.1H66.8M39.9309 94.8V44.5M64.3309 34.2V49.9M68.1653 34.2V49.9" stroke-dasharray="1.6 1.6"/>
<path d="M65.3653 65.2H109.925M87.2 32.7V98.2" stroke-dasharray="1.2 2"/>
<circle cx="87.2" cy="65.2" r="20.8"/>
<circle cx="87.2" cy="65.2" r="1.1"/>
</g>
<g opacity="0.76" stroke-width="0.4">
<path d="M24 20V24M22 22H26M101 17V21M99 19H103M114 106V110M112 108H116"/>
<path d="M54 107L57 110M57 107L54 110M16 74L19 77M19 74L16 77"/>
<path d="M74 22H82M78 18V26" stroke-dasharray="0.7 1.1"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@@ -0,0 +1,51 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="paper" x1="36" y1="0" x2="92" y2="128" gradientUnits="userSpaceOnUse">
<stop stop-color="#67C2FF"/>
<stop offset="0.44" stop-color="#347FF8"/>
<stop offset="1" stop-color="#1538D0"/>
</linearGradient>
<radialGradient id="cyanGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(92 22) rotate(137) scale(78 70)">
<stop stop-color="#D4F6FF" stop-opacity="0.62"/>
<stop offset="0.52" stop-color="#65C8FF" stop-opacity="0.24"/>
<stop offset="1" stop-color="#276AF1" stop-opacity="0"/>
</radialGradient>
<radialGradient id="edgeShade" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(64 58) rotate(90) scale(77)">
<stop offset="0.68" stop-color="#102EBC" stop-opacity="0"/>
<stop offset="1" stop-color="#061A88" stop-opacity="0.48"/>
</radialGradient>
<pattern id="minorGrid" width="4" height="4" patternUnits="userSpaceOnUse">
<path d="M4 0H0V4" stroke="#D9F7FF" stroke-width="0.18" opacity="0.38"/>
</pattern>
<pattern id="majorGrid" width="16" height="16" patternUnits="userSpaceOnUse">
<rect width="16" height="16" fill="url(#minorGrid)"/>
<path d="M16 0H0V16" stroke="#F0FCFF" stroke-width="0.34" opacity="0.52"/>
</pattern>
<clipPath id="frame">
<rect width="128" height="128" rx="10"/>
</clipPath>
</defs>
<g clip-path="url(#frame)">
<rect width="128" height="128" fill="url(#paper)"/>
<rect width="128" height="128" fill="url(#cyanGlow)"/>
<rect x="4" y="4" width="120" height="120" fill="url(#majorGrid)" opacity="0.96"/>
<path d="M64 4V124M4 64H124" stroke="#F0FCFF" stroke-width="0.3" opacity="0.46"/>
<rect x="5.75" y="5.75" width="116.5" height="116.5" rx="5.5" stroke="#F1FCFF" stroke-width="0.5" opacity="0.66"/>
<g stroke="#BFE9F7" stroke-linecap="round" opacity="0.2">
<path d="M14 19L24 12M17 22L29 13" stroke-width="0.5"/>
<path d="M106 25L115 18M104 30L118 20" stroke-width="0.38"/>
<path d="M11 108L23 101M16 113L28 105" stroke-width="0.42"/>
<path d="M102 113L116 104M107 116L120 108" stroke-width="0.46"/>
</g>
<g fill="#D7F4FF" opacity="0.22">
<circle cx="18" cy="30" r="0.45"/>
<circle cx="112" cy="38" r="0.35"/>
<circle cx="22" cy="98" r="0.3"/>
<circle cx="109" cy="94" r="0.5"/>
<circle cx="94" cy="14" r="0.32"/>
</g>
<rect width="128" height="128" fill="url(#edgeShade)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 890 B

@@ -6,35 +6,40 @@
{
"layers": [
{
"hidden": false,
"image-name": "gpt-image-1.5-jd70szmrd03p36z4zv48ycsbax81egvr.png",
"name": "gpt-image-1.5-jd70szmrd03p36z4zv48ycsbax81egvr",
"glass": true,
"image-name": "text.svg",
"name": "Text",
"position": {
"scale": 1.1,
"scale": 8.5,
"translation-in-points": [0, 0]
}
},
{
"image-name": "T3.svg",
"name": "T3",
"glass": false,
"image-name": "annotations.svg",
"name": "Annotations",
"position": {
"scale": 10,
"scale": 8.5,
"translation-in-points": [0, 0]
}
},
{
"hidden": true,
"image-name": "Texturelabs_Paper_381XL.jpg",
"name": "Texturelabs_Paper_381XL"
"glass": true,
"image-name": "background.svg",
"name": "Background",
"position": {
"scale": 8.1,
"translation-in-points": [0, 0]
}
}
],
"shadow": {
"kind": "neutral",
"opacity": 0.5
"opacity": 0.6
},
"translucency": {
"enabled": true,
"value": 0.5
"value": 0.2
}
}
],
@@ -1,3 +0,0 @@
<svg width="77" height="47" viewBox="0 0 77 47" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.56 45.5V8.58H1.69082e-06V-3.09944e-06H39.65V8.58H25.09V45.5H14.56ZM57.8454 46.28C54.6821 46.28 51.5404 45.8683 48.4204 45.045C45.3004 44.1783 42.6571 42.965 40.4904 41.405L44.5854 33.345C46.3188 34.6017 48.3338 35.5983 50.6304 36.335C52.9271 37.0717 55.2454 37.44 57.5854 37.44C60.2288 37.44 62.3088 36.92 63.8254 35.88C65.3421 34.84 66.1004 33.41 66.1004 31.59C66.1004 29.8567 65.4288 28.4917 64.0854 27.495C62.7421 26.4983 60.5754 26 57.5854 26H52.7754V19.045L65.4504 4.68L66.6204 8.45H42.7654V-3.09944e-06H74.6154V6.825L62.0054 21.19L56.6754 18.135H59.7304C65.3204 18.135 69.5454 19.3917 72.4054 21.905C75.2654 24.4183 76.6954 27.6467 76.6954 31.59C76.6954 34.1467 76.0238 36.5517 74.6804 38.805C73.3371 41.015 71.2788 42.8133 68.5054 44.2C65.7321 45.5867 62.1788 46.28 57.8454 46.28Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

@@ -1,47 +0,0 @@
{
"fill": {
"solid": "display-p3:0.00000,0.00000,0.00000,1.00000"
},
"groups": [
{
"layers": [
{
"blend-mode": "normal",
"fill": "automatic",
"glass": true,
"hidden": false,
"image-name": "gpt-image-1.5-kn76n9hynne5q3qxy3g91chp2d84t871.png",
"name": "gpt-image-1.5-kn76n9hynne5q3qxy3g91chp2d84t871",
"position": {
"scale": 1.05,
"translation-in-points": [0, 0]
}
},
{
"image-name": "T3.svg",
"name": "T3",
"position": {
"scale": 10,
"translation-in-points": [0, 0]
}
},
{
"hidden": false,
"image-name": "Texturelabs_Paper_381XL.jpg",
"name": "Texturelabs_Paper_381XL"
}
],
"shadow": {
"kind": "neutral",
"opacity": 0.5
},
"translucency": {
"enabled": true,
"value": 0.5
}
}
],
"supported-platforms": {
"squares": ["iOS", "macOS"]
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 277 KiB

@@ -0,0 +1,43 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="night" x1="12" y1="6" x2="116" y2="124" gradientUnits="userSpaceOnUse">
<stop stop-color="#07152F"/>
<stop offset="0.5" stop-color="#151443"/>
<stop offset="1" stop-color="#32155B"/>
</linearGradient>
<radialGradient id="skyGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(90 28) rotate(137) scale(78 70)">
<stop stop-color="#5165D8" stop-opacity="0.4"/>
<stop offset="0.5" stop-color="#283075" stop-opacity="0.16"/>
<stop offset="1" stop-color="#111635" stop-opacity="0"/>
</radialGradient>
<radialGradient id="horizonGlow" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(42 127) rotate(-70) scale(68 96)">
<stop stop-color="#6646B6" stop-opacity="0.34"/>
<stop offset="1" stop-color="#352066" stop-opacity="0"/>
</radialGradient>
<clipPath id="frame">
<rect width="128" height="128" rx="10"/>
</clipPath>
</defs>
<g clip-path="url(#frame)">
<rect width="128" height="128" fill="url(#night)"/>
<rect width="128" height="128" fill="url(#skyGlow)"/>
<rect width="128" height="128" fill="url(#horizonGlow)"/>
<!-- A few tiny stars kept to the perimeter so the wordmark stays clear. -->
<g fill="#E4EAFF">
<circle cx="17" cy="18" r="0.55" fill-opacity="0.82"/>
<circle cx="54" cy="14" r="0.4" fill-opacity="0.65"/>
<circle cx="116" cy="42" r="0.45" fill-opacity="0.72"/>
<circle cx="10" cy="70" r="0.35" fill-opacity="0.56"/>
<circle cx="117" cy="88" r="0.4" fill-opacity="0.6"/>
</g>
<path d="M31 22V24.8M29.6 23.4H32.4" stroke="#EEF2FF" stroke-width="0.5" stroke-linecap="round" opacity="0.72"/>
<path d="M111 58V60M110 59H112" stroke="#CBD8FF" stroke-width="0.45" stroke-linecap="round" opacity="0.58"/>
<!-- Broad horizon remains below the T3 baseline (y=94). -->
<path d="M-12 119C14 99 39 99 63 110C87 121 110 116 140 96V140H-12V119Z" fill="#20184E" fill-opacity="0.42"/>
<path d="M-12 129C15 111 42 112 66 122C91 132 114 124 140 107V140H-12V129Z" fill="#6946B8" fill-opacity="0.22"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,21 @@
<svg width="64" height="32" viewBox="0 0 64 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="cloud" x1="7" y1="10" x2="57" y2="25" gradientUnits="userSpaceOnUse">
<stop stop-color="#4EA4FF" stop-opacity="0.62"/>
<stop offset="0.52" stop-color="#696FEA" stop-opacity="0.72"/>
<stop offset="1" stop-color="#A85BEA" stop-opacity="0.58"/>
</linearGradient>
<radialGradient id="highlight" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(30 14) rotate(13) scale(27 10)">
<stop stop-color="#C8D7FF" stop-opacity="0.4"/>
<stop offset="1" stop-color="#8C8EF2" stop-opacity="0"/>
</radialGradient>
<filter id="soft" x="-8" y="-8" width="80" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="2.5"/>
</filter>
</defs>
<g filter="url(#soft)">
<path d="M7 23.5C7 18.9 10.8 15.2 15.5 15.2C16.9 10.7 21.1 7.5 26.1 7.5C31 7.5 35.2 10.5 36.7 14.8C38.5 13.2 40.9 12.2 43.5 12.2C49.1 12.2 53.7 16.4 54.1 21.8C57 22.2 59.2 24 60 26.5H8.2C7.4 25.7 7 24.7 7 23.5Z" fill="url(#cloud)"/>
<path d="M11 22.9C12.7 19.8 16 18 19.5 18.5C21 13.4 25.6 10 30.8 10.6C35 11 38.3 13.9 39.4 17.7C43.8 15.5 49 17.3 51.1 21.7C46.2 20.3 41.9 21 37.7 22.1C29.6 24.2 21.5 21.3 11 22.9Z" fill="url(#highlight)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,21 @@
<svg width="64" height="32" viewBox="0 0 64 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="cloud" x1="7" y1="10" x2="57" y2="25" gradientUnits="userSpaceOnUse">
<stop stop-color="#4EA4FF" stop-opacity="0.62"/>
<stop offset="0.52" stop-color="#696FEA" stop-opacity="0.72"/>
<stop offset="1" stop-color="#A85BEA" stop-opacity="0.58"/>
</linearGradient>
<radialGradient id="highlight" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(30 14) rotate(13) scale(27 10)">
<stop stop-color="#C8D7FF" stop-opacity="0.4"/>
<stop offset="1" stop-color="#8C8EF2" stop-opacity="0"/>
</radialGradient>
<filter id="soft" x="-8" y="-8" width="80" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="2.5"/>
</filter>
</defs>
<g transform="translate(64 0) scale(-1 1)" filter="url(#soft)">
<path d="M7 23.5C7 18.9 10.8 15.2 15.5 15.2C16.9 10.7 21.1 7.5 26.1 7.5C31 7.5 35.2 10.5 36.7 14.8C38.5 13.2 40.9 12.2 43.5 12.2C49.1 12.2 53.7 16.4 54.1 21.8C57 22.2 59.2 24 60 26.5H8.2C7.4 25.7 7 24.7 7 23.5Z" fill="url(#cloud)"/>
<path d="M11 22.9C12.7 19.8 16 18 19.5 18.5C21 13.4 25.6 10 30.8 10.6C35 11 38.3 13.9 39.4 17.7C43.8 15.5 49 17.3 51.1 21.7C46.2 20.3 41.9 21 37.7 22.1C29.6 24.2 21.5 21.3 11 22.9Z" fill="url(#highlight)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,3 @@
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 890 B

+94
View File
@@ -0,0 +1,94 @@
{
"fill": {
"automatic-gradient": "display-p3:0.00000,0.00000,0.00000,1.00000"
},
"groups": [
{
"layers": [
{
"glass": true,
"image-name": "text.svg",
"name": "Text",
"position": {
"scale": 8.5,
"translation-in-points": [0, 0]
}
},
{
"glass": false,
"image-name": "cloud-upper-right.svg",
"name": "Cloud Upper Right",
"opacity": 1,
"position": {
"scale": 15,
"translation-in-points": [387.9605131881942, -134.30064713259117]
}
},
{
"glass": false,
"image-name": "cloud-lower-left.svg",
"name": "Cloud Lower Left",
"position": {
"scale": 25,
"translation-in-points": [-309.63750000000005, 268.66077693836917]
}
},
{
"glass": true,
"hidden": false,
"image-name": "background.svg",
"name": "Background",
"position": {
"scale": 8.1,
"translation-in-points": [0, -2.171875]
}
}
],
"shadow": {
"kind": "neutral",
"opacity": 0.6
},
"translucency": {
"enabled": true,
"value": 0.2
}
},
{
"layers": [],
"shadow": {
"kind": "neutral",
"opacity": 0.6
},
"translucency": {
"enabled": true,
"value": 0.2
}
},
{
"layers": [],
"shadow": {
"kind": "neutral",
"opacity": 0.6
},
"translucency": {
"enabled": true,
"value": 0.2
}
},
{
"layers": [],
"shadow": {
"kind": "neutral",
"opacity": 0.6
},
"translucency": {
"enabled": true,
"value": 0.2
}
}
],
"supported-platforms": {
"circles": ["watchOS"],
"squares": "shared"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 920 B

@@ -6,8 +6,8 @@
{
"layers": [
{
"image-name": "T3.svg",
"name": "T3",
"image-name": "text.svg",
"name": "Text",
"position": {
"scale": 10,
"translation-in-points": [0, 0]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 987 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 78 KiB

+18 -18
View File
@@ -1,29 +1,29 @@
# Scripts
- `bun run dev` — Starts contracts, server, and web in `turbo watch` mode.
- `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.
- Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state.
- `vp run dev` — Starts contracts, server, and web in watch mode.
- `vp run dev:server` — Starts just the WebSocket server. The server process runs on Bun (`@effect/platform-bun` + `BunPtyAdapter`), but task running uses `vp run`.
- `vp run dev:web` — Starts just the Vite dev server for the web app.
- Dev commands default `T3CODE_HOME` to `~/.t3` — the same shared home the desktop/production app uses. Override with `--home-dir` (see below) to keep dev state separate.
- Override server CLI-equivalent flags from root dev commands with `--`, for example:
`bun run dev -- --base-dir ~/.t3-2`
- `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 typecheck` — Strict TypeScript checks for all packages.
- `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:dmg` — Builds a shareable macOS `.dmg` into `./release`.
- `bun run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
- `bun run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
- `bun run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
`vp run dev -- --home-dir ~/.t3-2`
- `vp run start` — Runs the production server (serves built web app as static files).
- `vp run build` — Builds contracts, web app, and server.
- `vp run typecheck` — Strict TypeScript checks for all packages.
- `vp run test` — Runs workspace tests.
- `vp run dist:desktop:artifact -- --platform <mac|linux|win> --target <target> --arch <arch>` — Builds a desktop artifact for a specific platform/target/arch.
- `vp run dist:desktop:dmg` — Builds a shareable macOS `.dmg` into `./release`.
- `vp run dist:desktop:dmg:x64` — Builds an Intel macOS `.dmg`.
- `vp run dist:desktop:linux` — Builds a Linux AppImage into `./release`.
- `vp run dist:desktop:win` — Builds a Windows NSIS installer into `./release`.
## Desktop `.dmg` packaging notes
- Default build is unsigned/not notarized for local sharing.
- The DMG build uses `assets/macos-icon-1024.png` as the production app icon source.
- The DMG build uses `assets/prod/black-macos-1024.png` as the production app icon source.
- Desktop production windows load the bundled UI from `t3code://app/index.html` (not a `127.0.0.1` document URL).
- Desktop packaging includes `apps/server/dist` (the `t3` backend) and starts it on loopback with an auth token for WebSocket/API traffic.
- Your tester can still open it on macOS by right-clicking the app and choosing **Open** on first launch.
- To keep staging files for debugging package contents, run: `bun run dist:desktop:dmg -- --keep-stage`
- To keep staging files for debugging package contents, run: `vp run dist:desktop:dmg -- --keep-stage`
- To allow code-signing/notarization when configured in CI/secrets, add: `--signed`.
- Signed macOS builds also require `T3CODE_APPLE_TEAM_ID` and
`T3CODE_MACOS_PROVISIONING_PROFILE`. The passkey RP domain is derived from
@@ -38,8 +38,8 @@
Set `T3CODE_DEV_INSTANCE` to any value to deterministically shift all dev ports together.
- Default ports: server `3773`, web `5733`
- Default ports: server `13773`, web `5733`
- Shifted ports: `base + offset` (offset is hashed from `T3CODE_DEV_INSTANCE`)
- Example: `T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop`
- Example: `T3CODE_DEV_INSTANCE=branch-a vp run dev:desktop`
If you want full control instead of hashing, set `T3CODE_PORT_OFFSET` to a numeric offset.
+2
View File
@@ -14,6 +14,8 @@
"start:marketing": "vp run --filter @t3tools/marketing preview",
"start:mock-update-server": "node scripts/mock-update-server.ts",
"screenshots:mobile": "node scripts/mobile-showcase.ts",
"icons:export": "node scripts/export-brand-icons.ts",
"icons:check": "node scripts/export-brand-icons.ts --check",
"build": "vp run --filter './apps/*' --filter './packages/*' --filter './oxlint-plugin-t3code' --filter './scripts' build",
"build:marketing": "vp run --filter @t3tools/marketing build",
"build:desktop": "vp run --filter @t3tools/desktop --filter t3 build",
+2 -2
View File
@@ -252,11 +252,11 @@ export const CursorSettings = makeProviderSettingsSchema(
Schema.withDecodingDefault(Effect.succeed(false)),
Schema.annotateKey({ providerSettingsForm: { hidden: true } }),
),
binaryPath: makeBinaryPathSetting("agent").pipe(
binaryPath: makeBinaryPathSetting("cursor-agent").pipe(
Schema.annotateKey({
title: "Binary path",
description: "Path to the Cursor agent binary.",
providerSettingsForm: { placeholder: "agent", clearWhenEmpty: "omit" },
providerSettingsForm: { placeholder: "cursor-agent", clearWhenEmpty: "omit" },
}),
),
apiEndpoint: TrimmedString.pipe(
+64
View File
@@ -59,6 +59,70 @@ describe("remote", () => {
});
});
it("treats a protocol-relative host as https", () => {
expect(
resolveRemotePairingTarget({
host: "//remote.example.com",
pairingCode: "pairing-token",
}),
).toEqual({
credential: "pairing-token",
httpBaseUrl: "https://remote.example.com/",
wsBaseUrl: "wss://remote.example.com/",
});
});
it("preserves the port when normalizing a protocol-relative host", () => {
expect(
resolveRemotePairingTarget({
host: "//remote.example.com:3000",
pairingCode: "pairing-token",
}),
).toEqual({
credential: "pairing-token",
httpBaseUrl: "https://remote.example.com:3000/",
wsBaseUrl: "wss://remote.example.com:3000/",
});
});
it("normalizes a protocol-relative host from a hosted pairing link", () => {
expect(
resolveRemotePairingTarget({
pairingUrl: "https://app.t3.codes/pair?host=%2F%2Fremote.example.com#token=pairing-token",
}),
).toEqual({
credential: "pairing-token",
httpBaseUrl: "https://remote.example.com/",
wsBaseUrl: "wss://remote.example.com/",
});
});
it("collapses extra leading slashes instead of producing an empty host", () => {
expect(
resolveRemotePairingTarget({
host: "///example.com",
pairingCode: "pairing-token",
}),
).toEqual({
credential: "pairing-token",
httpBaseUrl: "https://example.com/",
wsBaseUrl: "wss://example.com/",
});
});
it("does not double-prepend https when the host already carries a scheme", () => {
expect(
resolveRemotePairingTarget({
host: "//https://example.com",
pairingCode: "pairing-token",
}),
).toEqual({
credential: "pairing-token",
httpBaseUrl: "https://example.com/",
wsBaseUrl: "wss://example.com/",
});
});
it("preserves host ports when normalizing a bare host input", () => {
expect(
resolveRemotePairingTarget({
+4 -4
View File
@@ -81,10 +81,10 @@ const normalizeRemoteBaseUrl = (
throw new RemoteBackendUrlMissingError();
}
const normalizedInput =
/^[a-zA-Z][a-zA-Z\d+-]*:\/\//.test(trimmed) || trimmed.startsWith("//")
? trimmed
: `https://${trimmed}`;
const withoutLeadingSlashes = trimmed.replace(/^\/+/, "");
const normalizedInput = /^[a-zA-Z][a-zA-Z\d+-]*:\/\//.test(withoutLeadingSlashes)
? withoutLeadingSlashes
: `https://${withoutLeadingSlashes}`;
let url: URL;
try {
url = new URL(normalizedInput);
+800
View File
@@ -0,0 +1,800 @@
#!/usr/bin/env node
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
import * as NodeServices from "@effect/platform-node/NodeServices";
import { HostProcessEnvironment } from "@t3tools/shared/hostProcess";
import * as Console from "effect/Console";
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
import * as Option from "effect/Option";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
import { Command, Flag } from "effect/unstable/cli";
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import { BRAND_ASSET_PATHS } from "./lib/brand-assets.ts";
import { encodePngIco, readPngDimensions, WINDOWS_ICON_SIZES } from "./lib/icon-export.ts";
const DESIGN_GENERATION = 26;
const ICON_COMPOSER_EXECUTABLE_PARTS = [
"Contents",
"Applications",
"Icon Composer.app",
"Contents",
"Executables",
"ictool",
] as const;
const STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS = [
"Icon Composer.app",
"Contents",
"Executables",
"ictool",
] as const;
const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
const IconComposerVersion = Schema.Struct({
"bundle-version": Schema.NonEmptyString,
"short-bundle-version": Schema.NonEmptyString,
});
const decodeIconComposerVersion = Schema.decodeUnknownEffect(
Schema.fromJsonString(IconComposerVersion),
);
type IconPlatform = "iOS";
interface VariantOutputs {
readonly ios: string;
readonly macos: string;
readonly universal: string;
readonly appleTouch: string;
readonly favicon16: string;
readonly favicon32: string;
readonly faviconIco: string;
readonly windowsIco: string;
}
interface IconVariant {
readonly label: string;
readonly source: string;
readonly outputs: VariantOutputs;
}
interface IconComposerTool {
readonly path: string;
readonly version: string;
readonly bundleVersion: string;
readonly supportsDesignGeneration: boolean;
}
interface CommandResult {
readonly stdout: string;
readonly stderr: string;
readonly exitCode: number;
}
export class IconExportFileSystemError extends Schema.TaggedErrorClass<IconExportFileSystemError>()(
"IconExportFileSystemError",
{
operation: Schema.Literals([
"resolve-repository-root",
"check-path",
"read-directory",
"read-file",
"make-directory",
"make-temp-directory",
"make-temp-file",
"write-file",
"rename-file",
]),
path: Schema.String,
cause: Schema.Defect(),
},
) {
override get message(): string {
return `Icon export file-system operation '${this.operation}' failed for ${this.path}.`;
}
}
export class IconExportProcessError extends Schema.TaggedErrorClass<IconExportProcessError>()(
"IconExportProcessError",
{
operation: Schema.Literals(["spawn", "collect-stdout", "collect-stderr", "wait-for-exit"]),
command: Schema.String,
argumentCount: NonNegativeInt,
cause: Schema.Defect(),
},
) {
override get message(): string {
return `Icon export process operation '${this.operation}' failed for ${this.command}.`;
}
}
export class IconExportCommandFailedError extends Schema.TaggedErrorClass<IconExportCommandFailedError>()(
"IconExportCommandFailedError",
{
command: Schema.String,
argumentCount: NonNegativeInt,
exitCode: Schema.Int,
sourcePath: Schema.String,
size: Schema.Int,
stdout: Schema.optional(Schema.String),
stderr: Schema.optional(Schema.String),
},
) {
override get message(): string {
return `Icon Composer failed to export ${this.sourcePath} at ${this.size}x${this.size}.`;
}
}
export class IconExportToolResolutionError extends Schema.TaggedErrorClass<IconExportToolResolutionError>()(
"IconExportToolResolutionError",
{
reason: Schema.Literals(["configured-invalid", "configured-outdated", "not-found"]),
designGeneration: Schema.Int,
toolPath: Schema.optional(Schema.String),
version: Schema.optional(Schema.String),
},
) {
override get message(): string {
switch (this.reason) {
case "configured-invalid":
return `ICON_COMPOSER_TOOL does not point to Icon Composer's export-capable ictool: ${this.toolPath}`;
case "configured-outdated":
return `ICON_COMPOSER_TOOL points to Icon Composer ${this.version}, but version 2 or newer is required for design generation ${this.designGeneration}.`;
case "not-found":
return `Could not find an Icon Composer 2.x exporter compatible with design generation ${this.designGeneration}. Install a compatible Icon Composer/Xcode or set ICON_COMPOSER_TOOL to Icon Composer.app/Contents/Executables/ictool.`;
}
}
}
export class IconExportSourceMissingError extends Schema.TaggedErrorClass<IconExportSourceMissingError>()(
"IconExportSourceMissingError",
{
sourcePath: Schema.String,
},
) {
override get message(): string {
return `Missing Icon Composer source project: ${this.sourcePath}`;
}
}
export class IconExportRenditionError extends Schema.TaggedErrorClass<IconExportRenditionError>()(
"IconExportRenditionError",
{
sourcePath: Schema.String,
outputPath: Schema.String,
expectedSize: Schema.Int,
actualWidth: Schema.optional(Schema.Int),
actualHeight: Schema.optional(Schema.Int),
cause: Schema.optional(Schema.Defect()),
},
) {
override get message(): string {
const actual =
this.actualWidth === undefined || this.actualHeight === undefined
? "an invalid PNG"
: `${this.actualWidth}x${this.actualHeight}`;
return `Icon Composer produced ${actual}; expected ${this.expectedSize}x${this.expectedSize} for ${this.sourcePath}.`;
}
}
export class IconExportEncodingError extends Schema.TaggedErrorClass<IconExportEncodingError>()(
"IconExportEncodingError",
{
variant: Schema.String,
cause: Schema.Defect(),
},
) {
override get message(): string {
return `Failed to encode ICO renditions for the ${this.variant} icon.`;
}
}
export class IconExportAssetsStaleError extends Schema.TaggedErrorClass<IconExportAssetsStaleError>()(
"IconExportAssetsStaleError",
{
paths: Schema.Array(Schema.String),
},
) {
override get message(): string {
return `Generated icon assets are stale:\n${this.paths.map((path) => `- ${path}`).join("\n")}`;
}
}
const ICON_VARIANTS = [
{
label: "development",
source: BRAND_ASSET_PATHS.developmentIconComposerProject,
outputs: {
ios: BRAND_ASSET_PATHS.developmentIosIconPng,
macos: BRAND_ASSET_PATHS.developmentDesktopIconPng,
universal: BRAND_ASSET_PATHS.developmentUniversalIconPng,
appleTouch: BRAND_ASSET_PATHS.developmentWebAppleTouchIconPng,
favicon16: BRAND_ASSET_PATHS.developmentWebFavicon16Png,
favicon32: BRAND_ASSET_PATHS.developmentWebFavicon32Png,
faviconIco: BRAND_ASSET_PATHS.developmentWebFaviconIco,
windowsIco: BRAND_ASSET_PATHS.developmentWindowsIconIco,
},
},
{
label: "preview",
source: BRAND_ASSET_PATHS.nightlyIconComposerProject,
outputs: {
ios: BRAND_ASSET_PATHS.nightlyIosIconPng,
macos: BRAND_ASSET_PATHS.nightlyMacIconPng,
universal: BRAND_ASSET_PATHS.nightlyLinuxIconPng,
appleTouch: BRAND_ASSET_PATHS.nightlyWebAppleTouchIconPng,
favicon16: BRAND_ASSET_PATHS.nightlyWebFavicon16Png,
favicon32: BRAND_ASSET_PATHS.nightlyWebFavicon32Png,
faviconIco: BRAND_ASSET_PATHS.nightlyWebFaviconIco,
windowsIco: BRAND_ASSET_PATHS.nightlyWindowsIconIco,
},
},
{
label: "production",
source: BRAND_ASSET_PATHS.productionIconComposerProject,
outputs: {
ios: BRAND_ASSET_PATHS.productionIosIconPng,
macos: BRAND_ASSET_PATHS.productionMacIconPng,
universal: BRAND_ASSET_PATHS.productionLinuxIconPng,
appleTouch: BRAND_ASSET_PATHS.productionWebAppleTouchIconPng,
favicon16: BRAND_ASSET_PATHS.productionWebFavicon16Png,
favicon32: BRAND_ASSET_PATHS.productionWebFavicon32Png,
faviconIco: BRAND_ASSET_PATHS.productionWebFaviconIco,
windowsIco: BRAND_ASSET_PATHS.productionWindowsIconIco,
},
},
] as const satisfies ReadonlyArray<IconVariant>;
const MACOS_EXPORT_CODEX_PROMPT = [
"Use [@Computer](plugin://computer-use@openai-bundled) and the Icon Composer app to export the three macOS app icons in this repository.",
"For each project below, use Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, and Scale: 1×, then save the PNG to the exact destination:",
...ICON_VARIANTS.map((variant) => `- ${variant.source} -> ${variant.outputs.macos}`),
"Do not resize, composite, or otherwise post-process the exported PNGs.",
"Verify every result is 1024×1024 and has the classic macOS safe area: an 824×824 opaque body inset 100px on every side, with only Icon Composer's native shadow extending beyond it.",
];
const RepositoryRoot = Effect.service(Path.Path).pipe(
Effect.flatMap((path) => path.fromFileUrl(new URL("..", import.meta.url))),
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "resolve-repository-root",
path: new URL("..", import.meta.url).pathname,
cause,
}),
),
);
const collectStreamAsString = <E>(stream: Stream.Stream<Uint8Array, E>) =>
stream.pipe(
Stream.decodeText(),
Stream.runFold(
() => "",
(acc, chunk) => acc + chunk,
),
);
const runCommand = Effect.fn("iconExport.runCommand")(function* (
command: string,
args: ReadonlyArray<string>,
) {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const child = yield* spawner.spawn(ChildProcess.make(command, args)).pipe(
Effect.mapError(
(cause) =>
new IconExportProcessError({
operation: "spawn",
command,
argumentCount: args.length,
cause,
}),
),
);
const [stdout, stderr, exitCode] = yield* Effect.all(
[
collectStreamAsString(child.stdout).pipe(
Effect.mapError(
(cause) =>
new IconExportProcessError({
operation: "collect-stdout",
command,
argumentCount: args.length,
cause,
}),
),
),
collectStreamAsString(child.stderr).pipe(
Effect.mapError(
(cause) =>
new IconExportProcessError({
operation: "collect-stderr",
command,
argumentCount: args.length,
cause,
}),
),
),
child.exitCode.pipe(
Effect.map(Number),
Effect.mapError(
(cause) =>
new IconExportProcessError({
operation: "wait-for-exit",
command,
argumentCount: args.length,
cause,
}),
),
),
],
{ concurrency: "unbounded" },
);
return { stdout, stderr, exitCode } satisfies CommandResult;
});
const iconComposerToolFromDeveloperDirectory = (developerDirectory: string, path: Path.Path) =>
path.resolve(developerDirectory, "..", ...ICON_COMPOSER_EXECUTABLE_PARTS.slice(1));
const readSelectedDeveloperDirectory = Effect.fn("iconExport.readSelectedDeveloperDirectory")(
function* () {
const result = yield* runCommand("xcode-select", ["-p"]).pipe(Effect.option);
return Option.flatMap(result, (output) => {
const developerDirectory = output.stdout.trim();
return output.exitCode === 0 && developerDirectory.length > 0
? Option.some(developerDirectory)
: Option.none();
});
},
);
const findXcodeAppCandidates = Effect.fn("iconExport.findXcodeAppCandidates")(function* (
directory: string,
) {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const entries = yield* fs.readDirectory(directory).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "read-directory",
path: directory,
cause,
}),
),
Effect.orElseSucceed(() => []),
);
return entries
.filter((entry) => /^Xcode.*\.app$/.test(entry))
.map((entry) => path.join(directory, entry, ...ICON_COMPOSER_EXECUTABLE_PARTS));
});
const probeIconComposerTool = Effect.fn("iconExport.probeIconComposerTool")(function* (
candidate: string,
) {
const fs = yield* FileSystem.FileSystem;
const exists = yield* fs.exists(candidate).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "check-path",
path: candidate,
cause,
}),
),
Effect.orElseSucceed(() => false),
);
if (!exists) return Option.none<IconComposerTool>();
const result = yield* runCommand(candidate, ["--version"]).pipe(Effect.option);
if (Option.isNone(result) || result.value.exitCode !== 0) {
return Option.none<IconComposerTool>();
}
const version = yield* decodeIconComposerVersion(result.value.stdout).pipe(Effect.option);
if (Option.isNone(version)) return Option.none<IconComposerTool>();
const bundleVersion = version.value["bundle-version"];
const shortVersion = version.value["short-bundle-version"];
return Option.some({
path: candidate,
version: `${shortVersion} (${bundleVersion})`,
bundleVersion,
supportsDesignGeneration: Number.parseInt(shortVersion, 10) >= 2,
});
});
const resolveIconComposerTool = Effect.fn("iconExport.resolveIconComposerTool")(function* () {
const path = yield* Path.Path;
const environment = yield* HostProcessEnvironment;
const configuredTool = environment.ICON_COMPOSER_TOOL?.trim();
if (configuredTool) {
const tool = yield* probeIconComposerTool(configuredTool);
if (Option.isNone(tool)) {
return yield* new IconExportToolResolutionError({
reason: "configured-invalid",
designGeneration: DESIGN_GENERATION,
toolPath: configuredTool,
});
}
if (!tool.value.supportsDesignGeneration) {
return yield* new IconExportToolResolutionError({
reason: "configured-outdated",
designGeneration: DESIGN_GENERATION,
toolPath: configuredTool,
version: tool.value.version,
});
}
return tool.value;
}
const selectedDeveloperDirectory = yield* readSelectedDeveloperDirectory();
const configuredDeveloperDirectory = environment.DEVELOPER_DIR?.trim();
const homeDirectory = environment.HOME?.trim();
const searchDirectories = [
"/Applications",
...(homeDirectory ? [path.join(homeDirectory, "Downloads")] : []),
];
const xcodeCandidates = yield* Effect.forEach(searchDirectories, findXcodeAppCandidates, {
concurrency: "unbounded",
});
const candidates = new Set<string>([
...(configuredDeveloperDirectory
? [iconComposerToolFromDeveloperDirectory(configuredDeveloperDirectory, path)]
: []),
...Option.match(selectedDeveloperDirectory, {
onNone: () => [],
onSome: (developerDirectory) => [
iconComposerToolFromDeveloperDirectory(developerDirectory, path),
],
}),
path.join("/Applications", ...STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS),
...(homeDirectory
? [path.join(homeDirectory, "Applications", ...STANDALONE_ICON_COMPOSER_EXECUTABLE_PARTS)]
: []),
...xcodeCandidates.flat(),
]);
const probed = yield* Effect.forEach([...candidates], probeIconComposerTool, {
concurrency: "unbounded",
});
const compatibleTools = probed
.filter(Option.isSome)
.map((tool) => tool.value)
.filter((tool) => tool.supportsDesignGeneration)
.sort((left, right) =>
right.bundleVersion.localeCompare(left.bundleVersion, undefined, { numeric: true }),
);
const newestTool = compatibleTools[0];
if (newestTool) return newestTool;
return yield* new IconExportToolResolutionError({
reason: "not-found",
designGeneration: DESIGN_GENERATION,
});
});
const renderIcon = Effect.fn("iconExport.renderIcon")(function* (
toolPath: string,
sourcePath: string,
outputPath: string,
platform: IconPlatform,
size: number,
) {
const fs = yield* FileSystem.FileSystem;
const args = [
sourcePath,
"--export-image",
"--output-file",
outputPath,
"--platform",
platform,
"--rendition",
"Default",
"--width",
String(size),
"--height",
String(size),
"--scale",
"1",
"--design-generation",
String(DESIGN_GENERATION),
];
const result = yield* runCommand(toolPath, args);
if (result.exitCode !== 0) {
return yield* new IconExportCommandFailedError({
command: toolPath,
argumentCount: args.length,
exitCode: result.exitCode,
sourcePath,
size,
...(result.stdout.trim() ? { stdout: result.stdout.trim() } : {}),
...(result.stderr.trim() ? { stderr: result.stderr.trim() } : {}),
});
}
const contents = yield* fs.readFile(outputPath).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "read-file",
path: outputPath,
cause,
}),
),
);
const buffer = Buffer.from(contents);
const dimensions = yield* Effect.try({
try: () => readPngDimensions(buffer),
catch: (cause) =>
new IconExportRenditionError({
sourcePath,
outputPath,
expectedSize: size,
cause,
}),
});
if (dimensions.width !== size || dimensions.height !== size) {
return yield* new IconExportRenditionError({
sourcePath,
outputPath,
expectedSize: size,
actualWidth: dimensions.width,
actualHeight: dimensions.height,
});
}
return buffer;
});
const renderVariant = Effect.fn("iconExport.renderVariant")(function* (
toolPath: string,
repositoryRoot: string,
temporaryDirectory: string,
variant: IconVariant,
) {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const sourcePath = path.join(repositoryRoot, variant.source);
const sourceExists = yield* fs.exists(sourcePath).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "check-path",
path: sourcePath,
cause,
}),
),
);
if (!sourceExists) {
return yield* new IconExportSourceMissingError({ sourcePath: variant.source });
}
const renditionCache = new Map<string, Buffer>();
const render = Effect.fn("iconExport.renderVariant.rendition")(function* (
platform: IconPlatform,
size: number,
) {
const cacheKey = `${platform}-${size}`;
const cached = renditionCache.get(cacheKey);
if (cached) return cached;
const outputPath = path.join(temporaryDirectory, `${variant.label}-${platform}-${size}.png`);
const contents = yield* renderIcon(toolPath, sourcePath, outputPath, platform, size);
renditionCache.set(cacheKey, contents);
return contents;
});
const ios = yield* render("iOS", 1024);
const icoRenditions = yield* Effect.forEach(
WINDOWS_ICON_SIZES,
(size) => render("iOS", size).pipe(Effect.map((contents) => ({ size, contents }))),
{ concurrency: 1 },
);
const ico = yield* Effect.try({
try: () => encodePngIco(icoRenditions),
catch: (cause) => new IconExportEncodingError({ variant: variant.label, cause }),
});
return new Map<string, Buffer>([
[variant.outputs.ios, ios],
[variant.outputs.universal, ios],
[variant.outputs.appleTouch, yield* render("iOS", 180)],
[variant.outputs.favicon16, yield* render("iOS", 16)],
[variant.outputs.favicon32, yield* render("iOS", 32)],
[variant.outputs.faviconIco, ico],
[variant.outputs.windowsIco, ico],
]);
});
const logManualMacOsExportInstructions = Effect.fn("iconExport.logManualMacOsExportInstructions")(
function* () {
yield* Console.warn(
[
"macOS icons require Icon Composer's GUI-only pre-Tahoe preset and were not changed.",
"Export each source with Platform: macOS pre-Tahoe, Appearance: Default, Size: 1024pt, Scale: 1×:",
...ICON_VARIANTS.map((variant) => `- ${variant.source} -> ${variant.outputs.macos}`),
"See assets/README.md for the complete workflow.",
"",
"Copy/paste this prompt into Codex to perform the native exports:",
"---",
...MACOS_EXPORT_CODEX_PROMPT,
"---",
].join("\n"),
);
},
);
const writeAtomically = Effect.fn("iconExport.writeAtomically")(function* (
repositoryRoot: string,
relativePath: string,
contents: Buffer,
) {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const targetPath = path.join(repositoryRoot, relativePath);
const targetDirectory = path.dirname(targetPath);
yield* fs.makeDirectory(targetDirectory, { recursive: true }).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "make-directory",
path: targetDirectory,
cause,
}),
),
);
const temporaryPath = yield* fs
.makeTempFileScoped({
directory: targetDirectory,
prefix: ".t3-icon-export-",
suffix: ".tmp",
})
.pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "make-temp-file",
path: targetDirectory,
cause,
}),
),
);
yield* fs.writeFile(temporaryPath, contents).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "write-file",
path: temporaryPath,
cause,
}),
),
);
yield* fs.rename(temporaryPath, targetPath).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "rename-file",
path: targetPath,
cause,
}),
),
);
});
const isCurrent = Effect.fn("iconExport.isCurrent")(function* (
repositoryRoot: string,
relativePath: string,
expected: Buffer,
) {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const targetPath = path.join(repositoryRoot, relativePath);
const exists = yield* fs.exists(targetPath).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "check-path",
path: targetPath,
cause,
}),
),
);
if (!exists) return false;
const actual = yield* fs.readFile(targetPath).pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "read-file",
path: targetPath,
cause,
}),
),
);
return Buffer.from(actual).equals(expected);
});
export const exportBrandIcons = Effect.fn("exportBrandIcons")(function* (checkOnly: boolean) {
const fs = yield* FileSystem.FileSystem;
const repositoryRoot = yield* RepositoryRoot;
const tool = yield* resolveIconComposerTool();
const temporaryDirectory = yield* fs
.makeTempDirectoryScoped({
prefix: "t3-icon-export-",
})
.pipe(
Effect.mapError(
(cause) =>
new IconExportFileSystemError({
operation: "make-temp-directory",
path: "system temporary directory",
cause,
}),
),
);
yield* Console.log(
`Exporting icons with Icon Composer ${tool.version}, design generation ${DESIGN_GENERATION}.`,
);
const generated = new Map<string, Buffer>();
for (const variant of ICON_VARIANTS) {
yield* Console.log(`Rendering ${variant.label} from ${variant.source}...`);
const variantAssets = yield* renderVariant(
tool.path,
repositoryRoot,
temporaryDirectory,
variant,
);
for (const [relativePath, contents] of variantAssets) {
generated.set(relativePath, contents);
}
}
if (checkOnly) {
const stale = yield* Effect.filter(
[...generated.entries()],
([relativePath, contents]) =>
isCurrent(repositoryRoot, relativePath, contents).pipe(Effect.map((current) => !current)),
{ concurrency: "unbounded" },
);
if (stale.length > 0) {
return yield* new IconExportAssetsStaleError({
paths: stale.map(([relativePath]) => relativePath),
});
}
yield* Console.log(`All ${generated.size} generated icon assets are current.`);
yield* logManualMacOsExportInstructions();
return;
}
yield* Effect.forEach(
generated,
([relativePath, contents]) => writeAtomically(repositoryRoot, relativePath, contents),
{ concurrency: 1, discard: true },
);
yield* Console.log(`Updated ${generated.size} generated icon assets.`);
yield* logManualMacOsExportInstructions();
});
export const exportBrandIconsCommand = Command.make(
"export-brand-icons",
{
check: Flag.boolean("check").pipe(
Flag.withDescription("Verify generated icon assets without modifying files."),
Flag.withDefault(false),
),
},
({ check }) => exportBrandIcons(check).pipe(Effect.scoped),
).pipe(
Command.withDescription(
"Export development, preview, and production assets from Icon Composer projects.",
),
);
if (import.meta.main) {
Command.run(exportBrandIconsCommand, { version: "0.0.0" }).pipe(
Effect.provide(NodeServices.layer),
NodeRuntime.runMain,
);
}
+15
View File
@@ -55,4 +55,19 @@ describe("brand-assets", () => {
expect(resolveWebAssetBrandForChannel("latest")).toBe("production");
expect(resolveWebAssetBrandForChannel("nightly")).toBe("nightly");
});
it("keeps development, nightly, and production icon families separate", () => {
expect([
BRAND_ASSET_PATHS.developmentIconComposerProject,
BRAND_ASSET_PATHS.nightlyIconComposerProject,
BRAND_ASSET_PATHS.productionIconComposerProject,
]).toEqual([
"assets/dev/app-icon.icon",
"assets/nightly/app-icon.icon",
"assets/prod/app-icon.icon",
]);
expect(BRAND_ASSET_PATHS.developmentDesktopIconPng).toMatch(/^assets\/dev\/blueprint-/);
expect(BRAND_ASSET_PATHS.nightlyMacIconPng).toMatch(/^assets\/nightly\/nightly-/);
expect(BRAND_ASSET_PATHS.productionMacIconPng).toMatch(/^assets\/prod\/black-/);
});
});
+15 -7
View File
@@ -1,4 +1,10 @@
export const BRAND_ASSET_PATHS = {
developmentIconComposerProject: "assets/dev/app-icon.icon",
developmentIosIconPng: "assets/dev/blueprint-ios-1024.png",
developmentUniversalIconPng: "assets/dev/blueprint-universal-1024.png",
productionIconComposerProject: "assets/prod/app-icon.icon",
productionIosIconPng: "assets/prod/black-ios-1024.png",
productionMacIconPng: "assets/prod/black-macos-1024.png",
productionLinuxIconPng: "assets/prod/black-universal-1024.png",
productionWindowsIconIco: "assets/prod/t3-black-windows.ico",
@@ -7,13 +13,15 @@ export const BRAND_ASSET_PATHS = {
productionWebFavicon32Png: "assets/prod/t3-black-web-favicon-32x32.png",
productionWebAppleTouchIconPng: "assets/prod/t3-black-web-apple-touch-180.png",
nightlyMacIconPng: "assets/nightly/blueprint-macos-1024.png",
nightlyLinuxIconPng: "assets/nightly/blueprint-universal-1024.png",
nightlyWindowsIconIco: "assets/nightly/blueprint-windows.ico",
nightlyWebFaviconIco: "assets/nightly/blueprint-web-favicon.ico",
nightlyWebFavicon16Png: "assets/nightly/blueprint-web-favicon-16x16.png",
nightlyWebFavicon32Png: "assets/nightly/blueprint-web-favicon-32x32.png",
nightlyWebAppleTouchIconPng: "assets/nightly/blueprint-web-apple-touch-180.png",
nightlyIconComposerProject: "assets/nightly/app-icon.icon",
nightlyIosIconPng: "assets/nightly/nightly-ios-1024.png",
nightlyMacIconPng: "assets/nightly/nightly-macos-1024.png",
nightlyLinuxIconPng: "assets/nightly/nightly-universal-1024.png",
nightlyWindowsIconIco: "assets/nightly/nightly-windows.ico",
nightlyWebFaviconIco: "assets/nightly/nightly-web-favicon.ico",
nightlyWebFavicon16Png: "assets/nightly/nightly-web-favicon-16x16.png",
nightlyWebFavicon32Png: "assets/nightly/nightly-web-favicon-32x32.png",
nightlyWebAppleTouchIconPng: "assets/nightly/nightly-web-apple-touch-180.png",
developmentDesktopIconPng: "assets/dev/blueprint-macos-1024.png",
developmentWindowsIconIco: "assets/dev/blueprint-windows.ico",
+47
View File
@@ -0,0 +1,47 @@
import { assert, describe, it } from "@effect/vitest";
import { encodePngIco, readPngDimensions } from "./icon-export.ts";
const pngHeader = (width: number, height: number) => {
const contents = Buffer.alloc(24);
Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]).copy(contents);
contents.write("IHDR", 12, "ascii");
contents.writeUInt32BE(width, 16);
contents.writeUInt32BE(height, 20);
return contents;
};
describe("icon export", () => {
it("reads dimensions from a PNG IHDR chunk", () => {
assert.deepEqual(readPngDimensions(pngHeader(1024, 512)), { width: 1024, height: 512 });
});
it("encodes PNG renditions into an ICO directory", () => {
const small = pngHeader(16, 16);
const large = pngHeader(256, 256);
const ico = encodePngIco([
{ size: 16, contents: small },
{ size: 256, contents: large },
]);
assert.equal(ico.readUInt16LE(2), 1);
assert.equal(ico.readUInt16LE(4), 2);
assert.equal(ico.readUInt8(6), 16);
assert.equal(ico.readUInt8(22), 0);
assert.equal(ico.readUInt32LE(18), 38);
assert.equal(ico.readUInt32LE(34), 38 + small.length);
assert.deepEqual(ico.subarray(38, 38 + small.length), small);
assert.deepEqual(ico.subarray(38 + small.length), large);
});
it("rejects duplicate ICO rendition sizes", () => {
assert.throws(
() =>
encodePngIco([
{ size: 32, contents: pngHeader(32, 32) },
{ size: 32, contents: pngHeader(32, 32) },
]),
/provided more than once/,
);
});
});
+72
View File
@@ -0,0 +1,72 @@
const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
export const WINDOWS_ICON_SIZES = [16, 24, 32, 48, 64, 128, 256] as const;
export interface PngIconImage {
readonly size: number;
readonly contents: Buffer;
}
export function readPngDimensions(contents: Buffer): {
readonly width: number;
readonly height: number;
} {
if (
contents.length < 24 ||
!contents.subarray(0, PNG_SIGNATURE.length).equals(PNG_SIGNATURE) ||
contents.toString("ascii", 12, 16) !== "IHDR"
) {
throw new Error("Icon Composer produced an invalid PNG.");
}
return {
width: contents.readUInt32BE(16),
height: contents.readUInt32BE(20),
};
}
/** Encodes PNG renditions directly into a modern, multi-resolution ICO file. */
export function encodePngIco(images: ReadonlyArray<PngIconImage>): Buffer {
if (images.length === 0) {
throw new Error("An ICO file requires at least one PNG rendition.");
}
const seenSizes = new Set<number>();
for (const image of images) {
if (!Number.isInteger(image.size) || image.size < 1 || image.size > 256) {
throw new Error(`ICO rendition size must be an integer from 1 to 256, got ${image.size}.`);
}
if (seenSizes.has(image.size)) {
throw new Error(`ICO rendition size ${image.size} was provided more than once.`);
}
if (image.contents.length === 0) {
throw new Error(`ICO rendition ${image.size}x${image.size} is empty.`);
}
seenSizes.add(image.size);
}
const headerSize = 6;
const directoryEntrySize = 16;
const directorySize = directoryEntrySize * images.length;
const header = Buffer.alloc(headerSize + directorySize);
header.writeUInt16LE(0, 0);
header.writeUInt16LE(1, 2);
header.writeUInt16LE(images.length, 4);
let imageOffset = header.length;
images.forEach((image, index) => {
const entryOffset = headerSize + index * directoryEntrySize;
const encodedSize = image.size === 256 ? 0 : image.size;
header.writeUInt8(encodedSize, entryOffset);
header.writeUInt8(encodedSize, entryOffset + 1);
header.writeUInt8(0, entryOffset + 2);
header.writeUInt8(0, entryOffset + 3);
header.writeUInt16LE(1, entryOffset + 4);
header.writeUInt16LE(32, entryOffset + 6);
header.writeUInt32LE(image.contents.length, entryOffset + 8);
header.writeUInt32LE(imageOffset, entryOffset + 12);
imageOffset += image.contents.length;
});
return Buffer.concat([header, ...images.map((image) => image.contents)]);
}