Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import { useState, useRef, useEffect, useCallback, useMemo, forwardRef, useImperativeHandle } from "react";

import { createLmStudioHandler, type LmStudioConfig } from "@/lib/lmStudio";
import { notifyMessageComplete } from "@/lib/notifications";
import { getTextFromContent, updateAt } from "@/lib/messageUtils";
import { createLmStudioHandler, type LmStudioConfig } from "@mc/lib/lmStudio";
import { notifyMessageComplete } from "@mc/lib/notifications";
import { getTextFromContent, updateAt } from "@mc/lib/messageUtils";
import {
NO_REPLY_MARKER,
STOP_REASON_INJECTED,
hasHeartbeatOnOwnLine,
hasUnquotedMarker,
} from "@/lib/constants";
import { postScrollPosition, postRunState, postModelState, type BridgeMessage } from "@/lib/nativeBridge";
} from "@mc/lib/constants";
import { postScrollPosition, postRunState, postModelState, type BridgeMessage } from "@mc/lib/nativeBridge";
import {
appendContentDelta as appendContentDeltaToMessages,
appendThinkingDelta as appendThinkingDeltaToMessages,
Expand All @@ -22,10 +22,10 @@
resolveToolCall as resolveToolCallInMessages,
startThinkingBlock as startThinkingBlockInMessages,
upsertCanvasPluginByMessageId as upsertCanvasPluginByMessageIdInMessages,
} from "@/lib/chat/streamMutations";
import { buildDisplayMessages } from "@/lib/chat/messageTransforms";
import { applyNativeZenMode } from "@/lib/chat/zenBridge";
import { DEFAULT_INPUT_ZONE_HEIGHT, getChatBottomPad } from "@/lib/chat/layout";
} from "@mc/lib/chat/streamMutations";
import { buildDisplayMessages } from "@mc/lib/chat/messageTransforms";
import { applyNativeZenMode } from "@mc/lib/chat/zenBridge";
import { DEFAULT_INPUT_ZONE_HEIGHT, getChatBottomPad } from "@mc/lib/chat/layout";

import type {
BackendMode,
Expand All @@ -34,36 +34,36 @@
Message,
ModelChoice,
PluginContentPart,
} from "@/types/chat";

import type { Command } from "@/components/CommandSheet";
import { type ChatInputHandle } from "@/components/ChatInput";
import { TurnstileGate } from "@/components/TurnstileGate";
import { ChatChrome } from "@/components/chat/ChatChrome";
import { ChatViewport } from "@/components/chat/ChatViewport";
import { ChatComposerBar } from "@/components/chat/ChatComposerBar";

import { useThinkingState } from "@/hooks/useThinkingState";
import { PIN_LOCK_MS, useScrollManager } from "@/hooks/useScrollManager";
import { useKeyboardLayout } from "@/hooks/useKeyboardLayout";
import { useTheme } from "@/hooks/useTheme";
import { useZenMode } from "@/hooks/useZenMode";
import { useSubagentStore } from "@/hooks/useSubagentStore";
import { formatSessionName } from "@/hooks/useSessionSwitcher";
import { useAppMode } from "@/hooks/useAppMode";

import { useModeBootstrap } from "@/hooks/chat/useModeBootstrap";
import { useOpenClawRuntime } from "@/hooks/chat/useOpenClawRuntime";
import { useQuoteSelection } from "@/hooks/chat/useQuoteSelection";
import { useQueuedMessage } from "@/hooks/chat/useQueuedMessage";
import { useInputAttachments } from "@/hooks/chat/useInputAttachments";
import { useUnreadTabIndicator } from "@/hooks/chat/useUnreadTabIndicator";
import { useNativeBridgeMessage } from "@/hooks/chat/useNativeBridgeMessage";
import { useDemoRuntime } from "@/hooks/chat/useDemoRuntime";
import { useLmStudioRuntime } from "@/hooks/chat/useLmStudioRuntime";
import { useMessageSender } from "@/hooks/chat/useMessageSender";
import { appendPluginActionPayloadToUrl, mergePluginActionPayload } from "@/lib/plugins/actionPayload";
import type { PluginActionInvocation } from "@/lib/plugins/types";
} from "@mc/types/chat";

import type { Command } from "@mc/components/CommandSheet";
import { type ChatInputHandle } from "@mc/components/ChatInput";
import { TurnstileGate } from "@mc/components/TurnstileGate";
import { ChatChrome } from "@mc/components/chat/ChatChrome";
import { ChatViewport } from "@mc/components/chat/ChatViewport";
import { ChatComposerBar } from "@mc/components/chat/ChatComposerBar";

import { useThinkingState } from "@mc/hooks/useThinkingState";
import { PIN_LOCK_MS, useScrollManager } from "@mc/hooks/useScrollManager";
import { useKeyboardLayout } from "@mc/hooks/useKeyboardLayout";
import { useTheme } from "@mc/hooks/useTheme";
import { useZenMode } from "@mc/hooks/useZenMode";
import { useSubagentStore } from "@mc/hooks/useSubagentStore";
import { formatSessionName } from "@mc/hooks/useSessionSwitcher";
import { useAppMode } from "@mc/hooks/useAppMode";

import { useModeBootstrap } from "@mc/hooks/chat/useModeBootstrap";
import { useOpenClawRuntime } from "@mc/hooks/chat/useOpenClawRuntime";
import { useQuoteSelection } from "@mc/hooks/chat/useQuoteSelection";
import { useQueuedMessage } from "@mc/hooks/chat/useQueuedMessage";
import { useInputAttachments } from "@mc/hooks/chat/useInputAttachments";
import { useUnreadTabIndicator } from "@mc/hooks/chat/useUnreadTabIndicator";
import { useNativeBridgeMessage } from "@mc/hooks/chat/useNativeBridgeMessage";
import { useDemoRuntime } from "@mc/hooks/chat/useDemoRuntime";
import { useLmStudioRuntime } from "@mc/hooks/chat/useLmStudioRuntime";
import { useMessageSender } from "@mc/hooks/chat/useMessageSender";
import { appendPluginActionPayloadToUrl, mergePluginActionPayload } from "@mc/lib/plugins/actionPayload";
import type { PluginActionInvocation } from "@mc/lib/plugins/types";

const TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY ?? null;
const ZEN_TOGGLE_PIN_MS = 700;
Expand Down Expand Up @@ -152,7 +152,7 @@
}
}
} catch {}
}, []);

Check warning on line 155 in app/page.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useEffect has a missing dependency: 'isNativeRef'. Either include it or remove the dependency array

const handlePinSubagent = useCallback((info: { toolCallId: string | null; childSessionKey: string | null; taskName: string; model: string | null }) => {
setPinnedSubagent((prev) => {
Expand Down Expand Up @@ -248,7 +248,7 @@
const preview = getTextFromContent(msg.content);
if (hasHeartbeatOnOwnLine(preview) || hasUnquotedMarker(preview, NO_REPLY_MARKER)) return;
notifyMessageComplete(preview);
}, []);

Check warning on line 251 in app/page.tsx

View workflow job for this annotation

GitHub Actions / test

React Hook useCallback has a missing dependency: 'isDetachedRef'. Either include it or remove the dependency array

const [turnstileVerified, setTurnstileVerified] = useState(!TURNSTILE_SITE_KEY);
const [turnstileChecked, setTurnstileChecked] = useState(!TURNSTILE_SITE_KEY);
Expand Down
4 changes: 2 additions & 2 deletions components/ChatHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BackendMode } from "@/types/chat";
import type { ConnectionState } from "@/lib/useWebSocket";
import type { BackendMode } from "@mc/types/chat";
import type { ConnectionState } from "@mc/lib/useWebSocket";

interface ChatHeaderProps {
currentModel: string | null;
Expand Down Expand Up @@ -64,8 +64,8 @@
className="flex h-8 w-8 items-center justify-center rounded-full border border-border bg-card transition-colors hover:bg-accent active:bg-accent"
aria-label="Open settings"
>
<img src="/logo.png" alt="MobileClaw" className="h-7 dark:hidden" />

Check warning on line 67 in components/ChatHeader.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<img src="/logo-dark.png" alt="MobileClaw" className="hidden h-7 dark:block" />

Check warning on line 68 in components/ChatHeader.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</button>
<div className="flex min-w-0 flex-1 flex-col items-center">
{canSwitch ? (
Expand Down
12 changes: 6 additions & 6 deletions components/ChatInput.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";

import React, { useState, useRef, useEffect, useImperativeHandle, forwardRef, useMemo } from "react";
import { ALL_COMMANDS, type Command } from "@/components/CommandSheet";
import maps from "@/maps.json";
import { ImageLightbox } from "@/components/ImageLightbox";
import type { ModelChoice, ImageAttachment, InputAttachment } from "@/types/chat";
import { inputAttachmentRegistry } from "@/lib/plugins/inputAttachmentRegistry";
import { SQUIRCLE_RADIUS, PILL_BASE_HEIGHT, RADIUS_TRANSITION } from "@/lib/constants";
import { ALL_COMMANDS, type Command } from "@mc/components/CommandSheet";
import maps from "@mc/maps.json";
import { ImageLightbox } from "@mc/components/ImageLightbox";
import type { ModelChoice, ImageAttachment, InputAttachment } from "@mc/types/chat";
import { inputAttachmentRegistry } from "@mc/lib/plugins/inputAttachmentRegistry";
import { SQUIRCLE_RADIUS, PILL_BASE_HEIGHT, RADIUS_TRANSITION } from "@mc/lib/constants";

export interface ModelSuggestion {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion components/CommandSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState, useRef, useEffect } from "react";
import type { ModelChoice } from "@/types/chat";
import type { ModelChoice } from "@mc/types/chat";

export interface Command {
name: string;
Expand Down
8 changes: 4 additions & 4 deletions components/FloatingSubagentPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { useCallback, useState, useEffect } from "react";
import { SubagentActivityFeed } from "@/components/SubagentActivityFeed";
import { SlideContent } from "@/components/SlideContent";
import type { SubagentStore } from "@/hooks/useSubagentStore";
import { useSwipeAction } from "@/hooks/useSwipeAction";
import { SubagentActivityFeed } from "@mc/components/SubagentActivityFeed";
import { SlideContent } from "@mc/components/SlideContent";
import type { SubagentStore } from "@mc/hooks/useSubagentStore";
import { useSwipeAction } from "@mc/hooks/useSwipeAction";

interface FloatingSubagentPanelProps {
toolCallId: string | null;
Expand Down
4 changes: 2 additions & 2 deletions components/ImageThumbnails.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { useState } from "react";
import type { ContentPart } from "@/types/chat";
import { ImageLightbox } from "@/components/ImageLightbox";
import type { ContentPart } from "@mc/types/chat";
import { ImageLightbox } from "@mc/components/ImageLightbox";

export function ImageThumbnails({ images }: { images: ContentPart[] }) {
const [lightboxSrc, setLightboxSrc] = useState<string | null>(null);
Expand All @@ -22,7 +22,7 @@
disabled={!src}
>
{src ? (
<img src={src} alt="Attached" className="h-full w-full object-cover" />

Check warning on line 25 in components/ImageThumbnails.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
) : (
<div className="flex h-full w-full items-center justify-center">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" className="text-muted-foreground">
Expand Down
2 changes: 1 addition & 1 deletion components/LinkPreviewCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState } from "react";
import type { UnfurlData } from "@/lib/unfurl";
import type { UnfurlData } from "@mc/lib/unfurl";

export function LinkPreviewCard({ data }: { data: UnfurlData }) {
const [imgError, setImgError] = useState(false);
Expand All @@ -15,7 +15,7 @@
className="flex items-center gap-2.5 rounded-lg border border-border bg-card p-2 no-underline transition-colors hover:bg-secondary"
>
{showImage && (
<img

Check warning on line 18 in components/LinkPreviewCard.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
src={data.image}
alt=""
onError={() => setImgError(true)}
Expand All @@ -31,7 +31,7 @@
)}
<div className="mt-1 flex items-center gap-1">
{data.favicon ? (
<img src={data.favicon} alt="" className="h-3 w-3 rounded-sm" onError={(e) => { (e.target as HTMLImageElement).style.display = "none"; }} />

Check warning on line 34 in components/LinkPreviewCard.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
) : (
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="text-muted-foreground">
<circle cx="12" cy="12" r="10" />
Expand Down
42 changes: 21 additions & 21 deletions components/MessageRow.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
"use client";

import React, { useState, useEffect, useRef } from "react";
import type { ContentPart, Message } from "@/types/chat";
import { getTextFromContent, getImages, getFiles } from "@/lib/messageUtils";
import { HEARTBEAT_MARKER, NO_REPLY_MARKER, SYSTEM_PREFIX, SYSTEM_MESSAGE_PREFIX, STOP_REASON_INJECTED, isToolCallPart, SPAWN_TOOL_NAME, hasUnquotedMarker, hasHeartbeatOnOwnLine, SQUIRCLE_RADIUS, MESSAGE_SEND_ANIMATION } from "@/lib/constants";
import { useExpandablePanel } from "@/hooks/useExpandablePanel";
import { SlideContent } from "@/components/SlideContent";
import { MarkdownContent } from "@/components/markdown/MarkdownContent";
import { StreamingText } from "@/components/StreamingText";
import { ToolCallPill } from "@/components/ToolCallPill";
import { ImageThumbnails } from "@/components/ImageThumbnails";
import { SmoothGrow } from "@/components/SmoothGrow";
import { ZenToggle } from "@/components/ZenToggle";
import { PluginRenderer } from "@/components/plugins/PluginRenderer";
import type { SubagentStore } from "@/hooks/useSubagentStore";
import { isNativeMode, postLinkTap, postImageTap } from "@/lib/nativeBridge";
import { ZEN_SLIDE_MS, ZEN_FADE_MS } from "@/lib/chat/zenUi";
import { useUnfurl } from "@/hooks/useUnfurl";
import { LinkPreviewCard } from "@/components/LinkPreviewCard";
import { isPluginPart } from "@/lib/constants";
import { pluginRegistry } from "@/lib/plugins/registry";
import type { PluginActionHandler } from "@/lib/plugins/types";
import type { PluginContentPart } from "@/types/chat";
import type { ContentPart, Message } from "@mc/types/chat";
import { getTextFromContent, getImages, getFiles } from "@mc/lib/messageUtils";
import { HEARTBEAT_MARKER, NO_REPLY_MARKER, SYSTEM_PREFIX, SYSTEM_MESSAGE_PREFIX, STOP_REASON_INJECTED, isToolCallPart, SPAWN_TOOL_NAME, hasUnquotedMarker, hasHeartbeatOnOwnLine, SQUIRCLE_RADIUS, MESSAGE_SEND_ANIMATION } from "@mc/lib/constants";
import { useExpandablePanel } from "@mc/hooks/useExpandablePanel";
import { SlideContent } from "@mc/components/SlideContent";
import { MarkdownContent } from "@mc/components/markdown/MarkdownContent";
import { StreamingText } from "@mc/components/StreamingText";
import { ToolCallPill } from "@mc/components/ToolCallPill";
import { ImageThumbnails } from "@mc/components/ImageThumbnails";
import { SmoothGrow } from "@mc/components/SmoothGrow";
import { ZenToggle } from "@mc/components/ZenToggle";
import { PluginRenderer } from "@mc/components/plugins/PluginRenderer";
import type { SubagentStore } from "@mc/hooks/useSubagentStore";
import { isNativeMode, postLinkTap, postImageTap } from "@mc/lib/nativeBridge";
import { ZEN_SLIDE_MS, ZEN_FADE_MS } from "@mc/lib/chat/zenUi";
import { useUnfurl } from "@mc/hooks/useUnfurl";
import { LinkPreviewCard } from "@mc/components/LinkPreviewCard";
import { isPluginPart } from "@mc/lib/constants";
import { pluginRegistry } from "@mc/lib/plugins/registry";
import type { PluginActionHandler } from "@mc/lib/plugins/types";
import type { PluginContentPart } from "@mc/types/chat";

// ── File Thumbnails ──────────────────────────────────────────────────────────

Expand Down
4 changes: 2 additions & 2 deletions components/SessionSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { useState, useRef, useEffect } from "react";
import type { SessionInfo } from "@/types/chat";
import { formatSessionName, formatRelativeTime } from "@/hooks/useSessionSwitcher";
import type { SessionInfo } from "@mc/types/chat";
import { formatSessionName, formatRelativeTime } from "@mc/hooks/useSessionSwitcher";

const KIND_LABELS: Record<SessionInfo["kind"], string> = {
main: "main",
Expand Down
4 changes: 2 additions & 2 deletions components/SetupDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import { useState, useRef, useEffect, useCallback } from "react";
import type { ConnectionConfig } from "@/types/chat";
import { fetchLmStudioModels, type LmStudioModel } from "@/lib/lmStudio";
import type { ConnectionConfig } from "@mc/types/chat";
import { fetchLmStudioModels, type LmStudioModel } from "@mc/lib/lmStudio";

const OPENCLAW_SAVED_CONFIGS_KEY = "openclaw-saved-configs";
const OPENCLAW_SAVED_CONFIGS_LIMIT = 10;
Expand All @@ -18,7 +18,7 @@
try {
const raw = window.localStorage.getItem(OPENCLAW_SAVED_CONFIGS_KEY);
if (!raw) return [];
const parsed = JSON.parse(raw);

Check warning on line 21 in components/SetupDialog.tsx

View workflow job for this annotation

GitHub Actions / test

Unsafe assignment of an `any` value
if (!Array.isArray(parsed)) return [];

const valid = parsed
Expand Down Expand Up @@ -289,7 +289,7 @@
boxShadow: isClosing ? "0 0 20px oklch(0.55 0 0 / 0.15)" : "none",
}}
>
<img src="/logo.png" alt="" className="h-9 dark:hidden" />

Check warning on line 292 in components/SetupDialog.tsx

View workflow job for this annotation

GitHub Actions / test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<img src="/logo-dark.png" alt="" className="hidden h-9 dark:block" />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/StreamingText.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState, useRef, useEffect } from "react";
import { MarkdownContent, StreamingCursor } from "@/components/markdown/MarkdownContent";
import { MarkdownContent, StreamingCursor } from "@mc/components/markdown/MarkdownContent";

// Module-level: remembered rate from previous responses (persists across component instances)
let learnedCharsPerMs = 0.15; // Default: ~150 chars/sec, learned from history
Expand Down
2 changes: 1 addition & 1 deletion components/SubagentActivityFeed.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useState, useEffect, useRef } from "react";
import type { SubagentEntry, SubagentSession } from "@/types/chat";
import type { SubagentEntry, SubagentSession } from "@mc/types/chat";

interface SubagentActivityFeedProps {
getEntries: () => { entries: SubagentEntry[]; status: SubagentSession["status"] } | null;
Expand Down
12 changes: 6 additions & 6 deletions components/ToolCallPill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { useCallback, useEffect, useState } from "react";
import type { CSSProperties } from "react";
import { getToolDisplay, parseArgs } from "@/lib/toolDisplay";
import { SubagentActivityFeed } from "@/components/SubagentActivityFeed";
import { SlideContent } from "@/components/SlideContent";
import type { SubagentStore } from "@/hooks/useSubagentStore";
import { getToolDisplay, parseArgs } from "@mc/lib/toolDisplay";
import { SubagentActivityFeed } from "@mc/components/SubagentActivityFeed";
import { SlideContent } from "@mc/components/SlideContent";
import type { SubagentStore } from "@mc/hooks/useSubagentStore";
import {
isEditTool,
isReadTool,
Expand All @@ -18,8 +18,8 @@ import {
TOOL_CALL_BUBBLE_BORDER,
TOOL_CALL_BUBBLE_BORDER_ERROR,
TOOL_CALL_BUBBLE_SHADOW,
} from "@/lib/constants";
import { useSwipeAction } from "@/hooks/useSwipeAction";
} from "@mc/lib/constants";
import { useSwipeAction } from "@mc/hooks/useSwipeAction";

interface PinInfo {
toolCallId: string | null;
Expand Down
10 changes: 5 additions & 5 deletions components/chat/ChatChrome.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { ChatHeader } from "@/components/ChatHeader";
import { SessionSheet } from "@/components/SessionSheet";
import { SetupDialog } from "@/components/SetupDialog";
import type { ConnectionState } from "@/lib/useWebSocket";
import type { BackendMode, ConnectionConfig, SessionInfo } from "@/types/chat";
import { ChatHeader } from "@mc/components/ChatHeader";
import { SessionSheet } from "@mc/components/SessionSheet";
import { SetupDialog } from "@mc/components/SetupDialog";
import type { ConnectionState } from "@mc/lib/useWebSocket";
import type { BackendMode, ConnectionConfig, SessionInfo } from "@mc/types/chat";

interface ChatChromeProps {
hideChrome: boolean;
Expand Down
12 changes: 6 additions & 6 deletions components/chat/ChatComposerBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import React from "react";

import { ChatInput, type ChatInputHandle } from "@/components/ChatInput";
import { FloatingSubagentPanel } from "@/components/FloatingSubagentPanel";
import { QueuePill } from "@/components/chat/QueuePill";
import type { Command } from "@/components/CommandSheet";
import type { useSubagentStore } from "@/hooks/useSubagentStore";
import type { BackendMode, ImageAttachment, InputAttachment, ModelChoice } from "@/types/chat";
import { ChatInput, type ChatInputHandle } from "@mc/components/ChatInput";
import { FloatingSubagentPanel } from "@mc/components/FloatingSubagentPanel";
import { QueuePill } from "@mc/components/chat/QueuePill";
import type { Command } from "@mc/components/CommandSheet";
import type { useSubagentStore } from "@mc/hooks/useSubagentStore";
import type { BackendMode, ImageAttachment, InputAttachment, ModelChoice } from "@mc/types/chat";

interface ChatComposerBarProps {
isNative: boolean;
Expand Down
20 changes: 10 additions & 10 deletions components/chat/ChatViewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

import React, { useMemo, useState, useEffect, useLayoutEffect, useCallback, useRef } from "react";

import { MessageRow } from "@/components/MessageRow";
import { ThinkingIndicator } from "@/components/ThinkingIndicator";
import { ZenToggle } from "@/components/ZenToggle";
import { formatMessageTime, getMessageSide } from "@/lib/messageUtils";
import { STOP_REASON_INJECTED, isToolCallPart, MESSAGE_SEND_ANIMATION } from "@/lib/constants";
import { ZEN_SLIDE_MS, ZEN_FADE_MS, ZEN_TOGGLE_FRAME_MS } from "@/lib/chat/zenUi";
import { getThinkingIndicatorBottom } from "@/lib/chat/layout";
import type { Message } from "@/types/chat";
import type { useSubagentStore } from "@/hooks/useSubagentStore";
import type { PluginActionHandler } from "@/lib/plugins/types";
import { MessageRow } from "@mc/components/MessageRow";
import { ThinkingIndicator } from "@mc/components/ThinkingIndicator";
import { ZenToggle } from "@mc/components/ZenToggle";
import { formatMessageTime, getMessageSide } from "@mc/lib/messageUtils";
import { STOP_REASON_INJECTED, isToolCallPart, MESSAGE_SEND_ANIMATION } from "@mc/lib/constants";
import { ZEN_SLIDE_MS, ZEN_FADE_MS, ZEN_TOGGLE_FRAME_MS } from "@mc/lib/chat/zenUi";
import { getThinkingIndicatorBottom } from "@mc/lib/chat/layout";
import type { Message } from "@mc/types/chat";
import type { useSubagentStore } from "@mc/hooks/useSubagentStore";
import type { PluginActionHandler } from "@mc/lib/plugins/types";

const TIME_GAP_THRESHOLD_MS = 10 * 60 * 1000;
const ZEN_COLLAPSE_TOTAL_MS = ZEN_TOGGLE_FRAME_MS + ZEN_FADE_MS + ZEN_SLIDE_MS;
Expand Down
10 changes: 5 additions & 5 deletions components/plugins/PluginRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"use client";

import { InvalidPluginCard } from "@/components/plugins/InvalidPluginCard";
import { UnknownPluginCard } from "@/components/plugins/UnknownPluginCard";
import { pluginRegistry } from "@/lib/plugins/registry";
import type { PluginActionHandler, PluginParseResult } from "@/lib/plugins/types";
import type { PluginContentPart } from "@/types/chat";
import { InvalidPluginCard } from "@mc/components/plugins/InvalidPluginCard";
import { UnknownPluginCard } from "@mc/components/plugins/UnknownPluginCard";
import { pluginRegistry } from "@mc/lib/plugins/registry";
import type { PluginActionHandler, PluginParseResult } from "@mc/lib/plugins/types";
import type { PluginContentPart } from "@mc/types/chat";

export function PluginRenderer({
part,
Expand Down
8 changes: 4 additions & 4 deletions hooks/chat/useDemoRuntime.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect, useRef } from "react";

import { createDemoHandler } from "@/lib/demoMode";
import type { AgentEventPayload, PluginContentPart } from "@/types/chat";
import type { useSubagentStore } from "@/hooks/useSubagentStore";
import { SPAWN_TOOL_NAME } from "@/lib/constants";
import { createDemoHandler } from "@mc/lib/demoMode";
import type { AgentEventPayload, PluginContentPart } from "@mc/types/chat";
import type { useSubagentStore } from "@mc/hooks/useSubagentStore";
import { SPAWN_TOOL_NAME } from "@mc/lib/constants";

interface UseDemoRuntimeOptions {
isDemoMode: boolean;
Expand Down
4 changes: 2 additions & 2 deletions hooks/chat/useInputAttachments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useCallback, useEffect, useRef } from "react";
import type { InputAttachment } from "@/types/chat";
import { inputAttachmentRegistry } from "@/lib/plugins/inputAttachmentRegistry";
import type { InputAttachment } from "@mc/types/chat";
import { inputAttachmentRegistry } from "@mc/lib/plugins/inputAttachmentRegistry";

const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB

Expand Down
Loading
Loading