Skip to content
Merged
4 changes: 1 addition & 3 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dev:electron": "node scripts/dev-electron.mjs",
"build": "tsdown",
"start": "node scripts/start-electron.mjs",
"typecheck": "tsc --noEmit",
"typecheck": "tsgo --noEmit",
"test": "vitest run --passWithNoTests",
"smoke-test": "node scripts/smoke-test.mjs"
},
Expand All @@ -25,11 +25,9 @@
"electron-updater": "^6.6.2"
},
"devDependencies": {
"@effect/language-service": "catalog:",
"@effect/vitest": "catalog:",
"@types/node": "catalog:",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
},
"productName": "T3 Code (Alpha)"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopAppIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface DesktopAppIdentityShape {
export class DesktopAppIdentity extends Context.Service<
DesktopAppIdentity,
DesktopAppIdentityShape
>()("t3/desktop/AppIdentity") {}
>()("@t3tools/desktop/app/DesktopAppIdentity") {}

const normalizeCommitHash = (value: string): Option.Option<string> => {
const trimmed = value.trim();
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface DesktopAssetsShape {
}

export class DesktopAssets extends Context.Service<DesktopAssets, DesktopAssetsShape>()(
"t3/desktop/Assets",
"@t3tools/desktop/app/DesktopAssets",
) {}

const resolveResourcePath = Effect.fn("desktop.assets.resolveResourcePath")(function* (
Expand Down
4 changes: 1 addition & 3 deletions apps/desktop/src/app/DesktopEnvironment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ const makeEnvironment = (
overrides: Partial<DesktopEnvironment.MakeDesktopEnvironmentInput> = {},
env: Record<string, string | undefined> = {},
) =>
Effect.gen(function* () {
return yield* DesktopEnvironment.DesktopEnvironment;
}).pipe(Effect.provide(makeEnvironmentLayer(overrides, env)));
DesktopEnvironment.DesktopEnvironment.pipe(Effect.provide(makeEnvironmentLayer(overrides, env)));

describe("DesktopEnvironment", () => {
it.effect("derives state paths and development identity inside Effect", () =>
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export interface DesktopEnvironmentShape {
export class DesktopEnvironment extends Context.Service<
DesktopEnvironment,
DesktopEnvironmentShape
>()("t3/desktop/Environment") {}
>()("@t3tools/desktop/app/DesktopEnvironment") {}

const APP_BASE_NAME = "T3 Code";

Expand Down
7 changes: 5 additions & 2 deletions apps/desktop/src/app/DesktopLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface DesktopShutdownShape {
}

export class DesktopShutdown extends Context.Service<DesktopShutdown, DesktopShutdownShape>()(
"t3/desktop/Shutdown",
"@t3tools/desktop/app/DesktopLifecycle/DesktopShutdown",
) {}

const makeShutdown = Effect.gen(function* () {
Expand Down Expand Up @@ -61,8 +61,11 @@ export interface DesktopLifecycleShape {
readonly register: Effect.Effect<void, never, Scope.Scope | DesktopLifecycleRuntimeServices>;
}

/**
* @effect-expect-leaking DesktopEnvironment | DesktopShutdown | DesktopState | DesktopWindow | ElectronApp | ElectronTheme
*/
export class DesktopLifecycle extends Context.Service<DesktopLifecycle, DesktopLifecycleShape>()(
"t3/desktop/Lifecycle",
"@t3tools/desktop/app/DesktopLifecycle",
) {}

const { logInfo: logLifecycleInfo, logError: logLifecycleError } =
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopObservability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface DesktopBackendOutputLogShape {
export class DesktopBackendOutputLog extends Context.Service<
DesktopBackendOutputLog,
DesktopBackendOutputLogShape
>()("t3/desktop/BackendOutputLog") {}
>()("@t3tools/desktop/app/DesktopObservability/DesktopBackendOutputLog") {}

const textEncoder = new TextEncoder();
const textDecoder = new TextDecoder();
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/app/DesktopState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface DesktopStateShape {
}

export class DesktopState extends Context.Service<DesktopState, DesktopStateShape>()(
"t3/desktop/State",
"@t3tools/desktop/app/DesktopState",
) {}

export const layer = Layer.effect(
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopBackendConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface DesktopBackendConfigurationShape {
export class DesktopBackendConfiguration extends Context.Service<
DesktopBackendConfiguration,
DesktopBackendConfigurationShape
>()("t3/desktop/BackendConfiguration") {}
>()("@t3tools/desktop/backend/DesktopBackendConfiguration") {}

interface BackendObservabilitySettings {
readonly otlpTracesUrl: Option.Option<string>;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/backend/DesktopBackendManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export interface DesktopBackendManagerShape {
export class DesktopBackendManager extends Context.Service<
DesktopBackendManager,
DesktopBackendManagerShape
>()("t3/desktop/BackendManager") {}
>()("@t3tools/desktop/backend/DesktopBackendManager") {}

const { logWarning: logBackendManagerWarning, logError: logBackendManagerError } =
DesktopObservability.makeComponentLogger("desktop-backend-manager");
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/backend/DesktopServerExposure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export interface DesktopServerExposureShape {
export class DesktopServerExposure extends Context.Service<
DesktopServerExposure,
DesktopServerExposureShape
>()("t3/desktop/ServerExposure") {}
>()("@t3tools/desktop/backend/DesktopServerExposure") {}

export interface DesktopNetworkInterfacesServiceShape {
readonly read: Effect.Effect<DesktopNetworkInterfaces>;
Expand All @@ -284,7 +284,7 @@ export interface DesktopNetworkInterfacesServiceShape {
export class DesktopNetworkInterfacesService extends Context.Service<
DesktopNetworkInterfacesService,
DesktopNetworkInterfacesServiceShape
>()("t3/desktop/ServerExposure/NetworkInterfaces") {}
>()("@t3tools/desktop/backend/DesktopServerExposure/DesktopNetworkInterfacesService") {}

interface RuntimeState {
readonly requestedMode: DesktopServerExposureMode;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ElectronAppShape {
}

export class ElectronApp extends Context.Service<ElectronApp, ElectronAppShape>()(
"t3/desktop/electron/App",
"@t3tools/desktop/electron/ElectronApp",
) {}

const addScopedAppListener = <Args extends ReadonlyArray<unknown>>(
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface ElectronDialogShape {
}

export class ElectronDialog extends Context.Service<ElectronDialog, ElectronDialogShape>()(
"t3/desktop/electron/Dialog",
"@t3tools/desktop/electron/ElectronDialog",
) {}

const make = ElectronDialog.of({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface ElectronMenuShape {
}

export class ElectronMenu extends Context.Service<ElectronMenu, ElectronMenuShape>()(
"t3/desktop/electron/Menu",
"@t3tools/desktop/electron/ElectronMenu",
) {}

function normalizeContextMenuItems(source: readonly ContextMenuItem[]): ContextMenuItem[] {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronProtocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface ElectronProtocolShape {
}

export class ElectronProtocol extends Context.Service<ElectronProtocol, ElectronProtocolShape>()(
"t3/desktop/electron/Protocol",
"@t3tools/desktop/electron/ElectronProtocol",
) {}

export function normalizeDesktopProtocolPathname(rawPath: string): Option.Option<string> {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronSafeStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export interface ElectronSafeStorageShape {
export class ElectronSafeStorage extends Context.Service<
ElectronSafeStorage,
ElectronSafeStorageShape
>()("@t3tools/desktop/ElectronSafeStorage") {}
>()("@t3tools/desktop/electron/ElectronSafeStorage") {}

const make = ElectronSafeStorage.of({
isEncryptionAvailable: Effect.try({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ElectronShellShape {
}

export class ElectronShell extends Context.Service<ElectronShell, ElectronShellShape>()(
"t3/desktop/electron/Shell",
"@t3tools/desktop/electron/ElectronShell",
) {}

const make = ElectronShell.of({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ElectronThemeShape {
}

export class ElectronTheme extends Context.Service<ElectronTheme, ElectronThemeShape>()(
"t3/desktop/electron/Theme",
"@t3tools/desktop/electron/ElectronTheme",
) {}

const make = ElectronTheme.of({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export interface ElectronUpdaterShape {
}

export class ElectronUpdater extends Context.Service<ElectronUpdater, ElectronUpdaterShape>()(
"t3/desktop/electron/Updater",
"@t3tools/desktop/electron/ElectronUpdater",
) {}

export const layer = Layer.succeed(ElectronUpdater, {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/electron/ElectronWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface ElectronWindowShape {
}

export class ElectronWindow extends Context.Service<ElectronWindow, ElectronWindowShape>()(
"t3/desktop/electron/Window",
"@t3tools/desktop/electron/ElectronWindow",
) {}

const make = Effect.gen(function* () {
Expand Down
4 changes: 3 additions & 1 deletion apps/desktop/src/ipc/DesktopIpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export interface DesktopIpcShape {
) => Effect.Effect<void, never, R | Scope.Scope>;
}

export class DesktopIpc extends Context.Service<DesktopIpc, DesktopIpcShape>()("t3/desktop/Ipc") {}
export class DesktopIpc extends Context.Service<DesktopIpc, DesktopIpcShape>()(
"@t3tools/desktop/ipc/DesktopIpc",
) {}

export const make = (ipcMain: DesktopIpcMain): DesktopIpcShape =>
DesktopIpc.of({
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/settings/DesktopAppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface DesktopAppSettingsShape {
export class DesktopAppSettings extends Context.Service<
DesktopAppSettings,
DesktopAppSettingsShape
>()("t3/desktop/AppSettings") {}
>()("@t3tools/desktop/settings/DesktopAppSettings") {}

export function resolveDefaultDesktopSettings(appVersion: string): DesktopSettings {
return {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/settings/DesktopClientSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface DesktopClientSettingsShape {
export class DesktopClientSettings extends Context.Service<
DesktopClientSettings,
DesktopClientSettingsShape
>()("t3/desktop/ClientSettings") {}
>()("@t3tools/desktop/settings/DesktopClientSettings") {}

const readClientSettings = (
fileSystem: FileSystem.FileSystem,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/settings/DesktopSavedEnvironments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export interface DesktopSavedEnvironmentsShape {
export class DesktopSavedEnvironments extends Context.Service<
DesktopSavedEnvironments,
DesktopSavedEnvironmentsShape
>()("t3/desktop/SavedEnvironments") {}
>()("@t3tools/desktop/settings/DesktopSavedEnvironments") {}

function toPersistedSavedEnvironmentRecord(
record: PersistedSavedEnvironmentStorageRecord,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/shell/DesktopShellEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface DesktopShellEnvironmentShape {
export class DesktopShellEnvironment extends Context.Service<
DesktopShellEnvironment,
DesktopShellEnvironmentShape
>()("t3/desktop/ShellEnvironment") {}
>()("@t3tools/desktop/shell/DesktopShellEnvironment") {}

const LOGIN_SHELL_ENV_NAMES = [
"PATH",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ssh/DesktopSshEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export interface DesktopSshEnvironmentShape {
export class DesktopSshEnvironment extends Context.Service<
DesktopSshEnvironment,
DesktopSshEnvironmentShape
>()("t3/desktop/SshEnvironment") {}
>()("@t3tools/desktop/ssh/DesktopSshEnvironment") {}

export interface DesktopSshEnvironmentLayerOptions {
readonly resolveCliPackageSpec?: () => string;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ssh/DesktopSshPasswordPrompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export interface DesktopSshPasswordPromptsShape {
export class DesktopSshPasswordPrompts extends Context.Service<
DesktopSshPasswordPrompts,
DesktopSshPasswordPromptsShape
>()("t3/desktop/SshPasswordPrompts") {}
>()("@t3tools/desktop/ssh/DesktopSshPasswordPrompts") {}

interface PendingSshPasswordPrompt {
readonly requestId: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/ssh/DesktopSshRemoteApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface DesktopSshRemoteApiShape {
export class DesktopSshRemoteApi extends Context.Service<
DesktopSshRemoteApi,
DesktopSshRemoteApiShape
>()("t3/desktop/SshRemoteApi") {}
>()("@t3tools/desktop/ssh/DesktopSshRemoteApi") {}

const decodeExecutionEnvironmentDescriptor = Schema.decodeUnknownEffect(
ExecutionEnvironmentDescriptor,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/updates/DesktopUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface DesktopUpdatesShape {
}

export class DesktopUpdates extends Context.Service<DesktopUpdates, DesktopUpdatesShape>()(
"t3/desktop/Updates",
"@t3tools/desktop/updates/DesktopUpdates",
) {}

const {
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/window/DesktopApplicationMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface DesktopApplicationMenuShape {
export class DesktopApplicationMenu extends Context.Service<
DesktopApplicationMenu,
DesktopApplicationMenuShape
>()("t3/desktop/ApplicationMenu") {}
>()("@t3tools/desktop/window/DesktopApplicationMenu") {}

type DesktopApplicationMenuRuntimeServices =
| DesktopUpdates.DesktopUpdates
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/window/DesktopWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface DesktopWindowShape {
}

export class DesktopWindow extends Context.Service<DesktopWindow, DesktopWindowShape>()(
"t3/desktop/Window",
"@t3tools/desktop/window/DesktopWindow",
) {}

const { logInfo: logWindowInfo, logWarning: logWindowWarning } =
Expand Down
4 changes: 1 addition & 3 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "node scripts/cli.ts build",
"build:bundle": "tsdown",
"start": "node dist/bin.mjs",
"typecheck": "tsc --noEmit",
"typecheck": "tsgo --noEmit",
"test": "vitest run"
},
"dependencies": {
Expand All @@ -34,7 +34,6 @@
"node-pty": "^1.1.0"
},
"devDependencies": {
"@effect/language-service": "catalog:",
"@effect/vitest": "catalog:",
"@t3tools/contracts": "workspace:*",
"@t3tools/shared": "workspace:*",
Expand All @@ -45,7 +44,6 @@
"effect-acp": "workspace:*",
"effect-codex-app-server": "workspace:*",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
},
"engines": {
Expand Down
4 changes: 3 additions & 1 deletion apps/server/src/auth/Layers/BootstrapCredentialService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { AuthPairingLink } from "@t3tools/contracts";
import * as Crypto from "effect/Crypto";
import * as DateTime from "effect/DateTime";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
Expand Down Expand Up @@ -46,6 +47,7 @@ const generatePairingToken = (): string => {
};

export const makeBootstrapCredentialService = Effect.gen(function* () {
const crypto = yield* Crypto.Crypto;
const config = yield* ServerConfig;
const pairingLinks = yield* AuthPairingLinkRepository;
const seededGrantsRef = yield* Ref.make(new Map<string, StoredBootstrapGrant>());
Expand Down Expand Up @@ -141,7 +143,7 @@ export const makeBootstrapCredentialService = Effect.gen(function* () {

const issueOneTimeToken: BootstrapCredentialServiceShape["issueOneTimeToken"] = (input) =>
Effect.gen(function* () {
const id = crypto.randomUUID();
const id = yield* crypto.randomUUIDv4;
const credential = generatePairingToken();
const ttl = input?.ttl ?? DEFAULT_ONE_TIME_TOKEN_TTL_MINUTES;
const now = yield* DateTime.now;
Expand Down
4 changes: 3 additions & 1 deletion apps/server/src/auth/Layers/SessionCredentialService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AuthSessionId, type AuthClientMetadata, type AuthClientSession } from "@t3tools/contracts";
import * as Clock from "effect/Clock";
import * as Crypto from "effect/Crypto";
import * as DateTime from "effect/DateTime";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
Expand Down Expand Up @@ -90,6 +91,7 @@ function toAuthClientSession(input: Omit<AuthClientSession, "current">): AuthCli
}

export const makeSessionCredentialService = Effect.gen(function* () {
const crypto = yield* Crypto.Crypto;
const serverConfig = yield* ServerConfig;
const secretStore = yield* ServerSecretStore;
const authSessions = yield* AuthSessionRepository;
Expand Down Expand Up @@ -203,7 +205,7 @@ export const makeSessionCredentialService = Effect.gen(function* () {
const encodeClaims = Schema.encodeEffect(Schema.fromJsonString(SessionClaims));
const issue: SessionCredentialServiceShape["issue"] = (input) =>
Effect.gen(function* () {
const sessionId = AuthSessionId.make(crypto.randomUUID());
const sessionId = AuthSessionId.make(yield* crypto.randomUUIDv4);
const issuedAt = yield* DateTime.now;
const expiresAt = DateTime.add(issuedAt, {
milliseconds: Duration.toMillis(input?.ttl ?? DEFAULT_SESSION_TTL),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/auth/Services/AuthControlPlane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ export interface AuthControlPlaneShape {
}

export class AuthControlPlane extends Context.Service<AuthControlPlane, AuthControlPlaneShape>()(
"t3/AuthControlPlane",
"t3/auth/Services/AuthControlPlane",
) {}
Loading
Loading