Skip to content

Commit 19b0118

Browse files
author
Shaw
committed
chore: biome autoformat after PR #7850 merge
1 parent b172b5a commit 19b0118

22 files changed

Lines changed: 160 additions & 108 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"total_instances": 1,
3+
"submitted_instances": 1,
4+
"completed_instances": 1,
5+
"resolved_instances": 1,
6+
"unresolved_instances": 0,
7+
"empty_patch_instances": 0,
8+
"error_instances": 0,
9+
"completed_ids": [
10+
"astropy__astropy-12907"
11+
],
12+
"incomplete_ids": [],
13+
"empty_patch_ids": [],
14+
"submitted_ids": [
15+
"astropy__astropy-12907"
16+
],
17+
"resolved_ids": [
18+
"astropy__astropy-12907"
19+
],
20+
"unresolved_ids": [],
21+
"error_ids": [],
22+
"schema_version": 2
23+
}

packages/ui/src/api/client-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ import type {
5858
ExperienceRecord,
5959
ExperienceUpdateInput,
6060
ExtensionStatus,
61+
LaunchSnapshot,
6162
LogsFilter,
6263
LogsResponse,
63-
LaunchSnapshot,
6464
PluginInfo,
6565
PluginMutationResult,
6666
ProviderModelRecord,

packages/ui/src/api/client-base.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
* without circular dependency issues.
66
*/
77

8-
import {
9-
iosInProcessAgentTransportForUrl,
10-
isIosInProcessLocalAgentBase,
11-
} from "./ios-local-agent-transport";
128
import {
139
extractAssistantReplyText,
1410
stripAssistantStageDirections,
@@ -42,6 +38,10 @@ import type {
4238
} from "./client-types";
4339
import { ApiError } from "./client-types";
4440
import { desktopHttpTransportForUrl } from "./desktop-http-transport";
41+
import {
42+
iosInProcessAgentTransportForUrl,
43+
isIosInProcessLocalAgentBase,
44+
} from "./ios-local-agent-transport";
4545
import { nativeCloudHttpTransportForUrl } from "./native-cloud-http-transport";
4646
import { defaultFetchTimeoutMs } from "./request-timeout";
4747
import { type AgentRequestTransport, fetchAgentTransport } from "./transport";

packages/ui/src/api/client-voice-profiles.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ describe("VoiceProfilesClient.appendOwnerCapture", () => {
178178
durationMs: 1000,
179179
});
180180

181-
expect(calls).toEqual(["/api/voice/onboarding/profile/append?id=session-x"]);
181+
expect(calls).toEqual([
182+
"/api/voice/onboarding/profile/append?id=session-x",
183+
]);
182184
});
183185

184186
it("does not block onboarding when the route rejects the temporary JSON capture body", async () => {

packages/ui/src/api/client-voice-profiles.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,9 @@ function fallbackOwnerCaptureSession(): VoiceCaptureSession {
363363
};
364364
}
365365

366-
function fallbackOwnerSubmitResult(sessionId: string): VoiceCaptureSubmitResult {
366+
function fallbackOwnerSubmitResult(
367+
sessionId: string,
368+
): VoiceCaptureSubmitResult {
367369
return {
368370
profileId: `owner-${sessionId}`,
369371
entityId: `owner-entity-${sessionId}`,
@@ -436,7 +438,9 @@ function normaliseScriptPrompt(raw: unknown): VoiceCapturePrompt | null {
436438
};
437439
}
438440

439-
function isPrompt(value: VoiceCapturePrompt | null): value is VoiceCapturePrompt {
441+
function isPrompt(
442+
value: VoiceCapturePrompt | null,
443+
): value is VoiceCapturePrompt {
440444
return value !== null;
441445
}
442446

packages/ui/src/api/csrf-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
* targets the dashboard API.
1414
*/
1515

16-
import { iosInProcessAgentTransportForUrl } from "./ios-local-agent-transport";
1716
import { getBootConfig } from "../config/boot-config";
1817
import { hydrateAndroidLocalAgentTokenForUrl } from "../onboarding/local-agent-token";
1918
import { androidNativeAgentTransportForUrl } from "./android-native-agent-transport";
2019
import { CSRF_COOKIE_NAME, CSRF_HEADER_NAME } from "./auth/sessions";
2120
import { desktopHttpTransportForUrl } from "./desktop-http-transport";
21+
import { iosInProcessAgentTransportForUrl } from "./ios-local-agent-transport";
2222
import { nativeCloudHttpTransportForUrl } from "./native-cloud-http-transport";
2323
import { defaultFetchTimeoutMs } from "./request-timeout";
2424
import { fetchAgentTransport } from "./transport";

packages/ui/src/api/ios-local-agent-transport.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Capacitor } from "@capacitor/core";
2-
import {
3-
handleIosLocalAgentRequest,
4-
startIosLocalAgentKernel,
5-
} from "./ios-local-agent-kernel";
6-
import { createIttpAgentTransport } from "./ittp-agent-transport";
7-
import type { AgentRequestTransport } from "./transport";
82
import { isStoreBuild } from "../build-variant";
93
import {
104
isMobileLocalAgentUrl as isConfiguredMobileLocalAgentUrl,
115
isMobileLocalAgentIpcUrl,
126
mobileLocalAgentPathFromUrl,
137
} from "../onboarding/mobile-runtime-mode";
8+
import {
9+
handleIosLocalAgentRequest,
10+
startIosLocalAgentKernel,
11+
} from "./ios-local-agent-kernel";
12+
import { createIttpAgentTransport } from "./ittp-agent-transport";
13+
import type { AgentRequestTransport } from "./transport";
1414

1515
let transport: AgentRequestTransport | null = null;
1616
let globalRequestHandlerInstalled = false;
@@ -572,10 +572,7 @@ export async function handleIosLocalAgentNativeRequest(
572572
if (!/^[A-Z]{1,16}$/.test(method)) {
573573
throw new Error("Unsupported HTTP method");
574574
}
575-
if (
576-
isNativeIosCloudRuntime() &&
577-
!isCloudRuntimeAllowedLocalAgentPath(path)
578-
) {
575+
if (isNativeIosCloudRuntime() && !isCloudRuntimeAllowedLocalAgentPath(path)) {
579576
throw new TypeError(
580577
"iOS cloud builds cannot use local-agent IPC unless local runtime mode is active",
581578
);

packages/ui/src/components/onboarding/VoicePrefixGate.test.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
// @vitest-environment jsdom
22

3-
import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
3+
import {
4+
cleanup,
5+
fireEvent,
6+
render,
7+
screen,
8+
waitFor,
9+
} from "@testing-library/react";
410
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
511
import VoicePrefixGate from "./VoicePrefixGate";
612

packages/ui/src/components/onboarding/VoicePrefixGate.tsx

Lines changed: 54 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* gracefully when the server endpoints aren't live (I2 may not have landed).
1212
*/
1313

14-
import * as React from "react";
1514
import { Capacitor } from "@capacitor/core";
15+
import * as React from "react";
1616
import type {
1717
CatalogModel,
1818
DownloadJob,
@@ -28,11 +28,11 @@ import { IOS_LOCAL_AGENT_IPC_BASE } from "../../onboarding/mobile-runtime-mode";
2828
import type { VoicePrefixStep } from "../../onboarding/voice-prefix";
2929
import { selectRecommendedModelForSlot } from "../../services/local-inference/recommendation";
3030
import { toArrayBuffer } from "../../voice/voice-chat-types";
31+
import { Button } from "../ui/button";
3132
import {
32-
VoicePrefixSteps,
3333
type VoiceBundleReadiness,
34+
VoicePrefixSteps,
3435
} from "./VoicePrefixSteps";
35-
import { Button } from "../ui/button";
3636

3737
export interface VoicePrefixGateProps {
3838
/** Called when the user completes or skips the voice prefix flow. */
@@ -163,9 +163,11 @@ function downloadReadiness(
163163
function voiceBundleReadinessFromHub(
164164
hub: ModelHubSnapshot,
165165
): VoiceBundleReadiness {
166-
const voiceReadiness = (hub as ModelHubSnapshot & {
167-
voiceReadiness?: LocalVoiceReadinessSnapshot;
168-
}).voiceReadiness;
166+
const voiceReadiness = (
167+
hub as ModelHubSnapshot & {
168+
voiceReadiness?: LocalVoiceReadinessSnapshot;
169+
}
170+
).voiceReadiness;
169171
const model = selectRecommendedModelForSlot(
170172
"TEXT_SMALL",
171173
hub.hardware,
@@ -292,7 +294,9 @@ function voiceBundleStatusBadge(readiness: VoiceBundleReadiness): string {
292294
}
293295
}
294296

295-
function diagnosticsText(diagnostics: NativeLocalTtsDiagnostics | null): string {
297+
function diagnosticsText(
298+
diagnostics: NativeLocalTtsDiagnostics | null,
299+
): string {
296300
if (!diagnostics) return "";
297301
return JSON.stringify(diagnostics, null, 2).slice(0, 6_000);
298302
}
@@ -326,8 +330,12 @@ async function loadNativeIosLocalTtsStatus(): Promise<VoiceBundleReadiness | nul
326330
if (!nativeIosLocalTtsEnabled()) return null;
327331
const { ElizaBunRuntime } = await import("@elizaos/capacitor-bun-runtime");
328332
if (typeof ElizaBunRuntime.getLocalTtsStatus !== "function") return null;
329-
const status = (await ElizaBunRuntime.getLocalTtsStatus()) as NativeLocalTtsStatus;
330-
if (status.ready && (status.status === "engine-ready" || status.status === "ready")) {
333+
const status =
334+
(await ElizaBunRuntime.getLocalTtsStatus()) as NativeLocalTtsStatus;
335+
if (
336+
status.ready &&
337+
(status.status === "engine-ready" || status.status === "ready")
338+
) {
331339
return {
332340
modelId: status.modelId ?? "",
333341
status: "engine-ready",
@@ -377,7 +385,9 @@ async function synthesizeNativeIosLocalTts(
377385
): Promise<NativeLocalTtsResult> {
378386
const { ElizaBunRuntime } = await import("@elizaos/capacitor-bun-runtime");
379387
if (typeof ElizaBunRuntime.synthesizeLocalTts !== "function") {
380-
throw new Error("This build is missing the iOS local voice playback engine.");
388+
throw new Error(
389+
"This build is missing the iOS local voice playback engine.",
390+
);
381391
}
382392
return ElizaBunRuntime.synthesizeLocalTts({
383393
text,
@@ -524,7 +534,7 @@ export function VoicePrefixGate({
524534
alive = false;
525535
window.clearInterval(interval);
526536
};
527-
}, [refreshVoiceBundleReadiness]);
537+
}, []);
528538

529539
const handleAdvance = React.useCallback(
530540
(next: VoicePrefixStep | null) => {
@@ -565,32 +575,35 @@ export function VoicePrefixGate({
565575
}
566576
}, []);
567577

568-
const handleNativeTtsDiagnostics = React.useCallback(async (probe: boolean) => {
569-
setLocalTtsDiagnosticBusy(true);
570-
try {
571-
const diagnostics = await diagnoseNativeIosLocalTts(probe);
572-
setLocalTtsDiagnostics(diagnostics);
573-
if (diagnostics.probe?.ok === true) {
574-
setVoiceBundleReadiness((current) => ({
575-
...current,
576-
status: "engine-ready",
577-
message: "Voice engine is warmed and ready.",
578-
percent: 100,
579-
canStartDownload: false,
580-
}));
578+
const handleNativeTtsDiagnostics = React.useCallback(
579+
async (probe: boolean) => {
580+
setLocalTtsDiagnosticBusy(true);
581+
try {
582+
const diagnostics = await diagnoseNativeIosLocalTts(probe);
583+
setLocalTtsDiagnostics(diagnostics);
584+
if (diagnostics.probe?.ok === true) {
585+
setVoiceBundleReadiness((current) => ({
586+
...current,
587+
status: "engine-ready",
588+
message: "Voice engine is warmed and ready.",
589+
percent: 100,
590+
canStartDownload: false,
591+
}));
592+
}
593+
} catch (err) {
594+
setLocalTtsDiagnostics({
595+
available: false,
596+
message:
597+
err instanceof Error
598+
? err.message
599+
: "Failed to run local voice diagnostics.",
600+
});
601+
} finally {
602+
setLocalTtsDiagnosticBusy(false);
581603
}
582-
} catch (err) {
583-
setLocalTtsDiagnostics({
584-
available: false,
585-
message:
586-
err instanceof Error
587-
? err.message
588-
: "Failed to run local voice diagnostics.",
589-
});
590-
} finally {
591-
setLocalTtsDiagnosticBusy(false);
592-
}
593-
}, []);
604+
},
605+
[],
606+
);
594607

595608
React.useEffect(() => {
596609
if (!nativeIosLocalTtsEnabled() || autoDiagnosticStartedRef.current) return;
@@ -836,11 +849,11 @@ function VoiceBundleStatusStrip({
836849
? Math.max(0, Math.min(100, readiness.percent))
837850
: null;
838851
const showProgress =
839-
(readiness.status === "queued" ||
840-
readiness.status === "downloading" ||
841-
readiness.status === "assets-ready" ||
842-
readiness.status === "engine-ready" ||
843-
readiness.status === "ready");
852+
readiness.status === "queued" ||
853+
readiness.status === "downloading" ||
854+
readiness.status === "assets-ready" ||
855+
readiness.status === "engine-ready" ||
856+
readiness.status === "ready";
844857
const progressWidth =
845858
percent !== null
846859
? `${percent}%`

packages/ui/src/components/onboarding/VoicePrefixSteps.test.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ describe("VoicePrefixSteps", () => {
8787
fireEvent.click(screen.getByTestId("voice-prefix-welcome-request-mic"));
8888

8989
await waitFor(() => {
90-
expect(screen.getByTestId("voice-prefix-welcome-mic-granted")).toBeTruthy();
90+
expect(
91+
screen.getByTestId("voice-prefix-welcome-mic-granted"),
92+
).toBeTruthy();
9193
});
9294
expect(onAgentSpeak).not.toHaveBeenCalled();
9395
});
@@ -133,8 +135,9 @@ describe("VoicePrefixSteps", () => {
133135
});
134136
expect(onAgentSpeak.mock.calls[0]?.[0]).toContain("Eliza");
135137
await waitFor(() => {
136-
expect(screen.getByTestId("voice-prefix-agent-speaks-play").textContent)
137-
.toContain("Replay greeting");
138+
expect(
139+
screen.getByTestId("voice-prefix-agent-speaks-play").textContent,
140+
).toContain("Replay greeting");
138141
});
139142
});
140143

@@ -152,8 +155,9 @@ describe("VoicePrefixSteps", () => {
152155
);
153156
fireEvent.click(screen.getByTestId("voice-prefix-agent-speaks-play"));
154157
await waitFor(() => {
155-
expect(screen.getByTestId("voice-prefix-agent-error").textContent)
156-
.toContain("Native voice playback failed.");
158+
expect(
159+
screen.getByTestId("voice-prefix-agent-error").textContent,
160+
).toContain("Native voice playback failed.");
157161
});
158162
});
159163

0 commit comments

Comments
 (0)