chore(auto): task completed - unknown
This commit is contained in:
@@ -6,7 +6,6 @@ import { createLogger } from "../lib/logger.js";
|
||||
const logger = createLogger("api");
|
||||
|
||||
const BE_API_URL = import.meta.env.VITE_BE_API_URL || "http://localhost:3001";
|
||||
const BE_WS_URL = import.meta.env.VITE_BE_WS_URL || "ws://localhost:3001";
|
||||
|
||||
class ApiError extends Error {
|
||||
code: string;
|
||||
@@ -52,10 +51,6 @@ export async function request<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getWebSocketURL(): string {
|
||||
return BE_WS_URL;
|
||||
}
|
||||
|
||||
export function getAPIURL(): string {
|
||||
return BE_API_URL;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// ─── Audio transmit hook — captures mic, encodes to PCM, sends via WebSocket ──
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import { getAPIURL } from "../api/client.js";
|
||||
import { createChildLogger } from "../logger.js";
|
||||
import { createLogger } from "../lib/logger";
|
||||
|
||||
const SAMPLE_RATE = 24000;
|
||||
const logger = createChildLogger("useAudioTransmit");
|
||||
const logger = createLogger("useAudioTransmit");
|
||||
|
||||
async function sendTransmitCommand(command: string): Promise<void> {
|
||||
// Send via HTTP API (kept as exported function for backward compatibility)
|
||||
|
||||
@@ -99,7 +99,7 @@ export function useGsapTransition(tabKey: string) {
|
||||
return { pageRef, animateIn, animateOut };
|
||||
}
|
||||
|
||||
export function gsapCardHover() {
|
||||
function gsapCardHover() {
|
||||
return {
|
||||
onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {
|
||||
gsap.to(e.currentTarget, {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useCallback, useState } from "react";
|
||||
import type { ChatResponse } from "../api/client";
|
||||
import { request } from "../api/client";
|
||||
import { createChildLogger } from "../logger";
|
||||
import { createLogger } from "../lib/logger";
|
||||
|
||||
const logger = createChildLogger("useMascotChat");
|
||||
const logger = createLogger("useMascotChat");
|
||||
|
||||
export interface ChatContext {
|
||||
messageCount: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from "react";
|
||||
import type { UIState } from "../../entities/ui/types";
|
||||
import type { UIState } from "../api/client";
|
||||
import { uiStateValidator, useLocalStorage } from "./useLocalStorage";
|
||||
|
||||
export function useUIState() {
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// Simple logger for frontend - structured logging wrapper
|
||||
type LogLevel = "debug" | "info" | "warn" | "error";
|
||||
|
||||
interface LogContext {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
class Logger {
|
||||
constructor(private context: string) {}
|
||||
|
||||
private log(level: LogLevel, message: string, context?: LogContext) {
|
||||
const timestamp = new Date().toISOString();
|
||||
const logData = {
|
||||
level,
|
||||
context: this.context,
|
||||
message,
|
||||
timestamp,
|
||||
...context,
|
||||
};
|
||||
|
||||
// Use appropriate console method
|
||||
const consoleMethod = console[level] || console.log;
|
||||
consoleMethod(
|
||||
`[${level.toUpperCase()}] [${this.context}]`,
|
||||
message,
|
||||
context || "",
|
||||
);
|
||||
}
|
||||
|
||||
debug(message: string, context?: LogContext) {
|
||||
this.log("debug", message, context);
|
||||
}
|
||||
|
||||
info(message: string, context?: LogContext) {
|
||||
this.log("info", message, context);
|
||||
}
|
||||
|
||||
warn(message: string, context?: LogContext) {
|
||||
this.log("warn", message, context);
|
||||
}
|
||||
|
||||
error(message: string, context?: LogContext) {
|
||||
this.log("error", message, context);
|
||||
}
|
||||
}
|
||||
|
||||
export function createChildLogger(context: string): Logger {
|
||||
return new Logger(context);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LayoutDashboard, MessageSquare, Radio } from "lucide-react";
|
||||
import type { DashboardTab } from "../../entities/ui/types";
|
||||
import type { DashboardTab } from "../api/client";
|
||||
import { cn } from "../lib/utils";
|
||||
|
||||
const tabs: Array<{ id: DashboardTab; label: string; Icon: typeof Radio }> = [
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
// ─── Shared UI barrel export ────────────────────────────────────────────────
|
||||
|
||||
export {
|
||||
EmptyStateMascot,
|
||||
MascotImage,
|
||||
} from "../../widgets/mascot/MascotImage";
|
||||
export { Badge } from "./badge";
|
||||
export { Button } from "./button";
|
||||
export {
|
||||
|
||||
@@ -209,4 +209,3 @@ export function useDashboardSocket(handlers: WsHandlers) {
|
||||
}
|
||||
|
||||
// Alias for backward compatibility
|
||||
export { useDashboardSocket as useWsSocket };
|
||||
|
||||
Reference in New Issue
Block a user