| author | |
| committer | |
| log | 5b8a69c7b90b751507d0ab762dd77aaa2048408b |
| tree | 45353c30f4ee1a0ebf7464bd121ffbf1be745000 |
| parent | 3bf74eb6dce3e1372cfafc2ca84825f4b13bae6a |
| signature | Signed by PGP key B5690EEEBB952194 |
10 files changed, 14 insertions(+), 59 deletions(-)
apps/desktop/scripts/electron-launcher.mjs+3-3| ... | ... | @@ -15,8 +15,8 @@ const repoRoot = NodePath.resolve(desktopDir, "..", ".."); |
| 15 | 15 | const devBundleIdSuffix = NodePath.basename(repoRoot) |
| 16 | 16 | .toLowerCase() |
| 17 | 17 | .replaceAll(/[^a-z0-9]+/g, ""); |
| 18 | export const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)"; | |
| 19 | export const APP_BUNDLE_ID = isDevelopment | |
| 18 | const APP_DISPLAY_NAME = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)"; | |
| 19 | const APP_BUNDLE_ID = isDevelopment | |
| 20 | 20 | ? `com.t3tools.t3code.dev.${devBundleIdSuffix || "local"}` |
| 21 | 21 | : "com.t3tools.t3code"; |
| 22 | 22 | const APP_PROTOCOL_SCHEMES = isDevelopment ? ["t3code-dev"] : ["t3code"]; |
| ... | ... | @@ -387,7 +387,7 @@ function resolveLinuxSandboxArgs(electronBinaryPath) { |
| 387 | 387 | return ["--no-sandbox"]; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | export function resolveElectronPath() { | |
| 390 | function resolveElectronPath() { | |
| 391 | 391 | const electronBinaryPath = resolveElectronBinaryPath(); |
| 392 | 392 | |
| 393 | 393 | if (hostPlatform !== "darwin") { |
apps/desktop/src/backend/DesktopBackendConfiguration.ts+1| ... | ... | @@ -737,6 +737,7 @@ const resolveWslStartConfig = Effect.fn("desktop.backendConfiguration.resolveWsl |
| 737 | 737 | } satisfies DesktopBackendManager.DesktopBackendStartConfig; |
| 738 | 738 | }); |
| 739 | 739 | |
| 740 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 740 | 741 | export const make = Effect.gen(function* () { |
| 741 | 742 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 742 | 743 | const fileSystem = yield* FileSystem.FileSystem; |
apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts+1| ... | ... | @@ -42,6 +42,7 @@ export class DesktopLocalEnvironmentAuth extends Context.Service< |
| 42 | 42 | } |
| 43 | 43 | >()("@t3tools/desktop/backend/DesktopLocalEnvironmentAuth") {} |
| 44 | 44 | |
| 45 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 45 | 46 | export const make = Effect.gen(function* () { |
| 46 | 47 | const pool = yield* DesktopBackendPool.DesktopBackendPool; |
| 47 | 48 | const httpClient = yield* HttpClient.HttpClient; |
apps/desktop/src/backend/DesktopNetworkInterfaces.ts+1| ... | ... | @@ -39,6 +39,7 @@ export class DesktopNetworkInterfaces extends Context.Service< |
| 39 | 39 | } |
| 40 | 40 | >()("@t3tools/desktop/backend/DesktopNetworkInterfaces") {} |
| 41 | 41 | |
| 42 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 42 | 43 | export const make = Effect.gen(function* () { |
| 43 | 44 | const platform = yield* HostProcessPlatform; |
| 44 | 45 | return DesktopNetworkInterfaces.of({ |
apps/desktop/src/backend/DesktopServerExposure.ts+2-1| ... | ... | @@ -27,7 +27,7 @@ import { resolveTailscaleAdvertisedEndpoints } from "./tailscaleEndpointProvider |
| 27 | 27 | |
| 28 | 28 | const TAILSCALE_STATUS_CACHE_TTL = Duration.seconds(60); |
| 29 | 29 | |
| 30 | export const DESKTOP_LOOPBACK_HOST = "127.0.0.1"; | |
| 30 | const DESKTOP_LOOPBACK_HOST = "127.0.0.1"; | |
| 31 | 31 | const DESKTOP_LAN_BIND_HOST = "0.0.0.0"; |
| 32 | 32 | |
| 33 | 33 | interface ResolvedDesktopServerExposure { |
| ... | ... | @@ -411,6 +411,7 @@ const requiresBackendRelaunch = (previous: RuntimeState, next: RuntimeState): bo |
| 411 | 411 | previous.bindHost !== next.bindHost || |
| 412 | 412 | previous.localHttpUrl !== next.localHttpUrl; |
| 413 | 413 | |
| 414 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 414 | 415 | export const make = Effect.gen(function* () { |
| 415 | 416 | const config = yield* DesktopConfig.DesktopConfig; |
| 416 | 417 | const networkInterfaces = yield* DesktopNetworkInterfaces.DesktopNetworkInterfaces; |
apps/desktop/src/backend/tailscaleEndpointProvider.ts+1-1| ... | ... | @@ -14,7 +14,7 @@ import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawne |
| 14 | 14 | |
| 15 | 15 | import type { NetworkInterfaces } from "./DesktopNetworkInterfaces.ts"; |
| 16 | 16 | |
| 17 | export { isTailscaleIpv4Address, parseTailscaleMagicDnsName } from "@t3tools/tailscale"; | |
| 17 | export { parseTailscaleMagicDnsName } from "@t3tools/tailscale"; | |
| 18 | 18 | |
| 19 | 19 | const TAILSCALE_ENDPOINT_PROVIDER: AdvertisedEndpointProvider = { |
| 20 | 20 | id: "tailscale", |
apps/desktop/src/settings/DesktopAppSettings.ts+2-1| ... | ... | @@ -55,7 +55,7 @@ export interface DesktopSettingsChange { |
| 55 | 55 | readonly changed: boolean; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | export const DEFAULT_TAILSCALE_SERVE_PORT = 443; | |
| 58 | const DEFAULT_TAILSCALE_SERVE_PORT = 443; | |
| 59 | 59 | const MIN_MAIN_WINDOW_SIZE = { |
| 60 | 60 | width: 840, |
| 61 | 61 | height: 620, |
| ... | ... | @@ -450,6 +450,7 @@ const writeSettings = Effect.fn("desktop.settings.writeSettings")(function* (inp |
| 450 | 450 | ); |
| 451 | 451 | }); |
| 452 | 452 | |
| 453 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 453 | 454 | export const make = Effect.gen(function* () { |
| 454 | 455 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 455 | 456 | const fileSystem = yield* FileSystem.FileSystem; |
apps/desktop/src/settings/DesktopSavedEnvironments.ts+1-53| ... | ... | @@ -9,7 +9,6 @@ import * as Layer from "effect/Layer"; |
| 9 | 9 | import * as Option from "effect/Option"; |
| 10 | 10 | import * as Path from "effect/Path"; |
| 11 | 11 | import * as Schema from "effect/Schema"; |
| 12 | import * as Ref from "effect/Ref"; | |
| 13 | 12 | |
| 14 | 13 | import * as DesktopEnvironment from "../app/DesktopEnvironment.ts"; |
| 15 | 14 | import * as ElectronSafeStorage from "../electron/ElectronSafeStorage.ts"; |
| ... | ... | @@ -365,6 +364,7 @@ function decodeSecretBytes( |
| 365 | 364 | ); |
| 366 | 365 | } |
| 367 | 366 | |
| 367 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 368 | 368 | export const make = Effect.gen(function* () { |
| 369 | 369 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 370 | 370 | const fileSystem = yield* FileSystem.FileSystem; |
| ... | ... | @@ -555,55 +555,3 @@ export const make = Effect.gen(function* () { |
| 555 | 555 | }); |
| 556 | 556 | |
| 557 | 557 | export const layer = Layer.effect(DesktopSavedEnvironments, make); |
| 558 | ||
| 559 | export const layerTest = (input?: { | |
| 560 | readonly records?: readonly PersistedSavedEnvironmentRecord[]; | |
| 561 | readonly secrets?: ReadonlyMap<string, string>; | |
| 562 | }) => | |
| 563 | Layer.effect( | |
| 564 | DesktopSavedEnvironments, | |
| 565 | Effect.gen(function* () { | |
| 566 | const recordsRef = yield* Ref.make(input?.records ?? []); | |
| 567 | const secretsRef = yield* Ref.make(new Map(input?.secrets ?? [])); | |
| 568 | ||
| 569 | return DesktopSavedEnvironments.of({ | |
| 570 | getRegistry: Ref.get(recordsRef), | |
| 571 | setRegistry: (records) => Ref.set(recordsRef, records), | |
| 572 | removeEnvironment: (environmentId) => | |
| 573 | Ref.update(recordsRef, (records) => | |
| 574 | records.filter((record) => record.environmentId !== environmentId), | |
| 575 | ).pipe( | |
| 576 | Effect.andThen( | |
| 577 | Ref.update(secretsRef, (secrets) => { | |
| 578 | const nextSecrets = new Map(secrets); | |
| 579 | nextSecrets.delete(environmentId); | |
| 580 | return nextSecrets; | |
| 581 | }), | |
| 582 | ), | |
| 583 | ), | |
| 584 | getSecret: (environmentId) => | |
| 585 | Ref.get(secretsRef).pipe( | |
| 586 | Effect.map((secrets) => Option.fromNullishOr(secrets.get(environmentId))), | |
| 587 | ), | |
| 588 | setSecret: ({ environmentId, secret }) => | |
| 589 | Ref.get(recordsRef).pipe( | |
| 590 | Effect.flatMap((records) => { | |
| 591 | if (!records.some((record) => record.environmentId === environmentId)) { | |
| 592 | return Effect.succeed(false); | |
| 593 | } | |
| 594 | return Ref.update(secretsRef, (secrets) => { | |
| 595 | const nextSecrets = new Map(secrets); | |
| 596 | nextSecrets.set(environmentId, secret); | |
| 597 | return nextSecrets; | |
| 598 | }).pipe(Effect.as(true)); | |
| 599 | }), | |
| 600 | ), | |
| 601 | removeSecret: (environmentId) => | |
| 602 | Ref.update(secretsRef, (secrets) => { | |
| 603 | const nextSecrets = new Map(secrets); | |
| 604 | nextSecrets.delete(environmentId); | |
| 605 | return nextSecrets; | |
| 606 | }), | |
| 607 | }); | |
| 608 | }), | |
| 609 | ); |
apps/desktop/src/telemetry/DesktopTelemetryPublisher.ts+1| ... | ... | @@ -145,6 +145,7 @@ function sampleInterval( |
| 145 | 145 | return LIVE_SAMPLE_INTERVAL; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 148 | 149 | export const make = Effect.fn("desktop.telemetryPublisher.make")(function* () { |
| 149 | 150 | const electronApp = yield* ElectronApp.ElectronApp; |
| 150 | 151 | const powerMonitor = yield* ElectronPowerMonitor.ElectronPowerMonitor; |
apps/desktop/src/wsl/DesktopWslServerTree.ts+1| ... | ... | @@ -116,6 +116,7 @@ const copyTree = ( |
| 116 | 116 | }), |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 119 | 120 | export const make = Effect.gen(function* () { |
| 120 | 121 | const environment = yield* DesktopEnvironment.DesktopEnvironment; |
| 121 | 122 | const fs = yield* FileSystem.FileSystem; |