Skip to content

Commit 62c5085

Browse files
committed
now use VITE_AI_URL in desktop
1 parent 926a458 commit 62c5085

File tree

8 files changed

+21
-7
lines changed

8 files changed

+21
-7
lines changed

.github/workflows/desktop_cd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ jobs:
151151
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
152152
VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }}
153153
VITE_APP_URL: "https://hyprnote.com"
154+
VITE_AI_URL: "https://ai.hyprnote.com"
154155
VITE_API_URL: "https://api.hyprnote.com"
155156
VITE_PRO_PRODUCT_ID: ${{ secrets.VITE_PRO_PRODUCT_ID }}
156157
VITE_APP_VERSION: ${{ needs.compute-version.outputs.version }}

apps/desktop/src/components/main/sidebar/profile/auth.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ import { Button } from "@hypr/ui/components/ui/button";
55

66
import { useTabs } from "../../../../store/zustand/tabs";
77

8-
export function AuthSection({ isAuthenticated }: { isAuthenticated: boolean }) {
8+
export function AuthSection({
9+
isAuthenticated,
10+
onClose,
11+
}: {
12+
isAuthenticated: boolean;
13+
onClose: () => void;
14+
}) {
915
const openNew = useTabs((state) => state.openNew);
1016

1117
const handleOpenSettings = useCallback(() => {
1218
openNew({ type: "settings" });
13-
}, [openNew]);
19+
onClose();
20+
}, [openNew, onClose]);
1421

1522
if (isAuthenticated) {
1623
return null;

apps/desktop/src/components/main/sidebar/profile/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) {
232232
<MenuItem key={item.label} {...item} />
233233
))}
234234

235-
<AuthSection isAuthenticated={isAuthenticated} />
235+
<AuthSection
236+
isAuthenticated={isAuthenticated}
237+
onClose={closeMenu}
238+
/>
236239
</motion.div>
237240
) : (
238241
<motion.div

apps/desktop/src/components/settings/ai/llm/shared.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "@lobehub/icons";
99
import type { ReactNode } from "react";
1010

11+
import { env } from "../../../../env";
1112
import {
1213
type ProviderRequirement,
1314
requiresConfigField,
@@ -30,7 +31,7 @@ const _PROVIDERS = [
3031
displayName: "Hyprnote",
3132
badge: "Recommended",
3233
icon: <img src="/assets/icon.png" alt="Hyprnote" className="size-5" />,
33-
baseUrl: "",
34+
baseUrl: new URL("/llm", env.VITE_AI_URL).toString(),
3435
requirements: [
3536
{ kind: "requires_auth" },
3637
{ kind: "requires_entitlement", entitlement: "pro" },

apps/desktop/src/components/settings/ai/stt/shared.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type {
1010
WhisperModel,
1111
} from "@hypr/plugin-local-stt";
1212

13+
import { env } from "../../../../env";
1314
import {
1415
type ProviderRequirement,
1516
requiresEntitlement,
@@ -89,7 +90,7 @@ const _PROVIDERS = [
8990
displayName: "Hyprnote",
9091
badge: "Recommended",
9192
icon: <img src="/assets/icon.png" alt="Hyprnote" className="size-5" />,
92-
baseUrl: "https://api.hyprnote.com/v1",
93+
baseUrl: new URL("/stt", env.VITE_AI_URL).toString(),
9394
models: [
9495
"cloud",
9596
"am-parakeet-v2",

apps/desktop/src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const env = createEnv({
55
clientPrefix: "VITE_",
66
client: {
77
VITE_APP_URL: z.string().min(1).default("http://localhost:3000"),
8+
VITE_AI_URL: z.string().min(1).default("http://localhost:3001"),
89
VITE_API_URL: z.string().min(1).default("http://localhost:8787"),
910
VITE_SUPABASE_URL: z.string().min(1).optional(),
1011
VITE_SUPABASE_ANON_KEY: z.string().min(1).optional(),

apps/desktop/src/hooks/useLLMConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const resolveLLMConnection = (params: {
188188
conn: {
189189
providerId,
190190
modelId,
191-
baseUrl: env.VITE_API_URL,
191+
baseUrl: baseUrl ?? new URL("/llm", env.VITE_AI_URL).toString(),
192192
apiKey: session.access_token,
193193
},
194194
status: { status: "success", providerId, isHosted: true },

apps/desktop/src/hooks/useSTTConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const useSTTConnection = () => {
9494
return {
9595
provider: current_stt_provider,
9696
model: current_stt_model,
97-
baseUrl: `${env.VITE_API_URL}`,
97+
baseUrl: baseUrl ?? new URL("/stt", env.VITE_AI_URL).toString(),
9898
apiKey: auth.session.access_token,
9999
};
100100
}

0 commit comments

Comments
 (0)