Skip to content

The agent that grows with you

fmt(js): `npm run fix` on merge (#88014)

hermes-seaeye[bot]d378a25e8502
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 265ce7a5a02..90f7abdc8d8 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -9490,9 +9490,7 @@ async function stopRegistryConnectionBackends(connectionId) {
const sshScopes = new Set([
...[...sshConnections.keys()].filter(scope => String(scope).startsWith(prefix)),
- ...[...sshBootstrapCoordinator.active]
- .map(entry => entry.scope)
- .filter(scope => String(scope).startsWith(prefix))
+ ...[...sshBootstrapCoordinator.active].map(entry => entry.scope).filter(scope => String(scope).startsWith(prefix))
])
await Promise.all(
@@ -12772,9 +12770,8 @@ ipcMain.handle('hermes:api', async (_event, request) => {
if (registryConnectionId) {
const connection: any = await ensureRegistryBackend(registryConnectionId, request?.profile)
- const requestPath = connection.sharedRemote
- ? pathWithProfileScope(request.path, request?.profile)
- : request.path
+
+ const requestPath = connection.sharedRemote ? pathWithProfileScope(request.path, request?.profile) : request.path
return fetchJsonForBackend(connection, requestPath, {
method: request?.method,
diff --git a/apps/desktop/electron/plugin-profile-routes.test.ts b/apps/desktop/electron/plugin-profile-routes.test.ts
index d8deedc23af..1b2ba0a1ec2 100644
--- a/apps/desktop/electron/plugin-profile-routes.test.ts
+++ b/apps/desktop/electron/plugin-profile-routes.test.ts
@@ -57,7 +57,9 @@ describe('buildOpaqueProfileRoutes', () => {
resolveSsh
})
- expect(routes.map(route => ({ mode: route.mode, profile: route.profile, targetProfile: route.targetProfile }))).toEqual([
+ expect(
+ routes.map(route => ({ mode: route.mode, profile: route.profile, targetProfile: route.targetProfile }))
+ ).toEqual([
{ mode: 'local', profile: 'default', targetProfile: 'default' },
{ mode: 'remote', profile: 'research', targetProfile: 'remote-research' },
{ mode: 'remote', profile: 'writing', targetProfile: 'remote-writing' }
@@ -152,9 +154,7 @@ describe('buildOpaqueProfileRoutes', () => {
it('reports the backend root for a per-profile URL alias', async () => {
const routes = await buildOpaqueProfileRoutes({
getProfileConfig: profile =>
- profile === 'barry'
- ? config({ mode: 'remote', remoteUrl: 'https://tower.example' })
- : config(),
+ profile === 'barry' ? config({ mode: 'remote', remoteUrl: 'https://tower.example' }) : config(),
globalConfig: config(),
installationId: 'install-a-secret',
primaryProfile: 'default',
@@ -207,9 +207,7 @@ describe('buildRegistryProfileRoutes', () => {
{ connectionId: 'local', profile: 'research' },
{ connectionId: 'homelab', profile: 'research' }
],
- legacyRoutes: [
- { connectionId: 'legacy-hash', mode: 'local', profile: 'research', targetProfile: 'research' }
- ],
+ legacyRoutes: [{ connectionId: 'legacy-hash', mode: 'local', profile: 'research', targetProfile: 'research' }],
sources: [
{ id: 'local', kind: 'local', label: 'This device' },
{
@@ -238,27 +236,20 @@ describe('buildRegistryProfileRoutes', () => {
it('keeps the registry local source genuinely local when legacy v1 routing is remote', () => {
const routes = buildRegistryProfileRoutes({
agents: [{ connectionId: 'local', profile: 'barry' }],
- legacyRoutes: [
- { connectionId: 'legacy-hash', mode: 'remote', profile: 'barry', targetProfile: 'default' }
- ],
+ legacyRoutes: [{ connectionId: 'legacy-hash', mode: 'remote', profile: 'barry', targetProfile: 'default' }],
sources: [{ id: 'local', kind: 'local', label: 'This device' }]
})
- expect(routes).toEqual([
- { connectionId: 'local', mode: 'local', profile: 'barry', targetProfile: 'barry' }
- ])
+ expect(routes).toEqual([{ connectionId: 'local', mode: 'local', profile: 'barry', targetProfile: 'barry' }])
})
it('scopes registry-shared remote websocket URLs to the requested profile', () => {
expect(
- registryGatewayWsUrl(
- { profile: 'research', sharedRemote: true },
- 'wss://gateway.example/api/ws?token=secret'
- )
+ registryGatewayWsUrl({ profile: 'research', sharedRemote: true }, 'wss://gateway.example/api/ws?token=secret')
).toBe('wss://gateway.example/api/ws?token=secret&profile=research')
- expect(
- registryGatewayWsUrl({ profile: 'research' }, 'ws://127.0.0.1:5151/api/ws?token=local')
- ).toBe('ws://127.0.0.1:5151/api/ws?token=local')
+ expect(registryGatewayWsUrl({ profile: 'research' }, 'ws://127.0.0.1:5151/api/ws?token=local')).toBe(
+ 'ws://127.0.0.1:5151/api/ws?token=local'
+ )
})
})
@@ -266,10 +257,7 @@ describe('localRouteFallbackProfiles', () => {
it('restores failed local profiles when another source returned agents', () => {
const agents = [{ connectionId: 'cloud-prod', profile: 'default' }]
- expect(localRouteFallbackProfiles(agents, 'local', ['default', 'venture'], true)).toEqual([
- 'default',
- 'venture'
- ])
+ expect(localRouteFallbackProfiles(agents, 'local', ['default', 'venture'], true)).toEqual(['default', 'venture'])
})
it('does not synthesize local routes after a successful local enumeration', () => {
@@ -280,10 +268,13 @@ describe('localRouteFallbackProfiles', () => {
describe('undialedSshRouteSeeds', () => {
it('keeps a stable default route while retaining the configured backend target', () => {
expect(
- undialedSshRouteSeeds([], [
- { id: 'homelab', kind: 'ssh', remoteProfile: 'venture' },
- { id: 'cloud-prod', kind: 'cloud' }
- ])
+ undialedSshRouteSeeds(
+ [],
+ [
+ { id: 'homelab', kind: 'ssh', remoteProfile: 'venture' },
+ { id: 'cloud-prod', kind: 'cloud' }
+ ]
+ )
).toEqual([{ connectionId: 'homelab', profile: 'default' }])
})
diff --git a/apps/desktop/electron/plugin-profile-routes.ts b/apps/desktop/electron/plugin-profile-routes.ts
index 1d2ae81122d..9f002fc5c27 100644
--- a/apps/desktop/electron/plugin-profile-routes.ts
+++ b/apps/desktop/electron/plugin-profile-routes.ts
@@ -63,9 +63,7 @@ export function localRouteFallbackProfiles(
}
const existing = new Set(
- agents
- .filter(agent => agent.connectionId === localConnectionId)
- .map(agent => normalizeProfile(agent.profile))
+ agents.filter(agent => agent.connectionId === localConnectionId).map(agent => normalizeProfile(agent.profile))
)
const fallback: string[] = []
diff --git a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
index 9c69c0e2fcc..8c23f60bd61 100644
--- a/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
+++ b/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts
@@ -29,7 +29,12 @@ import {
} from '@/store/gateway'
import { $gatewaySwitching, wipeSessionListsForGatewaySwitch } from '@/store/gateway-switch'
import { notify, notifyError } from '@/store/notifications'
-import { $activeGatewayProfile, normalizeProfileKey, refreshActiveProfile, touchActiveGatewayBackend } from '@/store/profile'
+import {
+ $activeGatewayProfile,
+ normalizeProfileKey,
+ refreshActiveProfile,
+ touchActiveGatewayBackend
+} from '@/store/profile'
import {
$activeSessionId,
$connection,
diff --git a/apps/desktop/src/lib/connection-scoped.ts b/apps/desktop/src/lib/connection-scoped.ts
index a9b4542b629..4831b9f90d0 100644
--- a/apps/desktop/src/lib/connection-scoped.ts
+++ b/apps/desktop/src/lib/connection-scoped.ts
@@ -58,7 +58,7 @@ interface ScopedEntry<T> {
}
let activeSuffix = ''
-
+
const registry: ScopedEntry<any>[] = []
const scopeListeners = new Set<() => void>()
diff --git a/apps/desktop/src/store/gateway.ts b/apps/desktop/src/store/gateway.ts
index 0aa8bcf53ee..b9640203143 100644
--- a/apps/desktop/src/store/gateway.ts
+++ b/apps/desktop/src/store/gateway.ts
@@ -699,12 +699,7 @@ export async function ensureGatewayForProfile(profile: string): Promise<void> {
}
}
- if (
- entry.wantOpen &&
- g.secondaries.get(key) === entry &&
- applyActive(key, activationEpoch) &&
- entry.connection
- ) {
+ if (entry.wantOpen && g.secondaries.get(key) === entry && applyActive(key, activationEpoch) && entry.connection) {
publishActiveConnection(entry.connection)
}
}
diff --git a/apps/desktop/src/store/profile.test.ts b/apps/desktop/src/store/profile.test.ts
index 14d6de5f0a2..c2e7cf36c02 100644
--- a/apps/desktop/src/store/profile.test.ts
+++ b/apps/desktop/src/store/profile.test.ts
@@ -20,8 +20,14 @@ vi.mock('@/hermes', () => ({
vi.mock('@/lib/query-client', () => ({ invalidateProfileScopedQueries: vi.fn() }))
vi.mock('@/store/starmap', () => ({ resetStarmapGraph }))
-const { $activeGatewayProfile, $profiles, ensureGatewayProfile, invalidateProfileListFetches, prewarmProfileBackend, refreshProfiles } =
- await import('./profile')
+const {
+ $activeGatewayProfile,
+ $profiles,
+ ensureGatewayProfile,
+ invalidateProfileListFetches,
+ prewarmProfileBackend,
+ refreshProfiles
+} = await import('./profile')
const { $connection } = await import('./session')
const { invalidateProfileScopedQueries } = await import('@/lib/query-client')
@@ -181,9 +187,7 @@ describe('stale profile-list fetches across a backend switch (#85731)', () => {
// The soft re-home fetches backend B's list, then A's late (often empty /
// default-only) response lands LAST and collapses the rail.
let resolveOld: (value: { profiles: ProfileInfo[] }) => void = () => undefined
- vi.mocked(getProfiles).mockImplementationOnce(
- () => new Promise(resolve => (resolveOld = resolve))
- )
+ vi.mocked(getProfiles).mockImplementationOnce(() => new Promise(resolve => (resolveOld = resolve)))
const oldFetch = refreshProfiles() // in flight against backend A
@@ -218,9 +222,7 @@ describe('stale profile-list fetches across a backend switch (#85731)', () => {
// routing to another backend mid-fetch. The $activeGatewayProfile
// subscriber must bump the epoch exactly like the connection-apply wipe.
let resolveOld: (value: { profiles: ProfileInfo[] }) => void = () => undefined
- vi.mocked(getProfiles).mockImplementationOnce(
- () => new Promise(resolve => (resolveOld = resolve))
- )
+ vi.mocked(getProfiles).mockImplementationOnce(() => new Promise(resolve => (resolveOld = resolve)))
const oldFetch = refreshProfiles() // in flight against the old profile's backend