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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/desktop/src/app/DesktopConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const trimNonEmptyOption = (value: string): Option.Option<string> => {
};

const trimmedString = (name: string) =>
Config.string(name).pipe(Config.option, Config.map(Option.flatMap(trimNonEmptyOption)));
Config.String(name).pipe(Config.option, Config.map(Option.flatMap(trimNonEmptyOption)));

const optionalBoolean = (name: string) =>
Config.boolean(name).pipe(Config.option, Config.map(Option.getOrElse(() => false)));
Config.Boolean(name).pipe(Config.option, Config.map(Option.getOrElse(() => false)));

const commaSeparatedStrings = (name: string) =>
trimmedString(name).pipe(
Expand All @@ -37,21 +37,21 @@ export const DesktopConfig = Config.all({
xdgConfigHome: trimmedString("XDG_CONFIG_HOME"),
xdgDataHome: trimmedString("XDG_DATA_HOME"),
t3Home: trimmedString("T3CODE_HOME"),
devServerUrl: Config.url("VITE_DEV_SERVER_URL").pipe(Config.option),
devServerUrl: Config.URL("VITE_DEV_SERVER_URL").pipe(Config.option),
appUserModelIdOverride: trimmedString("T3CODE_DESKTOP_APP_USER_MODEL_ID"),
devRemoteT3ServerEntryPath: trimmedString("T3CODE_DEV_REMOTE_T3_SERVER_ENTRY_PATH"),
configuredBackendPort: Config.port("T3CODE_PORT").pipe(Config.option),
configuredBackendPort: Config.Port("T3CODE_PORT").pipe(Config.option),
commitHashOverride: trimmedString("T3CODE_COMMIT_HASH"),
desktopLanHostOverride: trimmedString("T3CODE_DESKTOP_LAN_HOST"),
desktopHttpsEndpointUrls: commaSeparatedStrings("T3CODE_DESKTOP_HTTPS_ENDPOINTS"),
otlpTracesUrl: trimmedString("T3CODE_OTLP_TRACES_URL"),
otlpExportIntervalMs: Config.int("T3CODE_OTLP_EXPORT_INTERVAL_MS").pipe(
otlpExportIntervalMs: Config.Int("T3CODE_OTLP_EXPORT_INTERVAL_MS").pipe(
Config.withDefault(10_000),
),
appImagePath: trimmedString("APPIMAGE"),
disableAutoUpdate: optionalBoolean("T3CODE_DISABLE_AUTO_UPDATE"),
mockUpdates: optionalBoolean("T3CODE_DESKTOP_MOCK_UPDATES"),
mockUpdateServerPort: Config.port("T3CODE_DESKTOP_MOCK_UPDATE_SERVER_PORT").pipe(
mockUpdateServerPort: Config.Port("T3CODE_DESKTOP_MOCK_UPDATE_SERVER_PORT").pipe(
Config.withDefault(3000),
),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ function countingWsRpcProtocolLayer(input: {
readonly cookie: string;
readonly recorder: WebSocketTransferRecorder;
}) {
// Socket.makeWebSocket only ever passes its `protocols` option here.
const webSocketConstructorLayer = Layer.succeed(Socket.WebSocketConstructor, (url, protocols) =>
input.recorder.connect(url, protocols, input.cookie),
input.recorder.connect(url, protocols as string | string[] | undefined, input.cookie),
);
return RpcClient.layerProtocolSocket().pipe(
Layer.provide(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as Option from "effect/Option";
import * as Stream from "effect/Stream";
import * as SqlClient from "effect/unstable/sql/SqlClient";
import { HttpServer } from "effect/unstable/http";
import * as NetAddress from "effect/unstable/net/NetAddress";

import * as EnvironmentAuth from "../src/auth/EnvironmentAuth.ts";
import * as ServiceLauncherClient from "../src/cloud/serviceLauncherClient.ts";
Expand Down Expand Up @@ -104,7 +105,7 @@ const startupDependencies = Layer.mergeAll(
Layer.succeed(
HttpServer.HttpServer,
HttpServer.HttpServer.of({
address: { _tag: "TcpAddress", hostname: "127.0.0.1", port: 3773 },
address: NetAddress.inetAddressFromIpStringUnsafe("127.0.0.1", 3773),
serve: (() => Effect.void) as HttpServer.HttpServer["Service"]["serve"],
}),
),
Expand Down
1 change: 0 additions & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@ff-labs/fff-node": "0.9.4",
"@opencode-ai/sdk": "^1.3.15",
"effect": "catalog:",
"msgpackr-extract": "3.0.4",
"node-pty": "^1.1.0",
"stream-chain": "^4.2.5",
"stream-json": "3.6.0",
Expand Down
14 changes: 7 additions & 7 deletions apps/server/scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const applyDevelopmentIconOverrides = Effect.fn("applyDevelopmentIconOverrides")
const buildCmd = Command.make(
"build",
{
verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)),
verbose: Flag.Boolean("verbose").pipe(Flag.withDefault(false)),
},
(config) =>
Effect.gen(function* () {
Expand Down Expand Up @@ -207,12 +207,12 @@ const createVpPmPublishArgs = (config: PublishCommandConfig): ReadonlyArray<stri
const publishCmd = Command.make(
"publish",
{
tag: Flag.string("tag").pipe(Flag.withDefault("latest")),
access: Flag.string("access").pipe(Flag.withDefault("public")),
appVersion: Flag.string("app-version").pipe(Flag.optional),
provenance: Flag.boolean("provenance").pipe(Flag.withDefault(false)),
dryRun: Flag.boolean("dry-run").pipe(Flag.withDefault(false)),
verbose: Flag.boolean("verbose").pipe(Flag.withDefault(false)),
tag: Flag.String("tag").pipe(Flag.withDefault("latest")),
access: Flag.String("access").pipe(Flag.withDefault("public")),
appVersion: Flag.String("app-version").pipe(Flag.optional),
provenance: Flag.Boolean("provenance").pipe(Flag.withDefault(false)),
dryRun: Flag.Boolean("dry-run").pipe(Flag.withDefault(false)),
verbose: Flag.Boolean("verbose").pipe(Flag.withDefault(false)),
},
(config) =>
Effect.gen(function* () {
Expand Down
8 changes: 4 additions & 4 deletions apps/server/scripts/migrate-dev-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,19 @@ const formatSize = (bytes: number): string =>
export const migrateDevDbCommand = Command.make(
"migrate-dev-db",
{
projects: Flag.integer("projects").pipe(
projects: Flag.Int("projects").pipe(
Flag.withDefault(5),
Flag.withDescription("How many recently updated projects to keep."),
),
threadsPerProject: Flag.integer("threads-per-project").pipe(
threadsPerProject: Flag.Int("threads-per-project").pipe(
Flag.withDefault(10),
Flag.withDescription("How many recent stopped threads to keep per project."),
),
baseDir: Flag.string("base-dir").pipe(
baseDir: Flag.String("base-dir").pipe(
Flag.optional,
Flag.withDescription("Isolated .t3 directory. Defaults to the current worktree's .t3."),
),
source: Flag.string("source").pipe(
source: Flag.String("source").pipe(
Flag.optional,
Flag.withDescription("Source database. Defaults to ~/.t3/userdata/state.sqlite."),
),
Expand Down
8 changes: 4 additions & 4 deletions apps/server/scripts/t3-sqlite-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,17 @@ export const runSqliteState = Effect.fn("runSqliteState")(function* (
const t3SqliteStateCommand = Command.make(
"t3-sqlite-state",
{
operation: Argument.choice("operation", SqliteStateOperation.literals).pipe(
operation: Argument.Literals("operation", SqliteStateOperation.literals).pipe(
Argument.withDescription("Run a read-only query or a backed-up fixture mutation."),
),
baseDir: Flag.string("base-dir").pipe(
baseDir: Flag.String("base-dir").pipe(
Flag.withDescription("Explicit T3 base directory containing userdata/state.sqlite."),
),
sql: Flag.string("sql").pipe(
sql: Flag.String("sql").pipe(
Flag.optional,
Flag.withDescription("SQL source supplied directly on the command line."),
),
file: Flag.string("file").pipe(
file: Flag.String("file").pipe(
Flag.optional,
Flag.withDescription("Path to a SQL source file."),
),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ConnectPublicConfigMissingError extends CliError.UserError {
}

const connectUnavailableCommand = Command.make("connect", {
command: Argument.string("command").pipe(Argument.variadic),
command: Argument.String("command").pipe(Argument.variadic),
}).pipe(
Command.withDescription("T3 Connect is unavailable in builds without public configuration."),
Command.unlisted,
Expand Down
8 changes: 4 additions & 4 deletions apps/server/src/cli/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ function sendDesktopAppActivationRequest(input: {
}

const appEnvironment = Config.all({
t3Home: Config.string("T3CODE_HOME").pipe(Config.option, Config.map(Option.getOrUndefined)),
sshConnection: Config.string("SSH_CONNECTION").pipe(Config.option),
sshTty: Config.string("SSH_TTY").pipe(Config.option),
t3Home: Config.String("T3CODE_HOME").pipe(Config.option, Config.map(Option.getOrUndefined)),
sshConnection: Config.String("SSH_CONNECTION").pipe(Config.option),
sshTty: Config.String("SSH_TTY").pipe(Config.option),
});

const runAppCommand = Effect.fn("cli.app")(function* (flags: {
Expand Down Expand Up @@ -251,7 +251,7 @@ const runAppCommand = Effect.fn("cli.app")(function* (flags: {

export const appCommand = Command.make("app", {
baseDir: baseDirFlag,
workspaceRoot: Argument.string("path").pipe(
workspaceRoot: Argument.String("path").pipe(
Argument.withDescription("Project directory. Default: current directory."),
Argument.optional,
),
Expand Down
16 changes: 8 additions & 8 deletions apps/server/src/cli/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,33 @@ const runWithEnvironmentAuth = <A, E>(
);
});

const ttlFlag = Flag.string("ttl").pipe(
const ttlFlag = Flag.String("ttl").pipe(
Flag.withSchema(DurationFromString),
Flag.withDescription("TTL, for example `5m`, `1h`, `30d`, or `15 minutes`."),
Flag.optional,
);

const jsonFlag = Flag.boolean("json").pipe(
const jsonFlag = Flag.Boolean("json").pipe(
Flag.withDescription("Emit JSON instead of human-readable output."),
Flag.withDefault(false),
);

const labelFlag = Flag.string("label").pipe(
const labelFlag = Flag.String("label").pipe(
Flag.withDescription("Optional human-readable label."),
Flag.optional,
);

const subjectFlag = Flag.string("subject").pipe(
const subjectFlag = Flag.String("subject").pipe(
Flag.withDescription("Optional session subject."),
Flag.optional,
);

const baseUrlFlag = Flag.string("base-url").pipe(
const baseUrlFlag = Flag.String("base-url").pipe(
Flag.withDescription("Optional public base URL used to print a ready `/pair#token=...` link."),
Flag.optional,
);

const tokenOnlyFlag = Flag.boolean("token-only").pipe(
const tokenOnlyFlag = Flag.Boolean("token-only").pipe(
Flag.withDescription("Print only the issued bearer token."),
Flag.withDefault(false),
);
Expand Down Expand Up @@ -137,7 +137,7 @@ const pairingListCommand = Command.make("list", {

const pairingRevokeCommand = Command.make("revoke", {
...authLocationFlags,
id: Argument.string("id").pipe(Argument.withDescription("Pairing credential id to revoke.")),
id: Argument.String("id").pipe(Argument.withDescription("Pairing credential id to revoke.")),
}).pipe(
Command.withDescription("Revoke an active client pairing token."),
Command.withHandler((flags) =>
Expand Down Expand Up @@ -215,7 +215,7 @@ const sessionListCommand = Command.make("list", {

const sessionRevokeCommand = Command.make("revoke", {
...authLocationFlags,
sessionId: Argument.string("session-id").pipe(
sessionId: Argument.String("session-id").pipe(
Argument.withDescription("Session id to revoke."),
Argument.withSchema(AuthSessionId),
),
Expand Down
Loading
Loading