Skip to content

Commit ee31863

Browse files
Merge branch 'main' into fix/composer-resting-height-v2
2 parents ee94cc2 + 1f7a3c1 commit ee31863

287 files changed

Lines changed: 13698 additions & 5102 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.macroscope/check-run-agents/effect-service-conventions.md‎

Lines changed: 31 additions & 58 deletions
Large diffs are not rendered by default.

‎apps/desktop/src/backend/DesktopBackendManager.ts‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,13 @@ export const makeBackendInstance = Effect.fn("makeBackendInstance")(function* (
663663
Ref.update(state, withActiveRun(runId, f));
664664

665665
const snapshot = Ref.get(state).pipe(
666-
Effect.map(
667-
(current): DesktopBackendSnapshot => ({
668-
desiredRunning: current.desiredRunning,
669-
ready: current.ready,
670-
activePid: activePid(current.active),
671-
restartAttempt: current.restartAttempt,
672-
restartScheduled: Option.isSome(current.restartFiber),
673-
}),
674-
),
666+
Effect.map((current): DesktopBackendSnapshot => ({
667+
desiredRunning: current.desiredRunning,
668+
ready: current.ready,
669+
activePid: activePid(current.active),
670+
restartAttempt: current.restartAttempt,
671+
restartScheduled: Option.isSome(current.restartFiber),
672+
})),
675673
);
676674
const currentConfig = Ref.get(state).pipe(Effect.map((current) => current.config));
677675

‎apps/desktop/src/ipc/DesktopIpcHandlers.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
fetchSshEnvironmentDescriptor,
2222
fetchSshSessionState,
2323
issueSshWebSocketTicket,
24+
resolveSshHost,
2425
resolveSshPasswordPrompt,
2526
} from "./methods/sshEnvironment.ts";
2627
import {
@@ -68,6 +69,7 @@ export const installDesktopIpcHandlers = Effect.fn("desktop.ipc.installHandlers"
6869
yield* ipc.handle(clearConnectionCatalog);
6970

7071
yield* ipc.handle(discoverSshHosts);
72+
yield* ipc.handle(resolveSshHost);
7173
yield* ipc.handle(ensureSshEnvironment);
7274
yield* ipc.handle(disconnectSshEnvironment);
7375
yield* ipc.handle(fetchSshEnvironmentDescriptor);

‎apps/desktop/src/ipc/channels.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const GET_CONNECTION_CATALOG_CHANNEL = "desktop:get-connection-catalog";
2929
export const SET_CONNECTION_CATALOG_CHANNEL = "desktop:set-connection-catalog";
3030
export const CLEAR_CONNECTION_CATALOG_CHANNEL = "desktop:clear-connection-catalog";
3131
export const DISCOVER_SSH_HOSTS_CHANNEL = "desktop:discover-ssh-hosts";
32+
export const RESOLVE_SSH_HOST_CHANNEL = "desktop:resolve-ssh-host";
3233
export const ENSURE_SSH_ENVIRONMENT_CHANNEL = "desktop:ensure-ssh-environment";
3334
export const DISCONNECT_SSH_ENVIRONMENT_CHANNEL = "desktop:disconnect-ssh-environment";
3435
export const FETCH_SSH_ENVIRONMENT_DESCRIPTOR_CHANNEL = "desktop:fetch-ssh-environment-descriptor";

‎apps/desktop/src/ipc/methods/sshEnvironment.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ export const discoverSshHosts = DesktopIpc.makeIpcMethod({
117117
}),
118118
});
119119

120+
export const resolveSshHost = DesktopIpc.makeIpcMethod({
121+
channel: IpcChannels.RESOLVE_SSH_HOST_CHANNEL,
122+
payload: Schema.String,
123+
result: DesktopSshEnvironmentTargetSchema,
124+
handler: Effect.fn("desktop.ipc.sshEnvironment.resolveHost")(function* (alias) {
125+
const sshEnvironment = yield* DesktopSshEnvironment.DesktopSshEnvironment;
126+
return yield* sshEnvironment.resolveHost(alias);
127+
}),
128+
});
129+
120130
export const ensureSshEnvironment = DesktopIpc.makeIpcMethod({
121131
channel: IpcChannels.ENSURE_SSH_ENVIRONMENT_CHANNEL,
122132
payload: DesktopSshEnvironmentEnsureInputSchema,

‎apps/desktop/src/preload.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ contextBridge.exposeInMainWorld("desktopBridge", {
6060
ipcRenderer.invoke(IpcChannels.SET_CONNECTION_CATALOG_CHANNEL, catalog),
6161
clearConnectionCatalog: () => ipcRenderer.invoke(IpcChannels.CLEAR_CONNECTION_CATALOG_CHANNEL),
6262
discoverSshHosts: () => ipcRenderer.invoke(IpcChannels.DISCOVER_SSH_HOSTS_CHANNEL),
63+
resolveSshHost: (alias) => ipcRenderer.invoke(IpcChannels.RESOLVE_SSH_HOST_CHANNEL, alias),
6364
ensureSshEnvironment: async (target, options) =>
6465
unwrapEnsureSshEnvironmentResult(
6566
await ipcRenderer.invoke(IpcChannels.ENSURE_SSH_ENVIRONMENT_CHANNEL, {

‎apps/desktop/src/preview-pip-preload.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @effect-diagnostics globalDate:off - This isolated Electron preload does not run inside an Effect runtime.
21
import type { DesktopPreviewRecordingFrame } from "@t3tools/contracts";
32
import { contextBridge, ipcRenderer } from "electron";
43

‎apps/desktop/src/settings/DesktopClientSettings.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const clientSettings: ClientSettings = {
1818
browserDefaultZoomFactor: 1.25,
1919
browserDefaultAppearance: "dark",
2020
browserRecordingFrameRate: 60,
21+
browserLinkTarget: "app",
2122
browserAutoShowFloatingPreview: false,
2223
browserProfiles: [{ id: "work", name: "Work", kind: "persistent" }],
2324
browserDefaultProfileId: "work",
@@ -29,6 +30,7 @@ const clientSettings: ClientSettings = {
2930
contextWindowMeterEnabled: false,
3031
dismissedProviderUpdateNotificationKeys: [],
3132
diffIgnoreWhitespace: true,
33+
diffLayout: "stacked",
3234
environmentIdentificationMode: "artwork",
3335
favorites: [],
3436
fontFamilyCode: "",

‎apps/desktop/src/ssh/DesktopSshEnvironment.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
} from "@t3tools/contracts";
66
import * as NetService from "@t3tools/shared/Net";
77
import * as SshAuth from "@t3tools/ssh/auth";
8+
import { resolveSshTarget } from "@t3tools/ssh/command";
89
import { discoverSshHosts } from "@t3tools/ssh/config";
910
import {
1011
SshCommandError,
@@ -54,6 +55,9 @@ export class DesktopSshEnvironment extends Context.Service<
5455
readonly discoverHosts: (input?: {
5556
readonly homeDir?: string;
5657
}) => Effect.Effect<readonly DesktopDiscoveredSshHost[], DesktopSshEnvironmentDiscoverError>;
58+
readonly resolveHost: (
59+
alias: string,
60+
) => Effect.Effect<DesktopSshEnvironmentTarget, SshCommandError | SshInvalidTargetError>;
5761
readonly ensureEnvironment: (
5862
target: DesktopSshEnvironmentTarget,
5963
options?: { readonly issuePairingToken?: boolean },
@@ -136,6 +140,11 @@ export const make = Effect.gen(function* () {
136140
Effect.provide(runtimeContext),
137141
Effect.withSpan("desktop.ssh.discoverHosts"),
138142
),
143+
resolveHost: (alias) =>
144+
resolveSshTarget(alias.trim()).pipe(
145+
Effect.provide(runtimeContext),
146+
Effect.withSpan("desktop.ssh.resolveHost"),
147+
),
139148
ensureEnvironment: (target, ensureOptions) =>
140149
manager
141150
.ensureEnvironment(target, ensureOptions)

0 commit comments

Comments
 (0)